]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
bus: ti-sysc: Flush posted write on enable and disable
authorTony Lindgren <tony@atomide.com>
Wed, 27 May 2020 13:49:29 +0000 (06:49 -0700)
committerTony Lindgren <tony@atomide.com>
Sun, 31 May 2020 03:41:01 +0000 (20:41 -0700)
Looks like we're missing flush of posted write after module enable and
disable. I've seen occasional errors accessing various modules, and it
is suspected that the lack of posted writes can also cause random reboots.

The errors we can see are similar to the one below from spi for example:

44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4CFG (Read): Data Access
in User mode during Functional access
...
mcspi_wait_for_reg_bit
omap2_mcspi_transfer_one
spi_transfer_one_message
...

We also want to also flush posted write for disable. The clkctrl clock
disable happens after module disable, and we don't want to have the
module potentially stay active while we're trying to disable the clock.

Fixes: d59b60564cbf ("bus: ti-sysc: Add generic enable/disable functions")
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/bus/ti-sysc.c

index e5f5f48d69d2fa771660256448301478a6be7cf8..369c97c3e0c0b31ec71de635f84120a3c37b0092 100644 (file)
@@ -991,6 +991,9 @@ set_autoidle:
                sysc_write_sysconfig(ddata, reg);
        }
 
+       /* Flush posted write */
+       sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]);
+
        if (ddata->module_enable_quirk)
                ddata->module_enable_quirk(ddata);
 
@@ -1071,6 +1074,9 @@ set_sidle:
                reg |= 1 << regbits->autoidle_shift;
        sysc_write_sysconfig(ddata, reg);
 
+       /* Flush posted write */
+       sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]);
+
        return 0;
 }