Page MenuHomeFreeBSD

linuxkpi: enhance various PCI bits
ClosedPublic

Authored by bz on Jan 15 2021, 11:44 PM.
Tags
None
Referenced Files
F81422202: D28188.id82348.diff
Tue, Apr 16, 3:03 AM
F81422185: D28188.diff
Tue, Apr 16, 3:02 AM
Unknown Object (File)
Thu, Apr 11, 7:12 PM
Unknown Object (File)
Sun, Mar 24, 4:54 AM
Unknown Object (File)
Feb 4 2024, 5:11 AM
Unknown Object (File)
Dec 22 2023, 11:08 PM
Unknown Object (File)
Dec 14 2023, 10:06 PM
Unknown Object (File)
Nov 22 2023, 12:00 AM
Subscribers

Details

Summary

linuxkpi: enhance various PCI bits

  • In linux_pci_attach_device() get rid of dinfo apart from the two lines actually needing it. Given we set ivars, we can then use proper pci_get_*() accessor functions instead in either case.

    Move some more of these accessor initialisations to lkpifill_pci_dev(), which also avoids duplicat work for "device" and "vendor".
  • Move pdev->bus allocation common to lkpinew_pci_dev() and linux_pci_attach_device() into lkpifill_pci_dev().
  • Move the pdev->dev.* and kobj initializations from linux_pci_attach_device() into lkpifill_pci_dev() allowing the lkpinew_pci_dev() case to also use them.
  • Add a pdev->dev.release function for the lkpinew_pci_dev() case simply freeing the pdev->bus and the pdev called through the normal logic when the kref of the kobj of the dev of the pdev goes to 0.
  • With pdev->dev.kobj always initialized and the release function, Implement pci_dev_put() in the expected way (previously discussed as part of D27550).

All but the pci_domain_nr() changes are so that DRM will use the
normal dev/kobj refcount logic and common functions without any
special hack for device management. We keep doing this without
actually adding the allocated pci devices (incl. the kobjb satte)
from lkpinew_pci_dev() to the pci_devices list.

Sponsored-by: The FreeBSD Foundation
Obtained-from: bz_iwlwifi (partially)

Test Plan

Loading i915kms and unloading i915kms did work.

Diff Detail

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

Event Timeline

bz requested review of this revision.Jan 15 2021, 11:44 PM
bz retitled this revision from linuxkpi: ehance various PCI bits to linuxkpi: enhance various PCI bits.Jan 16 2021, 12:03 AM
bz edited the summary of this revision. (Show Details)

Anyone any last comments; I'd love to commit this before Monday.

This revision was not accepted when it landed; it landed in state Needs Review.Jan 28 2021, 4:47 PM
This revision was automatically updated to reflect the committed changes.