Hi Wolfram, > Subject: RE: [PATCH] mmc: renesas_sdhi: Fix internal cd irq miss with hard > reset > > Hi Wolfram, > > Thanks for the feedback. > > > Subject: Re: [PATCH] mmc: renesas_sdhi: Fix internal cd irq miss with > > hard reset > > > > Hi Biju, > > > > > Finally found the issue. There is one more patch for host->reset in > > tmio_mmc_core.c. please see below. > > > If you add this code, then it works. > > > > Thanks for finding the culprit! To get this hopefully into v5.15 > > still, I will simply add this chunk like you suggested. However, I > > really wonder if we shouldn't just replace this: > > > > > /* For R-Car Gen2+, we need to reset SDHI specific > > > SCC > > */ > > > if (host->pdata->flags & TMIO_MMC_MIN_RCAR2) > > > host->reset(host); > > > > > > if (host->native_hotplug) > > > tmio_mmc_enable_mmc_irqs(host, > > > TMIO_STAT_CARD_REMOVE | > > > TMIO_STAT_CARD_INSERT); > > > > > > > with a simple call to > > > > tmio_mmc_reset(host) > > > > (with tmio_mmc_reset() still updated to set the card interrupts, of > > course)? I have to admit I haven't checked all paths for side-effects > > yet, but maybe you can already test if this change also works (instead > > of adding the second chunk)? If so, we could change it incrementally > > for 5.16. > > Agreed. Will test and provide you feedback. I have tested and it works ok on RZ/G2L platform. Looking at the code, further optimization is possible. Can you please check below and If it is ok, please add to the new patch for 5.16. diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index e2affa52ef46..e8add010bd7d 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -960,14 +960,8 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) case MMC_POWER_OFF: tmio_mmc_power_off(host); /* For R-Car Gen2+, we need to reset SDHI specific SCC */ - if (host->pdata->flags & TMIO_MMC_MIN_RCAR2) { - host->reset(host); - - if (host->native_hotplug) - tmio_mmc_enable_mmc_irqs(host, - TMIO_STAT_CARD_REMOVE | - TMIO_STAT_CARD_INSERT); - } + if (host->pdata->flags & TMIO_MMC_MIN_RCAR2) + tmio_mmc_reset(host); host->set_clock(host, 0); break; @@ -1295,10 +1289,6 @@ int tmio_mmc_host_runtime_resume(struct device *dev) if (host->clk_cache) host->set_clock(host, host->clk_cache); - if (host->native_hotplug) - tmio_mmc_enable_mmc_irqs(host, - TMIO_STAT_CARD_REMOVE | TMIO_STAT_CARD_INSERT); - tmio_mmc_enable_dma(host, true); return 0; Regards, Biju