Page MenuHomeFreeBSD

linuxkpi: Acquire giant when adding/removing i2c adapters
ClosedPublic

Authored by manu on Jun 14 2022, 11:25 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jul 4, 1:39 PM
Unknown Object (File)
Wed, Jul 2, 4:12 AM
Unknown Object (File)
Wed, Jul 2, 12:39 AM
Unknown Object (File)
Tue, Jul 1, 11:13 PM
Unknown Object (File)
Tue, Jul 1, 6:10 AM
Unknown Object (File)
Mon, Jun 30, 3:05 AM
Unknown Object (File)
Sun, Jun 29, 5:39 AM
Unknown Object (File)
Sat, Jun 28, 3:59 PM

Details

Summary

We need Giant as we run in a taskqueue_thread via linux_work.
This fix detaching amdgpu and i915kms.

Sponsored by: Beckhoff Automation GmbH & Co. KG

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 45965
Build 42853: arc lint + arc unit

Event Timeline

manu requested review of this revision.Jun 14 2022, 11:25 AM

I don't know why I don't need this but looking at the device_delete_child and bus_generic_attach code we need giant.
There is a report of this function failing https://github.com/freebsd/drm-kmod/issues/154 .

If I'm not mistaken you should just bus_topo_lock() and bus_topo_unlock() instead of referring Giant directly!

If I'm not mistaken you should just bus_topo_lock() and bus_topo_unlock() instead of referring Giant directly!

Indeed, fixed now.

This revision is now accepted and ready to land.Jun 14 2022, 11:58 AM

Nothing new in the tree should refer to Giant... I'll have to see if we can poison that to keep it from proliferating.
The bus_topo_* functions were a part of that work, and appear to be used here correctly.