From e2a2addf37181fb7e2fcbe286433c82d60cad8bf Mon Sep 17 00:00:00 2001 From: Shawn Lin Date: Wed, 1 Dec 2021 17:54:28 +0800 Subject: [PATCH] PCI: rockchip: dw: Fix unblance pm call for fake probe We move all the probe stuff to kthread so that it won't block the system to go on probing other drivers. But that introduced a bug that PM calls would not be removed by driver core. As each platform driver uses the same PM callbacks for all device instances. So add device_release_driver if it fails to probe devices. Fixes: 79ac46bdea6b ("PCI: rockchip: dw: Add kthread to probe PCIe devices") Signed-off-by: Shawn Lin Change-Id: I9d6ba448a87defa8d924927f1bfcff51c889e1a0 --- drivers/pci/controller/dwc/pcie-dw-rockchip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-dw-rockchip.c b/drivers/pci/controller/dwc/pcie-dw-rockchip.c index 7059a9ab4c75..8e0b426fc84c 100644 --- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c +++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c @@ -1840,6 +1840,8 @@ deinit_clk: disable_vpcie3v3: rk_pcie_disable_power(rk_pcie); + device_release_driver(dev); + return ret; }