linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* BUG: "iommu: Retire bus ops" breaks omap-iommu and omap3isp
@ 2024-10-06  7:40 H. Nikolaus Schaller
  2024-10-07 12:15 ` Jason Gunthorpe
  0 siblings, 1 reply; 9+ messages in thread
From: H. Nikolaus Schaller @ 2024-10-06  7:40 UTC (permalink / raw)
  To: Robin Murphy, Laurent Pinchart
  Cc: Rafael J. Wysocki, Christoph Hellwig, Greg Kroah-Hartman,
	Lu Baolu, Jason Gunthorpe, Jerry Snitselaar, Robin Murphy,
	Joerg Roedel, tony Lindgren, Andreas Kemnade, Linux-OMAP,
	Linux Kernel Mailing List, linux-media

Hi,

I found that the camera on our OMAP3 based system (GTA04) stopped working with v6.8-rc1.
There was no bug in the camera driver but the OMAP3 ISP (image signal processor) emits

[   14.963684] omap3isp 480bc000.isp: failed to create ARM IOMMU mapping
[   15.010192] omap3isp 480bc000.isp: unable to attach to IOMMU
[   15.023376] omap3isp 480bc000.isp: isp_xclk_set_rate: cam_xclka set to 24685714 Hz (div 7)
[   15.065399] omap3isp: probe of 480bc000.isp failed with error -12

Deeper analyses lead to this patch breaking operation. It is not fixed up to v6.12-rc1.

What seems to happen (in 6.8-rc1 code):

- omap_iommu_probe() passes &omap_iommu_ops to iommu_device_register()
- iommu_device_register() stores the ops in iommu->ops (only)
- __iommu_probe_device tries to read the ops from some fw_spec but not iommu->ops
- this calls iommu_ops_from_fwnode(NULL) which looks strange to me
- since it doesn't find any fw_spec or node matching a NULL fwspec it returns -ENODEV

So I wonder how the magic between setting the ops in omap_iommu_probe()
and finding them in __iommu_probe_device() is intended to work. Or how
the omap3isp driver should register some fw_node or fw_spec to make this
work.

What is a fix for this?

BR and thanks,
Nikolaus

Bug: 17de3f5fdd3567 ("iommu: Retire bus ops")


Note: Why did this bug not surface earlier? It appears that on OMAP3 the only driver
that uses iommu is omap3isp and connected cameras are not that widespread.
OMAP4 and 5 also use it for the DSP&IVA susbsystems which are also rarely used.
Hence it wasn't tested by anyone.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-10-08 12:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-06  7:40 BUG: "iommu: Retire bus ops" breaks omap-iommu and omap3isp H. Nikolaus Schaller
2024-10-07 12:15 ` Jason Gunthorpe
2024-10-07 12:30   ` H. Nikolaus Schaller
2024-10-07 14:01   ` Andreas Kemnade
2024-10-07 14:48     ` Jason Gunthorpe
2024-10-07 16:31       ` Andreas Kemnade
2024-10-08  8:08   ` H. Nikolaus Schaller
2024-10-08 12:12     ` Jason Gunthorpe
2024-10-08 12:11   ` Robin Murphy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).