Page MenuHomeFreeBSD

LinuxKPI: pci: cleanup lkpinew_pci_dev_release()
Needs ReviewPublic

Authored by bz on Thu, Jun 4, 9:40 AM.
Tags
None
Referenced Files
F159340602: D57431.id179188.diff
Sat, Jun 13, 1:19 AM
F159339377: D57431.id179188.diff
Sat, Jun 13, 12:58 AM
Unknown Object (File)
Thu, Jun 11, 4:23 AM
Unknown Object (File)
Tue, Jun 9, 7:37 PM
Unknown Object (File)
Tue, Jun 9, 7:01 AM
Unknown Object (File)
Sun, Jun 7, 9:42 PM
Unknown Object (File)
Thu, Jun 4, 3:21 PM
Subscribers

Details

Reviewers
None
Group Reviewers
linuxkpi
Summary

Factor out some cleanup routines from the device detach path so
we can re-use them here too.
Also clarifying that lkpinew_pci_dev_release() should only run
from the (*release) callback function means that we adjust our
other calls to what we had already envisioned in comments, to
go through the official pci_dev_put() path.

Compared to the device detach path, we have little chance to know
if we held the last reference and if the device is really gone or
not but in this case a later release would be fine (if it happens).
In contrast to the device detach path we cannot do the hack of
setting the .release callback to NULL and check upon return from
pci_dev_put() as in this case the pdev is freed.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 73658
Build 70541: arc lint + arc unit