On 01/04/15 13:13, Ulf Hansson wrote: > On 27 March 2015 at 21:57, Adrian Hunter <adrian.hunter@xxxxxxxxx> wrote: >> At the start of each request, re-tune if needed and >> then hold off re-tuning again until the request is done. >> >> Note that though there is one function that starts >> requests (mmc_start_request) there are two that wait for >> the request to be done (mmc_wait_for_req_done and >> mmc_wait_for_data_req_done). Also note that >> mmc_wait_for_data_req_done can return even when the >> request is not done (which allows the block driver >> to prepare a newly arrived request while still >> waiting for the previous request). >> >> This patch ensures re-tuning is held for the duration >> of a request. Subsequent patches will also hold >> re-tuning at other times when it might cause a >> conflict. > > How about holding of re-tune from __mmc_claim_host() (after > pm_runtime_get_sync() ) -> mmc_release_host(). Would that work? If so, > that would simplify a lot around this. I don't think it would work. The host is claimed both when we want to do re-tuning (timer, CRC error, or host requests it) and when we want to prevent it (in between dependent commands like erase, polling when card is busy, SDIO card custom wake-up command). -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html