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]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux