Re: [PATCH] drm/tegra: Remove of_dma_configure() from host1x_device_add()

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

 




On 01/02/2024 20:02, Jason Gunthorpe wrote:
On Thu, Feb 01, 2024 at 07:35:24PM +0000, Jon Hunter wrote:
You mean this sequence?

		err = device_add(&ctx->dev);
		if (err) {
			dev_err(host1x->dev, "could not add context device %d: %d\n", i, err);
			put_device(&ctx->dev);
			goto unreg_devices;
		}

		err = of_dma_configure_id(&ctx->dev, node, true, &i);
		if (err) {
			dev_err(host1x->dev, "IOMMU configuration failed for context device %d: %d\n",
				i, err);
			device_unregister(&ctx->dev);
			goto unreg_devices;
		}

Yes this sequence.

I didn't seem an obvious place that this would get fixed up later?

device_add() was done before so the iommu_device_link() shouldn't be
failing? Are you hitting a duplicate link (ie remove the nowarn from
iommu_device_link())


Removing the '_nowarn' does appear to fix it, although it is not clear to me
why?

What did you do to remove? Just the letters or the whole line?


Yes sorry, to be clear I made the following change ...

diff --git a/drivers/iommu/iommu-sysfs.c b/drivers/iommu/iommu-sysfs.c
index cbe378c34ba3..7bc9c6d2baab 100644
--- a/drivers/iommu/iommu-sysfs.c
+++ b/drivers/iommu/iommu-sysfs.c
@@ -112,7 +112,7 @@ int iommu_device_link(struct iommu_device *iommu, struct device *link)
        if (ret)
                return ret;
- ret = sysfs_create_link_nowarn(&link->kobj, &iommu->dev->kobj, "iommu");
+       ret = sysfs_create_link(&link->kobj, &iommu->dev->kobj, "iommu");
        if (ret)
I was thinking the letters because it triggers a large debug message.

But, what is the actual log output you see, is it -EEXIST?

I see ...

 ERR KERN host1x drm: iommu configuration for device failed with -ENOENT
If it is coming and going is it a race of some kind?

It is consistent without the above. However, I did not think that the
above change would change the returning on -ENOENT? I will add more
debug.

Jon

--
nvpublic



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux