From 54ef87d3aa5edff5e5de4cc3b80891d6716d44a9 Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Mon, 14 Mar 2016 21:11:58 -0700 Subject: [PATCH] qcacmn: Dummy sleep_state_adjust for epping mode Epping mode is a test mode and wants the target to be forced awake at all times. The sleep state adjust calls to keep the target awake while the driver is loading and to keep the driver awake in max perf mode are converted to the pci specific function so that they won't get dummied out. This fixes the logic for MAX PERF mode by avoiding the dummy for the keep awake call and correctly avoiding the sleep ok call when power management is re-enabled after driver load. This removes a discrepancy where some sleep state adjusts were missing the epping mode check. (Q_TARGET_ACCESS_BEGIN...) Change-Id: I4e546f12703bcee21a76f42c12b59dd7fd1ab1a9 CRs-Fixed: 986480 --- hif/src/dispatcher/multibus.c | 2 +- hif/src/dispatcher/multibus.h | 4 ++-- hif/src/dispatcher/multibus_pci.c | 10 ++++++++-- hif/src/pcie/hif_io32_pci.h | 15 +++++---------- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/hif/src/dispatcher/multibus.c b/hif/src/dispatcher/multibus.c index 373a24548eda..601f45ca7f86 100644 --- a/hif/src/dispatcher/multibus.c +++ b/hif/src/dispatcher/multibus.c @@ -90,7 +90,7 @@ QDF_STATUS hif_bus_open(struct hif_softc *hif_sc, switch (bus_type) { case QDF_BUS_TYPE_PCI: - status = hif_initialize_pci_ops(&hif_sc->bus_ops); + status = hif_initialize_pci_ops(hif_sc); break; case QDF_BUS_TYPE_SNOC: status = hif_initialize_snoc_ops(&hif_sc->bus_ops); diff --git a/hif/src/dispatcher/multibus.h b/hif/src/dispatcher/multibus.h index b30013b01d8c..d9083a0cfafd 100644 --- a/hif/src/dispatcher/multibus.h +++ b/hif/src/dispatcher/multibus.h @@ -57,9 +57,9 @@ static inline QDF_STATUS hif_initialize_snoc_ops(struct hif_bus_ops *hif_sc) #endif /* HIF_SNOC */ #ifdef HIF_PCI -QDF_STATUS hif_initialize_pci_ops(struct hif_bus_ops *hif_sc); +QDF_STATUS hif_initialize_pci_ops(struct hif_softc *hif_sc); #else -static inline QDF_STATUS hif_initialize_pci_ops(struct hif_bus_ops *hif_sc) +static inline QDF_STATUS hif_initialize_pci_ops(struct hif_softc *hif_sc) { HIF_ERROR("%s: not supported", __func__); return QDF_STATUS_E_NOSUPPORT; diff --git a/hif/src/dispatcher/multibus_pci.c b/hif/src/dispatcher/multibus_pci.c index c4456c3fa5ee..5bd9601307e6 100644 --- a/hif/src/dispatcher/multibus_pci.c +++ b/hif/src/dispatcher/multibus_pci.c @@ -26,6 +26,8 @@ */ #include "hif.h" +#include "epping_main.h" +#include "hif_main.h" #include "multibus.h" #include "pci_api.h" #include "hif_io32.h" @@ -37,8 +39,10 @@ * * Return: QDF_STATUS_SUCCESS */ -QDF_STATUS hif_initialize_pci_ops(struct hif_bus_ops *bus_ops) +QDF_STATUS hif_initialize_pci_ops(struct hif_softc *hif_sc) { + struct hif_bus_ops *bus_ops = &hif_sc->bus_ops; + bus_ops->hif_bus_open = &hif_pci_open; bus_ops->hif_bus_close = &hif_pci_close; bus_ops->hif_bus_prevent_linkdown = &hif_pci_prevent_linkdown; @@ -46,7 +50,9 @@ QDF_STATUS hif_initialize_pci_ops(struct hif_bus_ops *bus_ops) bus_ops->hif_bus_suspend = &hif_pci_bus_suspend; bus_ops->hif_bus_resume = &hif_pci_bus_resume; - if (CONFIG_ATH_PCIE_MAX_PERF == 0) + /* do not put the target to sleep for epping or maxperf mode */ + if (CONFIG_ATH_PCIE_MAX_PERF == 0 && + !WLAN_IS_EPPING_ENABLED(hif_get_conparam(hif_sc))) bus_ops->hif_target_sleep_state_adjust = &hif_pci_target_sleep_state_adjust; else diff --git a/hif/src/pcie/hif_io32_pci.h b/hif/src/pcie/hif_io32_pci.h index c7dbc0ad5c4e..fec1a86da82d 100644 --- a/hif/src/pcie/hif_io32_pci.h +++ b/hif/src/pcie/hif_io32_pci.h @@ -117,15 +117,13 @@ do { \ #define A_TARGET_ACCESS_BEGIN_RET(scn) \ do { \ - if (!WLAN_IS_EPPING_ENABLED(hif_get_conparam(scn)) && \ - Q_TARGET_ACCESS_BEGIN(scn) < 0) \ + if (Q_TARGET_ACCESS_BEGIN(scn) < 0) \ return ATH_ISR_NOSCHED; \ } while (0) #define A_TARGET_ACCESS_BEGIN_RET_PTR(scn) \ do { \ - if (!WLAN_IS_EPPING_ENABLED(hif_get_conparam(scn)) && \ - Q_TARGET_ACCESS_BEGIN(scn) < 0) \ + if (Q_TARGET_ACCESS_BEGIN(scn) < 0) \ return NULL; \ } while (0) @@ -137,22 +135,19 @@ do { \ #define A_TARGET_ACCESS_END_RET(scn) \ do { \ - if (!WLAN_IS_EPPING_ENABLED(hif_get_conparam(scn)) && \ - Q_TARGET_ACCESS_END(scn) < 0) \ + if (Q_TARGET_ACCESS_END(scn) < 0) \ return ATH_ISR_NOSCHED; \ } while (0) #define A_TARGET_ACCESS_END_RET_EXT(scn, val) \ do { \ - if (!WLAN_IS_EPPING_ENABLED(hif_get_conparam(scn)) && \ - Q_TARGET_ACCESS_END(scn) < 0) \ + if (Q_TARGET_ACCESS_END(scn) < 0) \ val = -1; \ } while (0) #define A_TARGET_ACCESS_END_RET_PTR(scn) \ do { \ - if (!WLAN_IS_EPPING_ENABLED(hif_get_conparam(scn)) && \ - Q_TARGET_ACCESS_END(scn) < 0) \ + if (Q_TARGET_ACCESS_END(scn) < 0) \ return NULL; \ } while (0) #define A_TARGET_ACCESS_END(scn) \