0100-arm-errata-workaround-errata-A12-857271-and-A17-857272.patch 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. [1/2] ARM: errata: Workaround errata A12 857271 / A17 857272
  2. This adds support for working around errata A12 857271 / A17 857272.
  3. These errata were causing hangs on rk3288-based Chromebooks and it was
  4. confirmed that this workaround fixed the problems. In the Chrome OS
  5. 3.14 kernel [1] this erratum was known as ERRATA_FOOBAR due to lack of
  6. an official number from ARM (though the workaround of setting chicken
  7. bit 10 came from ARM). In the meantime ARM came up with official
  8. errata numbers but never published the workaround upstream.
  9. Let's actually get the workaround landed.
  10. [1] https://crrev.com/c/342753
  11. Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
  12. Signed-off-by: Douglas Anderson <dianders@chromium.org>
  13. ---
  14. arch/arm/Kconfig | 19 +++++++++++++++++++
  15. arch/arm/mm/proc-v7.S | 10 ++++++++++
  16. 2 files changed, 29 insertions(+)
  17. diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
  18. index b509cd338219..4376fe74f95e 100644
  19. --- a/arch/arm/Kconfig
  20. +++ b/arch/arm/Kconfig
  21. @@ -1172,6 +1172,15 @@ config ARM_ERRATA_825619
  22. DMB NSHST or DMB ISHST instruction followed by a mix of Cacheable
  23. and Device/Strongly-Ordered loads and stores might cause deadlock
  24. +config ARM_ERRATA_857271
  25. + bool "ARM errata: A12: CPU might deadlock under some very rare internal conditions"
  26. + depends on CPU_V7
  27. + help
  28. + This option enables the workaround for the 857271 Cortex-A12
  29. + (all revs) erratum. Under very rare timing conditions, the CPU might
  30. + hang. The workaround is expected to have a negligible performance
  31. + impact.
  32. +
  33. config ARM_ERRATA_852421
  34. bool "ARM errata: A17: DMB ST might fail to create order between stores"
  35. depends on CPU_V7
  36. @@ -1193,6 +1202,16 @@ config ARM_ERRATA_852423
  37. config option from the A12 erratum due to the way errata are checked
  38. for and handled.
  39. +config ARM_ERRATA_857272
  40. + bool "ARM errata: A17: CPU might deadlock under some very rare internal conditions"
  41. + depends on CPU_V7
  42. + help
  43. + This option enables the workaround for the 857272 Cortex-A17 erratum.
  44. + This erratum is not known to be fixed in any A17 revision.
  45. + This is identical to Cortex-A12 erratum 857271. It is a separate
  46. + config option from the A12 erratum due to the way errata are checked
  47. + for and handled.
  48. +
  49. endmenu
  50. source "arch/arm/common/Kconfig"
  51. diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
  52. index 339eb17c9808..cd2accbab844 100644
  53. --- a/arch/arm/mm/proc-v7.S
  54. +++ b/arch/arm/mm/proc-v7.S
  55. @@ -391,6 +391,11 @@ __ca12_errata:
  56. mrc p15, 0, r10, c15, c0, 1 @ read diagnostic register
  57. orr r10, r10, #1 << 24 @ set bit #24
  58. mcr p15, 0, r10, c15, c0, 1 @ write diagnostic register
  59. +#endif
  60. +#ifdef CONFIG_ARM_ERRATA_857271
  61. + mrc p15, 0, r10, c15, c0, 1 @ read diagnostic register
  62. + orr r10, r10, #1 << 10 @ set bit #10
  63. + mcr p15, 0, r10, c15, c0, 1 @ write diagnostic register
  64. #endif
  65. b __errata_finish
  66. @@ -406,6 +411,11 @@ __ca17_errata:
  67. mrcle p15, 0, r10, c15, c0, 1 @ read diagnostic register
  68. orrle r10, r10, #1 << 12 @ set bit #12
  69. mcrle p15, 0, r10, c15, c0, 1 @ write diagnostic register
  70. +#endif
  71. +#ifdef CONFIG_ARM_ERRATA_857272
  72. + mrc p15, 0, r10, c15, c0, 1 @ read diagnostic register
  73. + orr r10, r10, #1 << 10 @ set bit #10
  74. + mcr p15, 0, r10, c15, c0, 1 @ write diagnostic register
  75. #endif
  76. b __errata_finish