linux/arch/arm/mach-mvebu
Thomas Petazzoni 8d33f5146f ARM: mvebu: disable I/O coherency on non-SMP situations on Armada 370/375/38x/XP
commit e553554536 upstream.

Enabling the hardware I/O coherency on Armada 370, Armada 375, Armada
38x and Armada XP requires a certain number of conditions:

 - On Armada 370, the cache policy must be set to write-allocate.

 - On Armada 375, 38x and XP, the cache policy must be set to
   write-allocate, the pages must be mapped with the shareable
   attribute, and the SMP bit must be set

Currently, on Armada XP, when CONFIG_SMP is enabled, those conditions
are met. However, when Armada XP is used in a !CONFIG_SMP kernel, none
of these conditions are met. With Armada 370, the situation is worse:
since the processor is single core, regardless of whether CONFIG_SMP
or !CONFIG_SMP is used, the cache policy will be set to write-back by
the kernel and not write-allocate.

Since solving this problem turns out to be quite complicated, and we
don't want to let users with a mainline kernel known to have
infrequent but existing data corruptions, this commit proposes to
simply disable hardware I/O coherency in situations where it is known
not to work.

And basically, the is_smp() function of the kernel tells us whether it
is OK to enable hardware I/O coherency or not, so this commit slightly
refactors the coherency_type() function to return
COHERENCY_FABRIC_TYPE_NONE when is_smp() is false, or the appropriate
type of the coherency fabric in the other case.

Thanks to this, the I/O coherency fabric will no longer be used at all
in !CONFIG_SMP configurations. It will continue to be used in
CONFIG_SMP configurations on Armada XP, Armada 375 and Armada 38x
(which are multiple cores processors), but will no longer be used on
Armada 370 (which is a single core processor).

In the process, it simplifies the implementation of the
coherency_type() function, and adds a missing call to of_node_put().

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fixes: e60304f8cb ("arm: mvebu: Add hardware I/O Coherency support")
Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Link: https://lkml.kernel.org/r/1415871540-20302-3-git-send-email-thomas.petazzoni@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-16 06:59:34 -08:00
..
include/mach Merge branch 'kirkwood/drivers' of git://git.infradead.org/users/jcooper/linux into late/kirkwood 2012-09-22 14:23:11 -07:00
Kconfig ARM: mvebu: support running big-endian 2013-10-19 20:46:34 +01:00
Makefile ARM: mvebu: Add support to get the ID and the revision of a SoC 2014-01-14 01:59:16 +00:00
armada-370-xp.c ARM: mvebu: Add quirk for i2c for the OpenBlocks AX3-4 board 2014-01-14 02:00:01 +00:00
armada-370-xp.h ARM: mvebu: move Armada 370/XP specific definitions to armada-370-xp.h 2013-12-27 18:08:19 +00:00
coherency.c ARM: mvebu: disable I/O coherency on non-SMP situations on Armada 370/375/38x/XP 2015-01-16 06:59:34 -08:00
coherency.h ARM: mvebu: fix some sparse warnings 2013-11-24 03:27:54 +00:00
coherency_ll.S ARM: mvebu: support running big-endian 2013-10-19 20:46:34 +01:00
common.h ARM: mvebu: move Armada 370/XP specific definitions to armada-370-xp.h 2013-12-27 18:08:19 +00:00
headsmp.S ARM: mvebu: support running big-endian 2013-10-19 20:46:34 +01:00
hotplug.c ARM: mvebu: fix some sparse warnings 2013-11-24 03:27:54 +00:00
mvebu-soc-id.c ARM: mvebu: mvebu-soc-id: keep clock enabled if PCIe unit is enabled 2014-06-07 10:28:22 -07:00
mvebu-soc-id.h ARM: mvebu: Add support to get the ID and the revision of a SoC 2014-01-14 01:59:16 +00:00
platsmp.c ARM: mvebu: fix some sparse warnings 2013-11-24 03:27:54 +00:00
pmsu.c ARM: mvebu: fix some sparse warnings 2013-11-24 03:27:54 +00:00
pmsu.h arm: mvebu: Add initial support for power managmement service unit 2012-11-21 16:49:36 +01:00
system-controller.c ARM: mvebu: fix some sparse warnings 2013-11-24 03:27:54 +00:00