]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: imx6: Move link up check into imx6_pcie_wait_for_link()
authorLucas Stach <l.stach@pengutronix.de>
Mon, 25 Jan 2016 22:50:02 +0000 (16:50 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 25 Jan 2016 22:50:02 +0000 (16:50 -0600)
commitfbb8272326715f8c49d09d89cf324f9eabd3eb08
treedc851256d8c34ef193b7fa5f75d7c7e0b7b7da9e
parent0593dbf0b74dfd062fc1a19b2ad7116943e13032
PCI: imx6: Move link up check into imx6_pcie_wait_for_link()

imx6_pcie_link_up() previously used usleep_range() to wait for the link to
come up.  Since it may be called while holding the config spinlock, the
sleep causes a "BUG: scheduling while atomic" error.

Instead of waiting for the link to come up in imx6_pcie_link_up(), do the
waiting in imx6_pcie_wait_for_link(), where we're not holding a lock and
sleeping is allowed.

[bhelgaas: changelog, references to bugzilla and 8eae9040b945]
Link: https://bugzilla.kernel.org/show_bug.cgi?id=100031
Fixes: 8eae9040b945 ("PCI: imx6: Wait for retraining")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/host/pci-imx6.c