Re: [PATCH v9 2/5] iommu: Implement of_iommu_get_resv_regions()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2022-10-07 16:28, Thierry Reding wrote:
[...]
@@ -172,3 +173,106 @@ const struct iommu_ops *of_iommu_configure(struct device *dev,
   	return ops;
   }
+
+static inline bool check_direct_mapping(struct device *dev, struct resource *phys,

Where "phys" is the virtual address, right? :(

No, phys is actually res passed in from of_iommu_get_resv_regions()
where it is the address read from the "reg" property. So that's the
physical address of the reserved region. Perhaps it'd be useful to
rename "res" to "phys" in that function to be a little more consistent.
It's actually the "start" and "end" values that are passed into this
function that refer to the I/O virtual addresses from iommu-addresses.

Oh, so it's the phys_addr_t's that aren't physical addresses - well, it had to be wrong one way or the other :)

I agree that s/res/phys/ in the main function, and maybe s/start/iova/ too, would be helpful.

Thanks,
Robin.



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux