On Mon, Nov 04, 2024 at 11:18:42AM +0200, Wolfram Sang wrote: > When unbinding a MMC host, the card should be suspended. Otherwise, > problems may arise. E.g. the card still expects power-off notifications > but there is no host to send them anymore. Shimoda-san tried disabling > notifications only, but there were issues with his approaches [1] [2]. > > Here is my take on it, based on the review comments: > > a) 'In principle we would like to run the similar operations at "remove" > as during "system suspend"' [1] > b) 'We want to support a graceful power off sequence or the card...' [2] > > So, first, mmc_remove_card() gets improved to mark the card as "not > present" and to call the bus specific suspend() handler. > > Then, _mmc_suspend gets extended to recognize another reason of being > called, namely when a card removal happens. Building upon the now > updated mmc_remove_card(), this is the case when the card is flagged as > "not present". > > The logic of either sending a notification or sending the card to sleep > gets updated to handle this new reason. Controllers able to do full > power cycles will still do a full power cycle. Controllers which can > only do power cycles in suspend, will send the card to sleep. > > All this is for MMC. SD/SDIO are unaffected because they are not using > the 'card present' flag. > > Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx> > > [1] https://patchwork.kernel.org/project/linux-renesas-soc/patch/1602581312-23607-1-git-send-email-yoshihiro.shimoda.uh@xxxxxxxxxxx/ > [2] https://patchwork.kernel.org/project/linux-mmc/patch/1605005330-7178-1-git-send-email-yoshihiro.shimoda.uh@xxxxxxxxxxx/ > --- > > Lightly tested with a Renesas R-Car S4 Spider board. It bascially works > as expected. Serious testing postponed until the generic direction of > this is approved :) Anything I can do to make the review easier? Some more testing maybe?
Attachment:
signature.asc
Description: PGP signature