Hi Wolfram-san again, > From: Yoshihiro Shimoda, Sent: Monday, May 13, 2019 6:46 PM > > Hi Wolfram-san, > > > From: Wolfram Sang, Sent: Monday, May 13, 2019 6:01 PM > > > > Hi Shimoda-san, > > > > thank you for this update! > > > > > +static void renesas_sdhi_init_card(struct mmc_host *mmc, struct mmc_card *card) > > > +{ > > > + struct tmio_mmc_host *host = mmc_priv(mmc); > > > + > > > + if (host->pdev->dev.iommu_group && > > > > I wonder if I am too cautious, but maybe we should have another > > condition here to be checked first, namely "host->mmc->max_segs < 512"? > > I got it. I'll fix it on v3 patch. I'm afraid but I misunderstood this condition is "host->pdata->max_segs", not "host->mmc->max_segs", to avoid small max_segs value than pdata->max_segs? (No one has such max_segs value at the moment though.) If we use "host->mmc->max_segs", the max_segments value will be toggled by connecting/disconnecting a card like below: (a card is connected) # cat /sys/block/mmcblk0/queue/max_segments 512 (a card is disconnected and connected again) # cat /sys/block/mmcblk0/queue/max_segments 1 (a card is disconnected and connected again) # cat /sys/block/mmcblk0/queue/max_segments 512 ... Best regards, Yoshihiro Shimoda > > > + (mmc_card_mmc(card) || mmc_card_sd(card))) > > > + host->mmc->max_segs = 512; > > > + else > > > + host->mmc->max_segs = host->pdata->max_segs; > > > > max_segs can be 0, so we should probably have: > > > > + host->mmc->max_segs = host->pdata->max_segs ?: 32; > > Thank you for the point! I'll fix it on v3 patch. > > > That also means, for the sys-dmac and Gen2, we then use 512 for the > > IOMMU case and 32 (default TMIO value) for the non IOMMU case. My > > understanding is that SYS DMAC can handle 512 in both cases. Maybe it > > makes sense then to make an incremental patch setting the max_segs value > > explicitly to 512 in the sys-dmac driver for Gen2? > > I also think SYS DMAC can handle 512 segments. However, I'm not sure > it can improve the performance or not though. Anyway, an incremental patch > makes sense if needed, I think. > > Best regards, > Yoshihiro Shimoda > > > Kind regards, > > > > Wolfram