Hi Robin, > From: Robin Murphy, Sent: Friday, June 14, 2019 6:55 PM > > On 13/06/2019 11:20, Yoshihiro Shimoda wrote: <snip> > > +bool blk_queue_can_use_iommu_merging(struct request_queue *q, > > + struct device *dev) > > +{ > > + struct iommu_domain *domain; > > + > > + /* > > + * If the device DMA is translated by an IOMMU, we can assume > > + * the device can merge the segments. > > + */ > > + if (!device_iommu_mapped(dev)) > > Careful here - I think this validates the comment I made when this > function was introduced, in that that name doesn't necesarily mean what > it sounds like it might mean - "iommu_mapped" was as close as we managed > to get to a convenient shorthand for "performs DMA through an > IOMMU-API-enabled IOMMU". Specifically, it does not imply that > translation is *currently* active; if you boot with "iommu=pt" or > equivalent this will still return true even though the device will be > using direct/SWIOTLB DMA ops without any IOMMU translation. Thank you for your comments. I understood the mean of "iommu_mapped" and this patch's condition causes a problem on iommu=pt. So, I'll add and additional condition like "domain->type == IOMMU_DOMAIN_DMA" to check whether the translation is currently active on the domain or not. Best regards, Yoshihiro Shimoda