[RFC 0/2] PCI: acpiphp: workaround race between hotplug and SCSI_SCAN_ASYNC job

From: Igor Mammedov
Date: Tue Dec 12 2023 - 19:36:36 EST


Hacks to mask a race between HBA scan job and bridge re-configuration(s)
during hotplug.

I don't like it a bit but it something that could be done quickly
and solves problems that were reported.

Other options to discuss/possibly more invasive:
1: make sure pci_assign_unassigned_bridge_resources() doesn't reconfigure
bridge if it's not necessary.
2. make SCSI_SCAN_ASYNC job wait till hotplug is finished for all slots on
the bridge or somehow restart the job if it fails
3. any other ideas?


1st reported: https://lore.kernel.org/r/9eb669c0-d8f2-431d-a700-6da13053ae54@xxxxxxxxxxx

CC: Dongli Zhang <dongli.zhang@xxxxxxxxxx>
CC: linux-acpi@xxxxxxxxxxxxxxx
CC: linux-pci@xxxxxxxxxxxxxxx
CC: imammedo@xxxxxxxxxx
CC: mst@xxxxxxxxxx
CC: rafael@xxxxxxxxxx
CC: lenb@xxxxxxxxxx
CC: bhelgaas@xxxxxxxxxx
CC: mika.westerberg@xxxxxxxxxxxxxxx
CC: boris.ostrovsky@xxxxxxxxxx
CC: joe.jin@xxxxxxxxxx
CC: stable@xxxxxxxxxxxxxxx
CC: linux-kernel@xxxxxxxxxxxxxxx
CC: Fiona Ebner <f.ebner@xxxxxxxxxxx>
CC: Thomas Lamprecht <t.lamprecht@xxxxxxxxxxx>

Igor Mammedov (2):
PCI: acpiphp: enable slot only if it hasn't been enabled already
PCI: acpiphp: slowdown hotplug if hotplugging multiple devices at a
time

drivers/pci/hotplug/acpiphp_glue.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

--
2.39.3