Re: [PATCH 0/9] PCI: Eliminate race conditions between hotplug andsysfs rescan/remove (Was: Re: [PATCH v2 04/10] PCI: Destroy pci dev onlyonce)

From: Bjorn Helgaas
Date: Wed Jan 15 2014 - 13:02:28 EST


On Fri, Jan 10, 2014 at 03:20:44PM +0100, Rafael J. Wysocki wrote:
> [Cc: adding linux-scsi for the MPT changes, Ben for powerpc, Matthew for
> platform/x86 and Konrad for Xen]
>
> On Friday, December 06, 2013 02:21:50 AM Rafael J. Wysocki wrote:
>
> [...]
>
> >
> > OK
> >
> > To be a bit more constructive, as the next step I'd try to use
> > pci_remove_rescan_mutex to serialize all PCI hotplug operations (as I said
> > above) without making the other changes made by my patch. Does that sound
> > reasonable?
>
> Well, no answer here, so as a followup, a series implementing that idea
> follows.
>
> I *hope* I found all of the places that need to be synchronized vs the bus
> rescan and device removal that can be triggered via sysfs, but I might overlook
> something. Also in some cases I wasn't quite sure how much stuff to put under
> the lock, because said stuff is not exactly straightforward.

I applied this series to my pci/locking branch for v3.14. It should appear
in -next tomorrow.

Note that this touches some areas that are not strictly PCI, so speak
up if I'm treading on your toes:

arch/powerpc/kernel/eeh_driver.c | 19 ++++++++++++--
drivers/acpi/pci_root.c | 6 ++++
drivers/message/fusion/mptbase.c | 2 -
drivers/pci/hotplug/acpiphp.h | 5 +++
drivers/pci/hotplug/acpiphp_core.c | 2 -
drivers/pci/hotplug/acpiphp_glue.c | 43 +++++++++++++++++++++++++++++----
drivers/pci/hotplug/cpci_hotplug_pci.c | 14 +++++++++-
drivers/pci/hotplug/cpqphp_pci.c | 8 +++++-
drivers/pci/hotplug/ibmphp_core.c | 13 ++++++++-
drivers/pci/hotplug/pciehp_pci.c | 17 +++++++++----
drivers/pci/hotplug/rpadlpar_core.c | 19 ++++++++++----
drivers/pci/hotplug/rpaphp_core.c | 4 +++
drivers/pci/hotplug/s390_pci_hpc.c | 4 ++-
drivers/pci/hotplug/sgi_hotplug.c | 5 +++
drivers/pci/hotplug/shpchp_pci.c | 18 ++++++++++---
drivers/pci/pci-sysfs.c | 19 +++++---------
drivers/pci/probe.c | 18 +++++++++++++
drivers/pci/remove.c | 11 ++++++++
drivers/pci/xen-pcifront.c | 8 ++++++
drivers/pcmcia/cardbus.c | 7 +++++
drivers/platform/x86/asus-wmi.c | 2 +
drivers/platform/x86/eeepc-laptop.c | 2 +
drivers/scsi/mpt2sas/mpt2sas_base.c | 2 -
drivers/scsi/mpt3sas/mpt3sas_base.c | 2 -
include/linux/pci.h | 3 ++

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/