From 59364957799f0c8159115a22c1f47fddfb4f0bfc Mon Sep 17 00:00:00 2001 From: Yu Ouyang Date: Mon, 22 Apr 2019 15:04:54 +0800 Subject: [PATCH] qcacmn: fix pcie card enable issue without CNSS module For 3rd party platform, without CNSS module, PCIe card failed to enable. Function hif_pci_enable_bus() should call hif_enable_pci_nopld(), not hif_enable_pci_pld(). So, checking platform driver supported or not before enable bus. If platform driver is not supported, return false in function hif_is_pld_based_target(). CRs-Fixed: 2439335 Change-Id: I57a1272f082e7ba1fbeee43d58a81997f3d0e6d7 --- hif/src/pcie/if_pci.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c index b762cfe281..9d9742a730 100644 --- a/hif/src/pcie/if_pci.c +++ b/hif/src/pcie/if_pci.c @@ -3638,8 +3638,12 @@ static void hif_pci_get_soc_info_nopld(struct hif_pci_softc *sc, struct device *dev) {} -static bool hif_is_pld_based_target(int device_id) +static bool hif_is_pld_based_target(struct hif_pci_softc *sc, + int device_id) { + if (!pld_have_platform_driver_support(sc->dev)) + return false; + switch (device_id) { case QCA6290_DEVICE_ID: case QCA6290_EMULATION_DEVICE_ID: @@ -3656,7 +3660,7 @@ static bool hif_is_pld_based_target(int device_id) static void hif_pci_init_deinit_ops_attach(struct hif_pci_softc *sc, int device_id) { - if (hif_is_pld_based_target(device_id)) { + if (hif_is_pld_based_target(sc, device_id)) { sc->hif_enable_pci = hif_enable_pci_pld; sc->hif_pci_deinit = hif_pci_deinit_pld; sc->hif_pci_get_soc_info = hif_pci_get_soc_info_pld;