diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c index 7cc79e1c3f7f..ab8b5ada6906 100644 --- a/hif/src/pcie/if_pci.c +++ b/hif/src/pcie/if_pci.c @@ -891,6 +891,16 @@ end: } #ifdef FEATURE_RUNTIME_PM +static bool hif_pci_pm_runtime_enabled(struct hif_pci_softc *sc) +{ + struct hif_softc *scn = HIF_GET_SOFTC(sc); + + if (scn->hif_config.enable_runtime_pm) + return true; + + return pm_runtime_enabled(sc->dev); +} + static const char *hif_pm_runtime_state_to_string(uint32_t state) { switch (state) { @@ -1307,7 +1317,7 @@ int hif_pm_runtime_sync_resume(struct hif_opaque_softc *hif_ctx) if (!sc) return -EINVAL; - if (!pm_runtime_enabled(sc->dev)) + if (!hif_pci_pm_runtime_enabled(sc)) return 0; pm_state = qdf_atomic_read(&sc->pm_state); @@ -3977,7 +3987,7 @@ int hif_pm_runtime_get_sync(struct hif_opaque_softc *hif_ctx) if (!sc) return -EINVAL; - if (!pm_runtime_enabled(sc->dev)) + if (!hif_pci_pm_runtime_enabled(sc)) return 0; pm_state = qdf_atomic_read(&sc->pm_state); @@ -4024,7 +4034,7 @@ int hif_pm_runtime_put_sync_suspend(struct hif_opaque_softc *hif_ctx) if (!sc) return -EINVAL; - if (!pm_runtime_enabled(sc->dev)) + if (!hif_pci_pm_runtime_enabled(sc)) return 0; usage_count = atomic_read(&sc->dev->power.usage_count); @@ -4053,7 +4063,7 @@ int hif_pm_runtime_request_resume(struct hif_opaque_softc *hif_ctx) if (!sc) return -EINVAL; - if (!pm_runtime_enabled(sc->dev)) + if (!hif_pci_pm_runtime_enabled(sc)) return 0; pm_state = qdf_atomic_read(&sc->pm_state); @@ -4088,7 +4098,7 @@ void hif_pm_runtime_get_noresume(struct hif_opaque_softc *hif_ctx) if (!sc) return; - if (!pm_runtime_enabled(sc->dev)) + if (!hif_pci_pm_runtime_enabled(sc)) return; HIF_PM_STATS_RUNTIME_GET_RECORD(sc); @@ -4120,7 +4130,7 @@ int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx) return -EFAULT; } - if (!pm_runtime_enabled(sc->dev)) + if (!hif_pci_pm_runtime_enabled(sc)) return 0; pm_state = qdf_atomic_read(&sc->pm_state); @@ -4188,7 +4198,7 @@ int hif_pm_runtime_put(struct hif_opaque_softc *hif_ctx) return -EFAULT; } - if (!pm_runtime_enabled(sc->dev)) + if (!hif_pci_pm_runtime_enabled(sc)) return 0; usage_count = atomic_read(&sc->dev->power.usage_count); @@ -4234,7 +4244,7 @@ int hif_pm_runtime_put_noidle(struct hif_opaque_softc *hif_ctx) if (!sc) return -EINVAL; - if (!pm_runtime_enabled(sc->dev)) + if (!hif_pci_pm_runtime_enabled(sc)) return 0; usage_count = atomic_read(&sc->dev->power.usage_count);