Skip to content

Commit

Permalink
bus: ti-sysc: Flush posted write on enable and disable
Browse files Browse the repository at this point in the history
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: d59b605 ("bus: ti-sysc: Add generic enable/disable functions")
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Tony Lindgren committed May 31, 2020
1 parent 98ece19 commit 5ce8aee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/bus/ti-sysc.c
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,9 @@ static int sysc_enable_module(struct device *dev)
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);

Expand Down Expand Up @@ -1071,6 +1074,9 @@ static int sysc_disable_module(struct device *dev)
reg |= 1 << regbits->autoidle_shift;
sysc_write_sysconfig(ddata, reg);

/* Flush posted write */
sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]);

return 0;
}

Expand Down

0 comments on commit 5ce8aee

Please sign in to comment.