On 24 May 2013 08:06, zhangfei gao <zhangfei.gao@xxxxxxxxx> wrote: > > > > On Tue, Apr 16, 2013 at 6:00 PM, Ulf Hansson <ulf.hansson@xxxxxxxxxxxxxx> > wrote: >> >> From: Ulf Hansson <ulf.hansson@xxxxxxxxxx> >> >> Once the mmc blkdevice is being probed, runtime pm will be enabled. >> By using runtime autosuspend, the power save operations can be done >> when request inactivity occurs for a certain time. Right now the >> selected timeout value is set to 3 s. Obviously this value will likely >> need to be configurable somehow since it needs to be trimmed depending >> on the power save algorithm. >> >> For SD-combo cards, we are still leaving the enablement of runtime PM >> to the SDIO init sequence since it depends on the capabilities of the >> SDIO func driver. >> >> Moreover, when the blk device is being suspended, we make sure the device >> will be runtime resumed. The reason for doing this is that we want the >> host suspend sequence to be unaware of any runtime power save operations >> done for the card in this phase. Thus it can just handle the suspend as >> the card is fully powered from a runtime perspective. >> > > If sd card is removed during system suspend, NULL pointer error would happen > since card is removed. Why, where? Have you tested this patch, then maybe you can share a log? Myself has of course tested above scenario without observing any issues, though my environment could be different from yours. > mmc_detect_change would be called even CONFIG_MMC_UNSAFE_RESUME, so no issue > without these patch. You need to elaborate why you see a concern here, I can not follow. > > Besides, any chance to not call suspend if runtime suspended, such as flag? > Otherwise, suspend -> runtime_resume -> resume -> suspend. > Looks much repetition. The above sequence can only be present while using MMC_CAP_AGGRESSIVE_PM so your comment is not valid for this patch as such. For the MMC_CAP_AGGRESSIVE_PM patch; in this phase I decided to keep this simple. You may want to optimize for the above sequence in future patches. > > Thanks Thanks for reviewing! Kind regards Ulf Hansson -- 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