qcacmn: Unify A_TARGET_ACCESS_LIKELY

Sleep state adjust has been added the the bus_ops table and the
macros using it can be unified.

Change-Id: Ib788800c83457919ae7eee01f6687cbb57c84a4b
CRs-Fixed: 986480
This commit is contained in:
Houston Hoffman
2016-03-14 21:11:57 -07:00
committed by Gerrit - the friendly Code Review server
parent ca581c4ee3
commit 0b48913237
3 changed files with 37 additions and 41 deletions

View File

@@ -41,6 +41,43 @@
#define Q_TARGET_ACCESS_END(scn) \
hif_target_sleep_state_adjust(scn, true, false)
/*
* A_TARGET_ACCESS_LIKELY will not wait for the target to wake up before
* continuing execution. Because A_TARGET_ACCESS_LIKELY does not guarantee
* that the target is awake before continuing, Q_TARGET_ACCESS macros must
* protect the actual target access. Since Q_TARGET_ACCESS protect the actual
* target access, A_TARGET_ACCESS_LIKELY hints are optional.
*
* To ignore "LIKELY" hints, set CONFIG_TARGET_ACCESS_LIKELY to 0
* (slightly worse performance, less power)
*
* To use "LIKELY" hints, set CONFIG_TARGET_ACCESS_LIKELY to 1
* (slightly better performance, more power)
*
* note: if a bus doesn't use hif_target_sleep_state_adjust, this will have
* no impact.
*/
#define CONFIG_TARGET_ACCESS_LIKELY 0
#if CONFIG_TARGET_ACCESS_LIKELY
#define A_TARGET_ACCESS_LIKELY(scn) \
hif_target_sleep_state_adjust(scn, false, false)
#define A_TARGET_ACCESS_UNLIKELY(scn) \
hif_target_sleep_state_adjust(scn, true, false)
#else /* CONFIG_ATH_PCIE_ACCESS_LIKELY */
#define A_TARGET_ACCESS_LIKELY(scn) \
do { \
unsigned long unused = (unsigned long)(scn); \
unused = unused; \
} while (0)
#define A_TARGET_ACCESS_UNLIKELY(scn) \
do { \
unsigned long unused = (unsigned long)(scn); \
unused = unused; \
} while (0)
#endif /* CONFIG_ATH_PCIE_ACCESS_LIKELY */
#ifdef HIF_PCI
#include "hif_io32_pci.h"
#endif

View File

@@ -47,18 +47,6 @@
*/
#define CONFIG_ATH_PCIE_AWAKE_WHILE_DRIVER_LOAD 1
/*
* When CONFIG_ATH_PCIE_MAX_PERF is 0:
* To use LIKELY hints, set this to 1 (slightly better performance, more power)
* To ignore "LIKELY" hints, set this to 0 (slightly worse performance,
* less power)
*/
#if defined(CONFIG_ATH_PCIE_MAX_PERF)
#define CONFIG_ATH_PCIE_ACCESS_LIKELY 0
#else
#define CONFIG_ATH_PCIE_ACCESS_LIKELY 1
#endif
/*
* PCI-E L1 ASPPM sub-states
* To enable clock gating in L1 state, set this to 1.
@@ -93,14 +81,6 @@
do {struct hif_softc *unused = scn; \
unused = unused; } while (0)
#define A_TARGET_ACCESS_LIKELY(scn) \
do {struct hif_softc *unused = scn; \
unused = unused; } while (0)
#define A_TARGET_ACCESS_UNLIKELY(scn) \
do {struct hif_softc *unused = scn; \
unused = unused; } while (0)
#define A_TARGET_ACCESS_BEGIN_RET(scn) \
do {struct hif_softc *unused = scn; \
unused = unused; } while (0)
@@ -180,25 +160,6 @@ do { \
if (Q_TARGET_ACCESS_END(scn) < 0) \
return; \
} while (0)
#if CONFIG_ATH_PCIE_ACCESS_LIKELY
#define A_TARGET_ACCESS_LIKELY(scn) \
hif_target_sleep_state_adjust(scn, false, false)
#define A_TARGET_ACCESS_UNLIKELY(scn) \
hif_target_sleep_state_adjust(scn, true, false)
#else /* CONFIG_ATH_PCIE_ACCESS_LIKELY */
#define A_TARGET_ACCESS_LIKELY(scn) \
do { \
unsigned long unused = (unsigned long)(scn); \
unused = unused; \
} while (0)
#define A_TARGET_ACCESS_UNLIKELY(scn) \
do { \
unsigned long unused = (unsigned long)(scn); \
unused = unused; \
} while (0)
#endif /* CONFIG_ATH_PCIE_ACCESS_LIKELY */
#endif /* CONFIG_ATH_PCIE_MAX_PERF */
irqreturn_t hif_fw_interrupt_handler(int irq, void *arg);

View File

@@ -47,8 +47,6 @@
* Force 0 and consider moving corresponding code into
* pci specific files
*/
#define A_TARGET_ACCESS_LIKELY(scn)
#define A_TARGET_ACCESS_UNLIKELY(scn)
#define A_TARGET_ACCESS_BEGIN_RET_PTR(scn)
#define A_TARGET_ACCESS_END_RET_PTR(scn)
#define A_TARGET_ACCESS_BEGIN(scn)