From: Al Stone ahs3@redhat.com
This patch is a re-submittal of a previous patch from the Samsung LT, specifically 5bf534ab87a62e717771d5548b66296ca8e9fbe5. It has been redone to fit the acpi-ltfixes branch of acpi.git, and is needed to prevent DMA errors from occurring.
This is required when LPAE is enabled.
Signed-off-by: Tushar Behera tushar.behera@linaro.org Signed-off-by: Al Stone al.stone@linaro.org --- arch/arm/mach-exynos/mach-exynos5-dt.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c index f874b77..863042d 100644 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c @@ -14,6 +14,7 @@ #include <linux/memblock.h> #include <linux/io.h> #include <linux/clocksource.h> +#include <linux/dma-mapping.h>
#include <asm/mach/arch.h> #include <mach/regs-pmu.h> @@ -23,6 +24,26 @@
#include "common.h"
+static u64 dma_mask64 = DMA_BIT_MASK(64); + +static int exynos5250_platform_notifier(struct notifier_block *nb, + unsigned long event, void *__dev) +{ + struct device *dev = __dev; + + if (event != BUS_NOTIFY_ADD_DEVICE) + return NOTIFY_DONE; + + dev->dma_mask = &dma_mask64; + dev->coherent_dma_mask = DMA_BIT_MASK(64); + + return NOTIFY_OK; +} + +static struct notifier_block exynos5250_platform_nb = { + .notifier_call = exynos5250_platform_notifier, +}; + static void __init exynos5_dt_machine_init(void) { struct device_node *i2c_np; @@ -47,6 +68,9 @@ static void __init exynos5_dt_machine_init(void) } }
+ if (of_machine_is_compatible("samsung,exynos5250")) + bus_register_notifier(&platform_bus_type, &exynos5250_platform_nb); + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); }
On 13 August 2013 07:50, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
This patch is a re-submittal of a previous patch from the Samsung LT, specifically 5bf534ab87a62e717771d5548b66296ca8e9fbe5. It has been redone to fit the acpi-ltfixes branch of acpi.git, and is needed to prevent DMA errors from occurring.
This is required when LPAE is enabled.
Signed-off-by: Tushar Behera tushar.behera@linaro.org Signed-off-by: Al Stone al.stone@linaro.org
FYI.
Recently I had posted this patch for upstreaming.
Russell King has another set of patches[1], particularly [2] which fixes the issue. I am not sure when this patch would get merged, but that means that the LT patch is not going to be merged upstream [3].
So if we also have a look at [2] and include that instead. This patch [2] has already been added to linux-linaro-core-tracking today.
[1] http://www.spinics.net/lists/arm-kernel/msg263631.html [2] http://www.spinics.net/lists/arm-kernel/msg263680.html [3] http://www.spinics.net/lists/linux-samsung-soc/msg21359.html
arch/arm/mach-exynos/mach-exynos5-dt.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c index f874b77..863042d 100644 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c @@ -14,6 +14,7 @@ #include <linux/memblock.h> #include <linux/io.h> #include <linux/clocksource.h> +#include <linux/dma-mapping.h>
#include <asm/mach/arch.h> #include <mach/regs-pmu.h> @@ -23,6 +24,26 @@
#include "common.h"
+static u64 dma_mask64 = DMA_BIT_MASK(64);
+static int exynos5250_platform_notifier(struct notifier_block *nb,
unsigned long event, void *__dev)
+{
struct device *dev = __dev;
if (event != BUS_NOTIFY_ADD_DEVICE)
return NOTIFY_DONE;
dev->dma_mask = &dma_mask64;
dev->coherent_dma_mask = DMA_BIT_MASK(64);
return NOTIFY_OK;
+}
+static struct notifier_block exynos5250_platform_nb = {
.notifier_call = exynos5250_platform_notifier,
+};
static void __init exynos5_dt_machine_init(void) { struct device_node *i2c_np; @@ -47,6 +68,9 @@ static void __init exynos5_dt_machine_init(void) } }
if (of_machine_is_compatible("samsung,exynos5250"))
bus_register_notifier(&platform_bus_type, &exynos5250_platform_nb);
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}
-- 1.8.3.1
On 13/08/13 04:13, Tushar Behera wrote:
On 13 August 2013 07:50, al.stone@linaro.org wrote:
From: Al Stone ahs3@redhat.com
This patch is a re-submittal of a previous patch from the Samsung LT, specifically 5bf534ab87a62e717771d5548b66296ca8e9fbe5. It has been redone to fit the acpi-ltfixes branch of acpi.git, and is needed to prevent DMA errors from occurring.
This is required when LPAE is enabled.
Signed-off-by: Tushar Behera tushar.behera@linaro.org Signed-off-by: Al Stone al.stone@linaro.org
FYI.
Recently I had posted this patch for upstreaming.
Russell King has another set of patches[1], particularly [2] which fixes the issue. I am not sure when this patch would get merged, but that means that the LT patch is not going to be merged upstream [3].
So if we also have a look at [2] and include that instead. This patch [2] has already been added to linux-linaro-core-tracking today.
[1] http://www.spinics.net/lists/arm-kernel/msg263631.html [2] http://www.spinics.net/lists/arm-kernel/msg263680.html [3] http://www.spinics.net/lists/linux-samsung-soc/msg21359.html
Thanks for the info, as the branch it will be applied to is not destined for upstream we can live with the patch [3] until RMKs work makes upstream.
I have applied Als rejigged patch for now.
Graeme
arch/arm/mach-exynos/mach-exynos5-dt.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c index f874b77..863042d 100644 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c @@ -14,6 +14,7 @@ #include <linux/memblock.h> #include <linux/io.h> #include <linux/clocksource.h> +#include <linux/dma-mapping.h>
#include <asm/mach/arch.h> #include <mach/regs-pmu.h> @@ -23,6 +24,26 @@
#include "common.h"
+static u64 dma_mask64 = DMA_BIT_MASK(64);
+static int exynos5250_platform_notifier(struct notifier_block *nb,
unsigned long event, void *__dev)
+{
struct device *dev = __dev;
if (event != BUS_NOTIFY_ADD_DEVICE)
return NOTIFY_DONE;
dev->dma_mask = &dma_mask64;
dev->coherent_dma_mask = DMA_BIT_MASK(64);
return NOTIFY_OK;
+}
+static struct notifier_block exynos5250_platform_nb = {
.notifier_call = exynos5250_platform_notifier,
+};
- static void __init exynos5_dt_machine_init(void) { struct device_node *i2c_np;
@@ -47,6 +68,9 @@ static void __init exynos5_dt_machine_init(void) } }
if (of_machine_is_compatible("samsung,exynos5250"))
bus_register_notifier(&platform_bus_type, &exynos5250_platform_nb);
}of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-- 1.8.3.1