Skip to content

Commit 565fadc

Browse files
tmlindgregkh
authored andcommitted
bus: ti-sysc: Flush posted write only after srst_udelay
commit f71f6ff upstream. Commit 34539b4 ("bus: ti-sysc: Flush posted write on enable before reset") caused a regression reproducable on omap4 duovero where the ISS target module can produce interconnect errors on boot. Turns out the registers are not accessible until after a delay for devices needing a ti,sysc-delay-us value. Let's fix this by flushing the posted write only after the reset delay. We do flushing also for ti,sysc-delay-us using devices as that should trigger an interconnect error if the delay is not properly configured. Let's also add some comments while at it. Fixes: 34539b4 ("bus: ti-sysc: Flush posted write on enable before reset") Cc: [email protected] Signed-off-by: Tony Lindgren <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e50cfb5 commit 565fadc

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

drivers/bus/ti-sysc.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,13 +2093,23 @@ static int sysc_reset(struct sysc *ddata)
20932093
sysc_val = sysc_read_sysconfig(ddata);
20942094
sysc_val |= sysc_mask;
20952095
sysc_write(ddata, sysc_offset, sysc_val);
2096-
/* Flush posted write */
2096+
2097+
/*
2098+
* Some devices need a delay before reading registers
2099+
* after reset. Presumably a srst_udelay is not needed
2100+
* for devices that use a rstctrl register reset.
2101+
*/
2102+
if (ddata->cfg.srst_udelay)
2103+
fsleep(ddata->cfg.srst_udelay);
2104+
2105+
/*
2106+
* Flush posted write. For devices needing srst_udelay
2107+
* this should trigger an interconnect error if the
2108+
* srst_udelay value is needed but not configured.
2109+
*/
20972110
sysc_val = sysc_read_sysconfig(ddata);
20982111
}
20992112

2100-
if (ddata->cfg.srst_udelay)
2101-
fsleep(ddata->cfg.srst_udelay);
2102-
21032113
if (ddata->post_reset_quirk)
21042114
ddata->post_reset_quirk(ddata);
21052115

0 commit comments

Comments
 (0)