Re: [PATCH] iommu/omap: Don't register ops by fwnode

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

 



On 08/10/2024 8:52 pm, H. Nikolaus Schaller wrote:


Am 08.10.2024 um 20:20 schrieb Robin Murphy <robin.murphy@xxxxxxx>:

The -ETIMEDOUT seems to come from of_iommu_configure().

Oof, yeah, now we've wound up with the opposite problem that because it's the generic "iommus" binding, it gets as far as of_iommu_xlate() but now the NULL fwnode no longer matches the phandle target so that thinks it's waiting for an instance which hasn't registered yet :(

OK, different track, does the diff below fare any better? (I've not written it up fully yet as the DRA7 special cases will need some more work still)

Thanks,
Robin.

----->8-----

diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index c9528065a59a..44e09d60e861 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -1723,12 +1723,19 @@ static void omap_iommu_release_device(struct device *dev)

}

+int omap_iommu_of_xlate(struct device *dev, const struct of_phandle_args *args)
+{
+ /* TODO: collect args->np to save re-parsing in probe above */
+ return 0;
+}
+
static const struct iommu_ops omap_iommu_ops = {
.identity_domain = &omap_iommu_identity_domain,
.domain_alloc_paging = omap_iommu_domain_alloc_paging,
.probe_device = omap_iommu_probe_device,
.release_device = omap_iommu_release_device,
.device_group = generic_single_device_group,
+ .of_xlate = omap_iommu_of_xlate,
.pgsize_bitmap = OMAP_IOMMU_PGSIZES,
.default_domain_ops = &(const struct iommu_domain_ops) {
.attach_dev = omap_iommu_attach_dev,


Unfortunately no change :(

Hmm, I dug around and found a Pandaboard in the cupboard, and ostensibly this seems to work as expected there:

6:12-rc3:
chu-chu-rocket:~ # dmesg | grep -i iommu
[    0.628601] iommu: Default domain type: Translated
[    0.633575] iommu: DMA domain TLB invalidation policy: strict mode
[    1.636047] omap-iommu 4a066000.mmu: 4a066000.mmu registered
[    3.265869] omap-iommu 55082000.mmu: 55082000.mmu registered

6.12-rc3 + of_xlate:
chu-chu-rocket:~ # dmesg | grep -i iommu
[    0.629577] iommu: Default domain type: Translated
[    0.634582] iommu: DMA domain TLB invalidation policy: strict mode
[    1.622802] omap-iommu 4a066000.mmu: 4a066000.mmu registered
[    3.316009] omap-iommu 55082000.mmu: 55082000.mmu registered
[    3.329040] omap-rproc ocp:dsp: Adding to iommu group 0
[    3.335083] omap-iommu 4a066000.mmu: 4a066000.mmu: version 2.0
[    3.356506] omap-rproc 55020000.ipu: Adding to iommu group 1
[    3.362396] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1

Guess I'm going to have to dig further for an OMAP3 to figure out what additional shenanigans that ISP driver is up to... :/

Thanks,
Robin.


A very tiny issue was that the second argument can not have a const specifier in the
v6.8 series, but starting with v6.9 it should be there. But since 6.8 and 6.9 are
already EOL, there will be no back-ports anyways. And if someone does really
backport (like me for testing purposes) it is obvious what to do.

BR and thanks,
Nikolaus





[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux