]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: dwc: Fix scheduling while atomic issues
authorJisheng Zhang <Jisheng.Zhang@synaptics.com>
Thu, 20 Sep 2018 21:32:52 +0000 (16:32 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 20 Sep 2018 21:36:20 +0000 (16:36 -0500)
commit5ec82430a656e60543f9cff94a4ba5b4836e922c
tree21b380d0e4f4b0088a076d0c40be1fe975531ab0
parentd006d2b80823157185730662847fa09bf3fa9c1a
PCI: dwc: Fix scheduling while atomic issues

When programming the inbound/outbound ATUs, we call usleep_range() after
each checking PCIE_ATU_ENABLE bit. Unfortunately, the ATU programming
can be executed in atomic context:

inbound ATU programming could be called through
pci_epc_write_header()
  =>dw_pcie_ep_write_header()
    =>dw_pcie_prog_inbound_atu()

outbound ATU programming could be called through
pci_bus_read_config_dword()
  =>dw_pcie_rd_conf()
    =>dw_pcie_prog_outbound_atu()

Fix this issue by calling mdelay() instead.

Fixes: 111b08ef5f91 ("PCI: dwc: designware: Add EP mode support")
Fixes: 1ca8fb9c7e4c ("PCI: designware: Wait for iATU enable")
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
[lorenzo.pieralisi@arm.com: commit log update]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
drivers/pci/controller/dwc/pcie-designware.c
drivers/pci/controller/dwc/pcie-designware.h