Skip to content

Commit f71f6ff

Browse files
committed
bus: ti-sysc: Flush posted write only after srst_udelay
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]>
1 parent b85ea95 commit f71f6ff

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
@@ -2158,13 +2158,23 @@ static int sysc_reset(struct sysc *ddata)
21582158
sysc_val = sysc_read_sysconfig(ddata);
21592159
sysc_val |= sysc_mask;
21602160
sysc_write(ddata, sysc_offset, sysc_val);
2161-
/* Flush posted write */
2161+
2162+
/*
2163+
* Some devices need a delay before reading registers
2164+
* after reset. Presumably a srst_udelay is not needed
2165+
* for devices that use a rstctrl register reset.
2166+
*/
2167+
if (ddata->cfg.srst_udelay)
2168+
fsleep(ddata->cfg.srst_udelay);
2169+
2170+
/*
2171+
* Flush posted write. For devices needing srst_udelay
2172+
* this should trigger an interconnect error if the
2173+
* srst_udelay value is needed but not configured.
2174+
*/
21622175
sysc_val = sysc_read_sysconfig(ddata);
21632176
}
21642177

2165-
if (ddata->cfg.srst_udelay)
2166-
fsleep(ddata->cfg.srst_udelay);
2167-
21682178
if (ddata->post_reset_quirk)
21692179
ddata->post_reset_quirk(ddata);
21702180

0 commit comments

Comments
 (0)