On Mon, 7 Oct 2024 at 11:34, Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx> 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, _mmc_suspend gets extended to recognize another reason of being > called, namely when unbinding happens. The logic of 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 that. > Controllers which can only do power cycles in suspend, will send the > card to sleep. Finally, mmc_remove() calls _mmc_suspend now with the new > reason 'unbind'.