android_kernel_oneplus_msm8998/drivers/pci
Marek Vasut 4a5fd966ed PCI: sysfs: Ignore lockdep for remove attribute
[ Upstream commit dc6b698a86fe40a50525433eb8e92a267847f6f9 ]

With CONFIG_PROVE_LOCKING=y, using sysfs to remove a bridge with a device
below it causes a lockdep warning, e.g.,

  # echo 1 > /sys/class/pci_bus/0000:00/device/0000:00:00.0/remove
  ============================================
  WARNING: possible recursive locking detected
  ...
  pci_bus 0000:01: busn_res: [bus 01] is released

The remove recursively removes the subtree below the bridge.  Each call
uses a different lock so there's no deadlock, but the locks were all
created with the same lockdep key so the lockdep checker can't tell them
apart.

Mark the "remove" sysfs attribute with __ATTR_IGNORE_LOCKDEP() as it is
safe to ignore the lockdep check between different "remove" kernfs
instances.

There's discussion about a similar issue in USB at [1], which resulted in
356c05d58a ("sysfs: get rid of some lockdep false positives") and
e9b526fe70 ("i2c: suppress lockdep warning on delete_device"), which do
basically the same thing for USB "remove" and i2c "delete_device" files.

[1] https://lore.kernel.org/r/Pine.LNX.4.44L0.1204251436140.1206-100000@iolanthe.rowland.org
Link: https://lore.kernel.org/r/20190526225151.3865-1-marek.vasut@gmail.com
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
[bhelgaas: trim commit log, details at above links]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Phil Edworthy <phil.edworthy@renesas.com>
Cc: Simon Horman <horms+renesas@verge.net.au>
Cc: Tejun Heo <tj@kernel.org>
Cc: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-08-04 09:34:57 +02:00
..
host PCI: xilinx: Check for __get_free_pages() failure 2019-06-22 08:18:21 +02:00
hotplug PCI: rpadlpar: Fix leaked device_node references in add/remove paths 2019-06-22 08:18:21 +02:00
pcie PCI/AER: Report non-fatal errors only to the affected endpoint 2017-12-25 14:22:15 +01:00
access.c PCI: Use function 0 VPD for identical functions, regular VPD for others 2015-09-24 17:06:32 -05:00
ats.c PCI: Remove pci_ats_enabled() 2015-08-13 15:59:59 -05:00
bus.c PCI: Fix minimum allocation address overwrite 2016-02-17 12:30:56 -08:00
host-bridge.c
hotplug-pci.c
htirq.c
iov.c PCI: Create SR-IOV virtfn/physfn links before attaching driver 2017-12-25 14:22:14 +01:00
irq.c
Kconfig PCI,parisc: Enable 64-bit bus addresses on PA-RISC 2015-09-08 15:30:47 +02:00
Makefile PCI: Build setup-irq.o for arm64 2015-08-20 12:02:49 -05:00
msi.c genirq/msi: Make sure PCI MSIs are activated early 2016-09-07 08:32:38 +02:00
of.c PCI/MSI: Use of_msi_get_domain instead of open-coded "msi-parent" parsing 2015-10-16 13:07:14 +01:00
pci-acpi.c ACPI / PCI: Bail early in acpi_pci_add_bus() if there is no ACPI handle 2018-08-09 12:19:28 +02:00
pci-driver.c PCI: Restore config space on runtime resume despite being unbound 2018-05-30 07:49:12 +02:00
pci-label.c
pci-stub.c
pci-sysfs.c PCI: sysfs: Ignore lockdep for remove attribute 2019-08-04 09:34:57 +02:00
pci.c PCI: Do not poll for PME if the device is in D3cold 2019-08-04 09:34:51 +02:00
pci.h PCI: Remove pci_resource_bar() and pci_iov_resource_bar() 2017-03-30 09:35:19 +02:00
probe.c PCI: Skip MPS logic for Virtual Functions (VFs) 2018-08-24 13:27:01 +02:00
proc.c
quirks.c PCI: Mark Atheros AR9462 to avoid bus reset 2019-06-11 12:23:48 +02:00
remove.c PCI: Detach driver before procfs & sysfs teardown on device remove 2017-12-20 10:05:00 +01:00
rom.c PCI: Add comments about ROM BAR updating 2017-03-30 09:35:19 +02:00
search.c
setup-bus.c PCI: Handle IORESOURCE_PCI_FIXED when assigning resources 2015-10-29 17:35:39 -05:00
setup-irq.c
setup-res.c PCI: Make PCI_ROM_ADDRESS_MASK a 32-bit constant 2018-04-08 11:51:57 +02:00
slot.c PCI: Hold pci_slot_mutex while searching bus->slots list 2015-07-30 16:19:53 -05:00
syscall.c
vc.c
vpd.c
xen-pcifront.c xen/pcifront: Fix mysterious crashes when NUMA locality information was extracted. 2016-03-03 15:07:30 -08:00