android_kernel_xiaomi_sm8350/drivers/pci
Kenji Kaneshige 79df4c60c5 PCI: Fix wrong reference counter check for proc_dir_entry
Fix wrong counter check for proc_dir_entry in pci_proc_detach_device().

The pci_proc_detach_device() returns with -EBUSY before calling
remove_proc_entry() if the reference counter of proc_dir_entry is not
0. But this check is wrong and pci_proc_detach_device() always fails
because the reference counter of proc_dir_entry is initialized with 1
at creating time and decremented in remove_proc_entry(). This bug
cause strange behaviour as followings:

- Accessing /proc/bus/pci/XXXX/YY file after hot-removing pci adapter
  card causes kernel panic.

- Repeating hot-add/hot-remove of pci adapter card increases files
  with the same name under /proc/bus/pci/XXXX/ directory. For example:

    # pwd
    /proc/bus/pci/0002:09
    # ls
    01.0
    # for i in `seq 5`
    > do
    > echo 0 > /sys/bus/pci/slots/0009_0032/power
    > echo 1 > /sys/bus/pci/slots/0009_0032/power
    > done
    # ls
    01.0  01.0  01.0  01.0  01.0  01.0

The pci_proc_detach_device() should check if the reference counter is
not larger than 1 instead.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-21 15:34:39 -08:00
..
hotplug PCI: don't load acpi_php when acpi is disabled 2008-02-21 15:34:37 -08:00
pcie Revert "PCI: PCIE ASPM support" 2008-02-02 11:32:01 -08:00
.gitignore
access.c
bus.c PCI: make pci_bus a struct device 2008-02-01 15:04:31 -08:00
dmar.c Genericizing iova.[ch] 2008-02-06 10:41:01 -08:00
hotplug-pci.c PCI: fix section mismatch warnings referring to pci_do_scan_bus 2008-02-02 15:04:30 -08:00
hotplug.c Driver core: change add_uevent_var to use a struct 2007-10-12 14:51:01 -07:00
htirq.c
intel-iommu.c intel-iommu: fault_reason index cleanup 2008-02-08 09:22:24 -08:00
intel-iommu.h intel-iommu: PMEN support 2008-02-08 09:22:24 -08:00
iova.c Genericizing iova.[ch] 2008-02-06 10:41:01 -08:00
iova.h Genericizing iova.[ch] 2008-02-06 10:41:01 -08:00
Kconfig PCI: Add Kconfig option to disable deprecated pci_find_* API 2007-11-05 13:35:17 -08:00
Makefile mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
msi.c PCI: drivers/pci/msi.c: move arch hooks to the top 2008-02-01 15:04:25 -08:00
msi.h
pci-acpi.c PCI: kernel-doc: fix pci-acpi warning 2008-02-21 15:34:37 -08:00
pci-driver.c PCI: Mem Policy: fix mempolicy usage in pci driver 2008-02-01 15:04:20 -08:00
pci-sysfs.c Revert "PCI: PCIE ASPM support" 2008-02-02 11:32:01 -08:00
pci.c iommu sg merging: PCI: add dma segment boundary support 2008-02-05 09:44:12 -08:00
pci.h PCI: make pci_bus a struct device 2008-02-01 15:04:31 -08:00
probe.c iommu sg merging: PCI: add dma segment boundary support 2008-02-05 09:44:12 -08:00
proc.c PCI: Fix wrong reference counter check for proc_dir_entry 2008-02-21 15:34:39 -08:00
quirks.c PCI: quirks: set 'En' bit of MSI Mapping for devices onHT-based nvidia platform 2008-02-21 15:34:37 -08:00
remove.c Revert "PCI: PCIE ASPM support" 2008-02-02 11:32:01 -08:00
rom.c PCI: drivers/pci/rom.c: #if 0 two functions 2008-02-01 15:04:18 -08:00
search.c PCI: Add Kconfig option to disable deprecated pci_find_* API 2007-11-05 13:35:17 -08:00
setup-bus.c PCI: fix up setup-bus.c #ifdef 2008-02-21 15:34:38 -08:00
setup-irq.c kobjects: fix up improper use of the kobject name field 2007-10-12 14:51:02 -07:00
setup-res.c PCI: Fix warning in setup-res.c on 32-bit platforms with 64-bit resources 2008-02-01 15:04:25 -08:00
syscall.c PCI: remove unneeded lock_kernel() in drivers/pci/syscall.c. 2008-02-01 15:04:21 -08:00