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
This commit is contained in:
Houston Hoffman
2016-03-14 21:11:58 -07:00
committed by Gerrit - the friendly Code Review server
parent 0b48913237
commit 54ef87d3aa
4 changed files with 16 additions and 15 deletions

View File

@@ -90,7 +90,7 @@ QDF_STATUS hif_bus_open(struct hif_softc *hif_sc,
switch (bus_type) { switch (bus_type) {
case QDF_BUS_TYPE_PCI: case QDF_BUS_TYPE_PCI:
status = hif_initialize_pci_ops(&hif_sc->bus_ops); status = hif_initialize_pci_ops(hif_sc);
break; break;
case QDF_BUS_TYPE_SNOC: case QDF_BUS_TYPE_SNOC:
status = hif_initialize_snoc_ops(&hif_sc->bus_ops); status = hif_initialize_snoc_ops(&hif_sc->bus_ops);

View File

@@ -57,9 +57,9 @@ static inline QDF_STATUS hif_initialize_snoc_ops(struct hif_bus_ops *hif_sc)
#endif /* HIF_SNOC */ #endif /* HIF_SNOC */
#ifdef HIF_PCI #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 #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__); HIF_ERROR("%s: not supported", __func__);
return QDF_STATUS_E_NOSUPPORT; return QDF_STATUS_E_NOSUPPORT;

View File

@@ -26,6 +26,8 @@
*/ */
#include "hif.h" #include "hif.h"
#include "epping_main.h"
#include "hif_main.h"
#include "multibus.h" #include "multibus.h"
#include "pci_api.h" #include "pci_api.h"
#include "hif_io32.h" #include "hif_io32.h"
@@ -37,8 +39,10 @@
* *
* Return: QDF_STATUS_SUCCESS * 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_open = &hif_pci_open;
bus_ops->hif_bus_close = &hif_pci_close; bus_ops->hif_bus_close = &hif_pci_close;
bus_ops->hif_bus_prevent_linkdown = &hif_pci_prevent_linkdown; 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_suspend = &hif_pci_bus_suspend;
bus_ops->hif_bus_resume = &hif_pci_bus_resume; 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 = bus_ops->hif_target_sleep_state_adjust =
&hif_pci_target_sleep_state_adjust; &hif_pci_target_sleep_state_adjust;
else else

View File

@@ -117,15 +117,13 @@ do { \
#define A_TARGET_ACCESS_BEGIN_RET(scn) \ #define A_TARGET_ACCESS_BEGIN_RET(scn) \
do { \ do { \
if (!WLAN_IS_EPPING_ENABLED(hif_get_conparam(scn)) && \ if (Q_TARGET_ACCESS_BEGIN(scn) < 0) \
Q_TARGET_ACCESS_BEGIN(scn) < 0) \
return ATH_ISR_NOSCHED; \ return ATH_ISR_NOSCHED; \
} while (0) } while (0)
#define A_TARGET_ACCESS_BEGIN_RET_PTR(scn) \ #define A_TARGET_ACCESS_BEGIN_RET_PTR(scn) \
do { \ do { \
if (!WLAN_IS_EPPING_ENABLED(hif_get_conparam(scn)) && \ if (Q_TARGET_ACCESS_BEGIN(scn) < 0) \
Q_TARGET_ACCESS_BEGIN(scn) < 0) \
return NULL; \ return NULL; \
} while (0) } while (0)
@@ -137,22 +135,19 @@ do { \
#define A_TARGET_ACCESS_END_RET(scn) \ #define A_TARGET_ACCESS_END_RET(scn) \
do { \ do { \
if (!WLAN_IS_EPPING_ENABLED(hif_get_conparam(scn)) && \ if (Q_TARGET_ACCESS_END(scn) < 0) \
Q_TARGET_ACCESS_END(scn) < 0) \
return ATH_ISR_NOSCHED; \ return ATH_ISR_NOSCHED; \
} while (0) } while (0)
#define A_TARGET_ACCESS_END_RET_EXT(scn, val) \ #define A_TARGET_ACCESS_END_RET_EXT(scn, val) \
do { \ do { \
if (!WLAN_IS_EPPING_ENABLED(hif_get_conparam(scn)) && \ if (Q_TARGET_ACCESS_END(scn) < 0) \
Q_TARGET_ACCESS_END(scn) < 0) \
val = -1; \ val = -1; \
} while (0) } while (0)
#define A_TARGET_ACCESS_END_RET_PTR(scn) \ #define A_TARGET_ACCESS_END_RET_PTR(scn) \
do { \ do { \
if (!WLAN_IS_EPPING_ENABLED(hif_get_conparam(scn)) && \ if (Q_TARGET_ACCESS_END(scn) < 0) \
Q_TARGET_ACCESS_END(scn) < 0) \
return NULL; \ return NULL; \
} while (0) } while (0)
#define A_TARGET_ACCESS_END(scn) \ #define A_TARGET_ACCESS_END(scn) \