Message ID | 1360041732-17936-13-git-send-email-nicolas.pitre@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Feb 05, 2013 at 12:22:09AM -0500, Nicolas Pitre wrote: > + /* > + * Multi-cluster systems may need this data when non-coherent, during > + * cluster power-up/power-down. Make sure it reaches main memory: > + */ > + __cpuc_flush_dcache_area(info, sizeof *info); > + __cpuc_flush_dcache_area(&info, sizeof info); > + outer_clean_range(virt_to_phys(info), virt_to_phys(info + 1)); > + outer_clean_range(virt_to_phys(&info), virt_to_phys(&info + 1)); This seems to be a recurring theme throughout these patches. What it's saying is that we need a proper way to do this, rather than keep on open coding this same thing time and time again. So, it's do something about that rather than having to go back and rework all this stuff later, creating "pointless churn" that Linus really hates.
diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig index d032f74ff2..cd4ac9f001 100644 --- a/drivers/bus/Kconfig +++ b/drivers/bus/Kconfig @@ -22,5 +22,6 @@ config OMAP_INTERCONNECT config ARM_CCI bool "ARM CCI driver support" + depends on ARM endmenu diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c index 11c1513440..3bdab2c135 100644 --- a/drivers/bus/arm-cci.c +++ b/drivers/bus/arm-cci.c @@ -21,6 +21,10 @@ #include <linux/slab.h> #include <linux/arm-cci.h> +#include <asm/cacheflush.h> +#include <asm/memory.h> +#include <asm/outercache.h> + #define CCI_STATUS_OFFSET 0xc #define STATUS_CHANGE_PENDING (1 << 0) @@ -78,6 +82,15 @@ static int cci_driver_probe(struct platform_device *pdev) goto ioremap_err; } + /* + * Multi-cluster systems may need this data when non-coherent, during + * cluster power-up/power-down. Make sure it reaches main memory: + */ + __cpuc_flush_dcache_area(info, sizeof *info); + __cpuc_flush_dcache_area(&info, sizeof info); + outer_clean_range(virt_to_phys(info), virt_to_phys(info + 1)); + outer_clean_range(virt_to_phys(&info), virt_to_phys(&info + 1)); + platform_set_drvdata(pdev, info); pr_info("CCI loaded at %p\n", info->baseaddr);