Skip to content

PCI: fix pci dev add and remove sequence

Yinghai Lu linux-iommu linux-pci lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 34 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7PCI: move back pci_proc_attach_devices callingdrivers/pci/bus.c drivers/pci/probe.c+1 -20 replies
2/7PCI: move resources and bus_list releasing to pci_release_devdrivers/pci/probe.c drivers/pci/remove.c+20 -193 replies
3/7PCI: Detach driver in pci_stop_devicedrivers/pci/remove.c include/linux/pci.h+10 -50 replies
4/7PCI: Fix racing for pci device removing via sysfsdrivers/pci/probe.c+2 -01 reply
5/7PCI, ACPI: Don't glue ACPI dev with pci VFsdrivers/pci/iov.c drivers/pci/pci-acpi.c+7 -30 replies
6/7PCI: Make sure VF's driver get attached after PF'sdrivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c drivers/net/ethernet/cisco/enic/enic_main.c +11 more+115 -1430 replies
7/7PCI: use pf as dma_dev for vf that does not have func0 siblingdrivers/iommu/intel-iommu.c+8 -40 replies

Reviews trailers per patch

None of the 7 patches has a Reviewed-by or Acked-by.

PatchGu Zheng
1/7
2/7
3/7
4/7T-b
5/7
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/7] PCI: fix pci dev add and remove sequence

The patchset is started while we try to address double remove pci devices via sysfs that is found by Gu.

main point is from Bjorn that add reference for bus, and he also pointed out that release should be done in pci_release_device.

After reviewing the add and remove path, found more problem that need to be addressed, like
1. proc attach/detach is not balanced
2. stop_and_remove device is not multiple calling safe.

Also found sriov VFs add path has problem, it call pci_bus_add_device to early, and it will make VF's driver get probed before PF's driver probing is done. That will also have nested lock problem.

Please consider those patches to be 3.10 materials.

Thanks

Yinghai

PCI: move back pci_proc_attach_devices calling
PCI: move resources and bus_list releasing to pci_release_dev
PCI: Detach driver in pci_stop_device
PCI: Fix racing for pci device removing via sysfs PCI, ACPI: Don't glue ACPI dev with pci VFs
PCI: Make sure VF's driver get attached after PF's
PCI: use pf as dma_dev for vf that does not have func0 sibling