alistair23-linux/drivers/pci/controller
Dexuan Cui 35a88a18d7 PCI: hv: Disable/enable IRQs rather than BH in hv_compose_msi_msg()
Commit de0aa7b2f9 ("PCI: hv: Fix 2 hang issues in hv_compose_msi_msg()")
uses local_bh_disable()/enable(), because hv_pci_onchannelcallback() can
also run in tasklet context as the channel event callback, so bottom halves
should be disabled to prevent a race condition.

With CONFIG_PROVE_LOCKING=y in the recent mainline, or old kernels that
don't have commit f71b74bca6 ("irq/softirqs: Use lockdep to assert IRQs
are disabled/enabled"), when the upper layer IRQ code calls
hv_compose_msi_msg() with local IRQs disabled, we'll see a warning at the
beginning of __local_bh_enable_ip():

  IRQs not enabled as expected
    WARNING: CPU: 0 PID: 408 at kernel/softirq.c:162 __local_bh_enable_ip

The warning exposes an issue in de0aa7b2f9: local_bh_enable() can
potentially call do_softirq(), which is not supposed to run when local IRQs
are disabled. Let's fix this by using local_irq_save()/restore() instead.

Note: hv_pci_onchannelcallback() is not a hot path because it's only called
when the PCI device is hot added and removed, which is infrequent.

Fixes: de0aa7b2f9 ("PCI: hv: Fix 2 hang issues in hv_compose_msi_msg()")
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Cc: stable@vger.kernel.org
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: K. Y. Srinivasan <kys@microsoft.com>
2018-07-09 13:16:07 -05:00
..
dwc PCI: controller: dwc: Do not let PCIE_DW_PLAT_HOST default to yes 2018-06-29 13:49:04 -05:00
Kconfig
Makefile
pci-aardvark.c
pci-ftpci100.c PCI: faraday: Add missing of_node_put() 2018-06-29 13:50:27 -05:00
pci-host-common.c
pci-host-generic.c
pci-hyperv.c PCI: hv: Disable/enable IRQs rather than BH in hv_compose_msi_msg() 2018-07-09 13:16:07 -05:00
pci-mvebu.c
pci-rcar-gen2.c
pci-tegra.c
pci-thunder-ecam.c
pci-thunder-pem.c
pci-v3-semi.c
pci-versatile.c
pci-xgene-msi.c
pci-xgene.c
pcie-altera-msi.c
pcie-altera.c
pcie-cadence-ep.c
pcie-cadence-host.c
pcie-cadence.c
pcie-cadence.h
pcie-iproc-bcma.c
pcie-iproc-msi.c
pcie-iproc-platform.c
pcie-iproc.c
pcie-iproc.h
pcie-mediatek.c
pcie-mobiveil.c
pcie-rcar.c PCI: rcar: Clean up PHY init on failure 2018-06-29 13:48:54 -05:00
pcie-rockchip-ep.c
pcie-rockchip-host.c
pcie-rockchip.c
pcie-rockchip.h
pcie-tango.c
pcie-xilinx-nwl.c PCI: xilinx-nwl: Add missing of_node_put() 2018-06-29 13:50:10 -05:00
pcie-xilinx.c PCI: xilinx: Add missing of_node_put() 2018-06-29 13:49:54 -05:00
vmd.c