Hi Ulf, > From: Yoshihiro Shimoda, Sent: Monday, November 2, 2020 7:05 PM > > User is possible to turn the power off after a host was removed. > So, call _mmc_suspend() to issue the power off notification when > a host is removing. Note that, to prevent _mmc_resume() calling > in mmc_runtime_resume(), call mmc_card_clr_suspended() in > mmc_remove() before mmc_remove_card(). Otherwise, _mmc_resume() > call mmc_init_card() while removing the host. > > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx> > --- > Changes from v1: > - Reuse _mmc_suspend() instead of direct mmc_poweroff_notify() calling > to check suspended flag while removing. I'm afraid again, but I would like to drop this patch too because my colleague found an issue which the following timeout happened when we read a boot partition, and then unbind the controller. [ 463.073168] renesas_sdhi_internal_dmac ee140000.mmc: timeout waiting for hardware interrupt (CMD6) The issue happened on the following mmc_blk_part_switch() calling. And the function was called after _mmc_suspend() in mmc_remove() called mmc_power_off(). So, perhaps, we should avoid mmc_power_off() calling in mmc_remove(). As another solution, we can stop to call mmc_blk_part_switch() in mmc_blk_remove(). However, in such case we need to modify mmc-test driver for switching the partition [1]. --- static void mmc_blk_remove(struct mmc_card *card) { struct mmc_blk_data *md = dev_get_drvdata(&card->dev); mmc_blk_remove_debugfs(card, md); mmc_blk_remove_parts(card, md); pm_runtime_get_sync(&card->dev); if (md->part_curr != md->part_type) { mmc_claim_host(card->host); mmc_blk_part_switch(card, md->part_type); // here mmc_release_host(card->host); } <snip> --- [1] According to the following commit, we need to switch the partition before we use mmc-test driver. --- commit ddd6fa7e794e62af3ec3eb4ffdc78489885701f2 Author: Adrian Hunter <adrian.hunter@xxxxxxxxx> Date: Thu Jun 23 13:40:26 2011 +0300 mmc: block: switch card to User Data Area when removing the block driver The MMC block driver and other drivers (e.g. mmc-test) will expect the card to be switched to the User Data Area eMMC partition when they start. Hence the MMC block driver should ensure it is that way when it is removed. Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx> Cc: Andrei Warkentin <andreiw@xxxxxxxxxxxx> Signed-off-by: Chris Ball <cjb@xxxxxxxxxx> --- Best regards, Yoshihiro Shimoda