linux-uconsole/arch/arm/mm
黄涛 b8ec179618 rk3188: ARM errata: no direct eviction
Porting from Samsung.

761320: Full cache line writes to the same memory region from at least two processors
        might deadlock the processor

Status
Affects: Product Cortex-A9 MPCore.
Fault Type: Programmer Category B (Rare)
Fault Status: Present in: All r0, r1, r2 and r3 revisions Fixed in r4p0

Description
Under very rare circumstances, full cache line writes from (at least) 2 processors on cache lines in hazard with
other requests may cause arbitration issues in the SCU, leading to processor deadlock.

Configurations affected
This erratum affects the configurations of the processor with three or more active coherent agents, which is
either:
- Two or more processors if the ACP is present
- Three or more processors

Conditions
To trigger the erratum, at least three agents need to be working in SMP mode, and accessing coherent memory
regions.
Two or more processors need to perform full cache line writes, to cache lines which are in hazard with other
access requests in the SCU. The hazard in the SCU happens when another processor, or the ACP, is
performing a read or a write of the same cache line.
The following example describes one scenario that might cause this deadlock:
- CPU0 performs a full cache line write to address A, then a full cache line write to address B
- CPU1 performs a full cache line write to address B, then a full cache line write to address A
- CPU2 performs read accesses to addresses A and B
Under certain rare timing circumstances, the requests might create a loop of dependencies, causing a
processor deadlock.

Implications
When the erratum happens, it leads to system deadlock.
It is important to note that any scenario leading to this deadlock situation is uncommon. It requires two
processors writing full cache lines to a coherent memory region, without taking any semaphore, with another
processor or the ACP accessing the same lines at the same time, meaning that these latter accesses are not
deterministic. This, combined with the extremely rare microarchitectural timing conditions under which the defect
can happen, explains why the erratum is not expected to cause any significant malfunction in real systems.

Workaround
This erratum can be worked round by setting bit[21] of the undocumented Diagnostic Control Register to 1. This
register is encoded as CP15 c15 0 c0 1.
The bit can be written in Secure state only, with the following Read/Modify/Write code sequence:
	MRC p15,0,rt,c15,c0,1
	ORR rt,rt,#0x200000
	MCR p15,0,rt,c15,c0,1
When this bit is set, the “direct eviction” optimization in the Bus Interface Unit is disabled, which means this
erratum cannot occur.
Setting this bit might prevent the Cortex-A9 from utilizing the full bandwidth when performing intensive full cache
line writes, and therefore a slight performance drop might be visible.
In addition, this erratum cannot occur if at least one of the following bits in the Diagnostic Control Register is set
to 1:
- bit [23] – Disable Read-Allocate mode
- bit [22] – Disable Write Allocate Wait mode
2013-04-22 16:15:23 +08:00
..
abort-ev4.S
abort-ev4t.S
abort-ev5t.S
abort-ev5tj.S
abort-ev6.S ARM: v6k: select clear exclusive code seqences according to V6 variants 2011-02-02 21:23:28 +00:00
abort-ev7.S
abort-lv4t.S
abort-macro.S
abort-nommu.S
alignment.c
cache-fa.S
cache-feroceon-l2.c ARM: fix cache-feroceon-l2 after stack based kmap_atomic() 2010-12-19 12:57:16 -05:00
cache-l2x0.c revert android-tegra-2.6.36-honeycomb-mr1-9001adc to v2.6.36 2011-10-28 16:02:47 +08:00
cache-tauros2.c
cache-v3.S
cache-v4.S
cache-v4wb.S Fix common misspellings 2011-03-31 11:26:23 -03:00
cache-v4wt.S Fix common misspellings 2011-03-31 11:26:23 -03:00
cache-v6.S revert android-tegra-2.6.36-honeycomb-mr1-9001adc to v2.6.36 2011-10-28 16:02:47 +08:00
cache-v7.S ARM: 7541/1: Add ARM ERRATA 775420 workaround 2012-10-21 09:17:10 -07:00
cache-xsc3l2.c ARM: fix cache-xsc3l2 after stack based kmap_atomic() 2010-12-19 12:57:08 -05:00
context.c ARM: mm: fix racy ASID rollover broadcast on SMP platforms 2012-02-22 14:09:45 +08:00
copypage-fa.c
copypage-feroceon.c Revert "Merge remote branch 'linux-2.6.32.y/master' into develop" 2011-07-30 16:24:52 +08:00
copypage-v3.c
copypage-v4mc.c
copypage-v4wb.c Revert "Merge remote branch 'linux-2.6.32.y/master' into develop" 2011-07-30 16:24:52 +08:00
copypage-v4wt.c Revert "Merge remote branch 'linux-2.6.32.y/master' into develop" 2011-07-30 16:24:52 +08:00
copypage-v6.c
copypage-xsc3.c Revert "Merge remote branch 'linux-2.6.32.y/master' into develop" 2011-07-30 16:24:52 +08:00
copypage-xscale.c
dma-mapping.c ARM: DMA: Fix struct page iterator in dma_cache_maint() to work with sparsemem 2013-02-03 18:21:37 -06:00
extable.c
fault-armv.c revert android-tegra-2.6.36-honeycomb-mr1-9001adc to v2.6.36 2011-10-28 16:02:47 +08:00
fault.c ARM: prevent VM_GROWSDOWN mmaps extending below FIRST_USER_ADDRESS 2012-05-29 10:18:10 +08:00
fault.h
flush.c ARM: 7487/1: mm: avoid setting nG bit for user mappings that aren't present 2012-09-14 10:00:36 -07:00
highmem.c ARM: get rid of kmap_high_l1_vipt() 2010-12-19 12:56:46 -05:00
idmap.c ARM: pgtable: add pud-level code 2011-02-21 19:24:14 +00:00
init.c revert android-tegra-2.6.36-honeycomb-mr1-9001adc to v2.6.36 2011-10-28 16:02:47 +08:00
iomap.c
ioremap.c Revert "ARM: relax ioremap prohibition (309caa9) for -final and -stable" 2010-12-24 09:49:52 +00:00
Kconfig ARM: l2x0/pl310: Refactor Kconfig to be more maintainable 2012-02-01 20:13:06 +08:00
Makefile ARM: v6k: introduce CPU_V6K option 2011-02-02 21:23:26 +00:00
mm.h ARM: kill pmd_off() 2011-05-26 19:50:30 +01:00
mmap.c Revert "Merge commit 'v2.6.32.9' into android-2.6.32" 2011-07-30 22:24:29 +08:00
mmu.c Merge remote-tracking branch 'stable/linux-3.0.y' into develop-3.0 2013-01-15 12:45:19 +08:00
nommu.c ARM: move memory layout sanity checking before meminfo initialization 2011-07-05 20:27:16 +01:00
pabort-legacy.S
pabort-v6.S
pabort-v7.S
pgd.c Merge branches 'fixes', 'pgt-next' and 'versatile' into devel 2011-03-20 09:32:12 +00:00
proc-arm6_7.S ARM: pm: add generic CPU suspend/resume support 2011-02-22 17:11:23 +00:00
proc-arm7tdmi.S ARM: 6948/1: Fix .size directives for __arm{7,9}tdmi_proc_info 2011-06-06 10:56:10 +01:00
proc-arm9tdmi.S ARM: 6948/1: Fix .size directives for __arm{7,9}tdmi_proc_info 2011-06-06 10:56:10 +01:00
proc-arm720.S Fix common misspellings 2011-03-31 11:26:23 -03:00
proc-arm740.S ARM: pm: add generic CPU suspend/resume support 2011-02-22 17:11:23 +00:00
proc-arm920.S Merge branch 'fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6 into fixes 2011-04-13 23:32:13 +01:00
proc-arm922.S Fix common misspellings 2011-03-31 11:26:23 -03:00
proc-arm925.S Fix common misspellings 2011-03-31 11:26:23 -03:00
proc-arm926.S ARM: Make consolidated PM sleep code depend on PM_SLEEP 2011-04-02 10:08:55 +01:00
proc-arm940.S ARM: pm: add generic CPU suspend/resume support 2011-02-22 17:11:23 +00:00
proc-arm946.S ARM: pm: add generic CPU suspend/resume support 2011-02-22 17:11:23 +00:00
proc-arm1020.S Fix common misspellings 2011-03-31 11:26:23 -03:00
proc-arm1020e.S Fix common misspellings 2011-03-31 11:26:23 -03:00
proc-arm1022.S Fix common misspellings 2011-03-31 11:26:23 -03:00
proc-arm1026.S Fix common misspellings 2011-03-31 11:26:23 -03:00
proc-fa526.S ARM: pm: add generic CPU suspend/resume support 2011-02-22 17:11:23 +00:00
proc-feroceon.S ARM: pm: add generic CPU suspend/resume support 2011-02-22 17:11:23 +00:00
proc-macros.S revert android-tegra-2.6.36-honeycomb-mr1-9001adc to v2.6.36 2011-10-28 16:02:47 +08:00
proc-mohawk.S ARM: pm: add generic CPU suspend/resume support 2011-02-22 17:11:23 +00:00
proc-sa110.S ARM: pm: add generic CPU suspend/resume support 2011-02-22 17:11:23 +00:00
proc-sa1100.S ARM: Make consolidated PM sleep code depend on PM_SLEEP 2011-04-02 10:08:55 +01:00
proc-syms.c
proc-v6.S ARM: 6942/1: mm: make TTBR1 always point to swapper_pg_dir on ARMv6/7 2011-05-26 12:14:32 +01:00
proc-v7.S rk3188: ARM errata: no direct eviction 2013-04-22 16:15:23 +08:00
proc-xsc3.S revert android-tegra-2.6.36-honeycomb-mr1-9001adc to v2.6.36 2011-10-28 16:02:47 +08:00
proc-xscale.S revert android-tegra-2.6.36-honeycomb-mr1-9001adc to v2.6.36 2011-10-28 16:02:47 +08:00
tlb-fa.S
tlb-v3.S
tlb-v4.S
tlb-v4wb.S
tlb-v4wbi.S
tlb-v6.S
tlb-v7.S ARM: 7489/1: errata: fix workaround for erratum #720789 on UP systems 2012-09-14 10:00:36 -07:00
vmregion.c ARM: DMA: top-down allocation in DMA coherent region 2011-02-23 17:24:11 +00:00
vmregion.h