Page MenuHomeFreeBSD

Implement bhnd(4) platform device registration.
ClosedPublic

Authored by landonf on Sep 16 2017, 4:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 6:38 PM
Unknown Object (File)
Wed, Oct 1, 8:39 PM
Unknown Object (File)
Mon, Sep 22, 11:55 PM
Unknown Object (File)
Sun, Sep 21, 10:14 PM
Unknown Object (File)
Sep 14 2025, 1:39 PM
Unknown Object (File)
Sep 2 2025, 3:23 PM
Unknown Object (File)
Aug 17 2025, 4:28 PM
Unknown Object (File)
Aug 14 2025, 11:13 PM
Subscribers
None

Details

Summary

Add bhnd(4) API for explicitly registering BHND platform devices with the bus, rather than walking the newbus hierarchy to discover platform devices (ChipCommon, PMU, NVRAM, etc). These devices are now also refcounted; attempting to deregister an actively used platform device will return EBUSY.

This resolves a lock ordering issue with bwn(4)'s firmware loading threads; previously it was necessary to acquire Giant to protect newbus access when locating and querying the NVRAM device.

Test Plan

Tested for regressions against both Broadcom MIPS SoCs and Wi-Fi chipsets.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Adopt a non-sleepable lock for the bhnd_service_registry; this allows use of
bhnd_service_registry_retain() while holding either an unbounded or bounded
sleep lock.

This revision is now accepted and ready to land.Sep 27 2017, 1:50 AM
This revision was automatically updated to reflect the committed changes.