070-ARM-l2c-restore-the-behaviour-documented-above-l2c_e.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From d965b0fca7dcde3f82c982e0bf1631069fdeb8c9 Mon Sep 17 00:00:00 2001
  2. From: Russell King <rmk+kernel@arm.linux.org.uk>
  3. Date: Fri, 15 May 2015 11:56:45 +0100
  4. Subject: [PATCH 70/74] ARM: l2c: restore the behaviour documented above
  5. l2c_enable()
  6. l2c_enable() is documented that it must not be called if the cache has
  7. already been enabled. Unfortunately, commit 6b49241ac252 ("ARM: 8259/1:
  8. l2c: Refactor the driver to use commit-like interface") changed this
  9. without updating the comment, for very little reason. Revert this
  10. change and restore the expected behaviour.
  11. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  12. ---
  13. arch/arm/mm/cache-l2x0.c | 10 +++++-----
  14. 1 file changed, 5 insertions(+), 5 deletions(-)
  15. --- a/arch/arm/mm/cache-l2x0.c
  16. +++ b/arch/arm/mm/cache-l2x0.c
  17. @@ -129,10 +129,6 @@ static void l2c_enable(void __iomem *bas
  18. {
  19. unsigned long flags;
  20. - /* Do not touch the controller if already enabled. */
  21. - if (readl_relaxed(base + L2X0_CTRL) & L2X0_CTRL_EN)
  22. - return;
  23. -
  24. l2x0_saved_regs.aux_ctrl = aux;
  25. l2c_configure(base);
  26. @@ -163,7 +159,11 @@ static void l2c_save(void __iomem *base)
  27. static void l2c_resume(void)
  28. {
  29. - l2c_enable(l2x0_base, l2x0_saved_regs.aux_ctrl, l2x0_data->num_lock);
  30. + void __iomem *base = l2x0_base;
  31. +
  32. + /* Do not touch the controller if already enabled. */
  33. + if (!(readl_relaxed(base + L2X0_CTRL) & L2X0_CTRL_EN))
  34. + l2c_enable(base, l2x0_saved_regs.aux_ctrl, l2x0_data->num_lock);
  35. }
  36. /*