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)
Tue, May 20, 1:58 AM
Unknown Object (File)
Sun, May 18, 12:57 PM
Unknown Object (File)
Sat, May 17, 10:59 PM
Unknown Object (File)
Sun, May 4, 7:11 PM
Unknown Object (File)
Thu, Apr 24, 9:29 AM
Unknown Object (File)
Apr 18 2025, 7:00 AM
Unknown Object (File)
Apr 14 2025, 11:57 AM
Unknown Object (File)
Apr 13 2025, 1:07 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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.