On Tue, Dec 11, 2018 at 11:25 PM Tony Lindgren <tony@xxxxxxxxxxx> wrote: > > * Ricardo Salveti <rsalveti@xxxxxxxxxxxx> [181211 21:51]: > > Tried to change back wl12xx_sdio_power_off to use pm_runtime_put_sync > > as a test, and noticed I always get -EBUSY when reproducing the hang, > > so it looks like this could be a race between pm_runtime_put/get when > > doing if down/up (and the side effect on the mmc controller). > > Hmm so -EBUSY for pm_runtime means transition is already happening > and in many cases the test should be: > > error = pm_runtime_get(dev); > if (error < 0 && error != -EBUSY) { > ... > } > ... > pm_runtime_put(dev); > > Where are you getting it? What I noticed is that with autosuspend support I always get -EBUSY in wl12xx_sdio_power_off -> pm_runtime_put, and I would guess that the additional delay here creates the issue later when bringing the interface up again. Without autosuspend I never get -EBUSY in wl12xx_sdio_power_off. Cheers, -- Ricardo Salveti de Araujo