Skip to content

Commit

Permalink
qcacld-3.0: Do not allow any wakelocks to be held
Browse files Browse the repository at this point in the history
These contribute to a great amount of idle drain.

Tests: 30 minutes of playing Spotify with the screen off, unplugged.

Signed-off-by: Tyler Nijmeh <tylernij@gmail.com>

 Conflicts:
	drivers/staging/qca-wifi-host-cmn/qdf/linux/src/qdf_lock.c

Signed-off-by: CryllicBuster273 <cryllicbuster273@pixelexperience.org>
Signed-off-by: PainKiller3 <ninadpatil100@gmail.com>
  • Loading branch information
tytydraco authored and humanglitch191 committed Jun 5, 2021
1 parent 7306657 commit 522353c
Showing 1 changed file with 0 additions and 66 deletions.
66 changes: 0 additions & 66 deletions drivers/staging/qca-wifi-host-cmn/qdf/linux/src/qdf_lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,19 +240,10 @@ qdf_export_symbol(qdf_mutex_release);
*
* Return: Pointer to the name if it is valid or a default string
*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
const char *qdf_wake_lock_name(qdf_wake_lock_t *lock)
{
if (lock->name)
return lock->name;
return "UNNAMED_WAKELOCK";
}
#else
const char *qdf_wake_lock_name(qdf_wake_lock_t *lock)
{
return "NO_WAKELOCK_SUPPORT";
}
#endif
qdf_export_symbol(qdf_wake_lock_name);

/**
Expand All @@ -264,18 +255,10 @@ qdf_export_symbol(qdf_wake_lock_name);
* QDF status success: if wake lock is initialized
* QDF status failure: if wake lock was not initialized
*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
QDF_STATUS qdf_wake_lock_create(qdf_wake_lock_t *lock, const char *name)
{
wakeup_source_init(lock, name);
return QDF_STATUS_SUCCESS;
}
#else
QDF_STATUS qdf_wake_lock_create(qdf_wake_lock_t *lock, const char *name)
{
return QDF_STATUS_SUCCESS;
}
#endif
qdf_export_symbol(qdf_wake_lock_create);

/**
Expand All @@ -287,22 +270,10 @@ qdf_export_symbol(qdf_wake_lock_create);
* QDF status success: if wake lock is acquired
* QDF status failure: if wake lock was not acquired
*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
QDF_STATUS qdf_wake_lock_acquire(qdf_wake_lock_t *lock, uint32_t reason)
{
host_diag_log_wlock(reason, qdf_wake_lock_name(lock),
WIFI_POWER_EVENT_DEFAULT_WAKELOCK_TIMEOUT,
WIFI_POWER_EVENT_WAKELOCK_TAKEN);
__pm_stay_awake(lock);

return QDF_STATUS_SUCCESS;
}
#else
QDF_STATUS qdf_wake_lock_acquire(qdf_wake_lock_t *lock, uint32_t reason)
{
return QDF_STATUS_SUCCESS;
}
#endif
qdf_export_symbol(qdf_wake_lock_acquire);

/**
Expand All @@ -314,27 +285,10 @@ qdf_export_symbol(qdf_wake_lock_acquire);
* QDF status success: if wake lock is acquired
* QDF status failure: if wake lock was not acquired
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
QDF_STATUS qdf_wake_lock_timeout_acquire(qdf_wake_lock_t *lock, uint32_t msec)
{
pm_wakeup_ws_event(lock, msec, true);
return QDF_STATUS_SUCCESS;
}
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
QDF_STATUS qdf_wake_lock_timeout_acquire(qdf_wake_lock_t *lock, uint32_t msec)
{
/* Wakelock for Rx is frequent.
* It is reported only during active debug
*/
__pm_wakeup_event(lock, msec);
return QDF_STATUS_SUCCESS;
}
#else /* LINUX_VERSION_CODE */
QDF_STATUS qdf_wake_lock_timeout_acquire(qdf_wake_lock_t *lock, uint32_t msec)
{
return QDF_STATUS_SUCCESS;
}
#endif /* LINUX_VERSION_CODE */
qdf_export_symbol(qdf_wake_lock_timeout_acquire);

/**
Expand All @@ -346,22 +300,10 @@ qdf_export_symbol(qdf_wake_lock_timeout_acquire);
* QDF status success: if wake lock is acquired
* QDF status failure: if wake lock was not acquired
*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
QDF_STATUS qdf_wake_lock_release(qdf_wake_lock_t *lock, uint32_t reason)
{
host_diag_log_wlock(reason, qdf_wake_lock_name(lock),
WIFI_POWER_EVENT_DEFAULT_WAKELOCK_TIMEOUT,
WIFI_POWER_EVENT_WAKELOCK_RELEASED);
__pm_relax(lock);

return QDF_STATUS_SUCCESS;
}
#else
QDF_STATUS qdf_wake_lock_release(qdf_wake_lock_t *lock, uint32_t reason)
{
return QDF_STATUS_SUCCESS;
}
#endif
qdf_export_symbol(qdf_wake_lock_release);

/**
Expand All @@ -372,18 +314,10 @@ qdf_export_symbol(qdf_wake_lock_release);
* QDF status success: if wake lock is acquired
* QDF status failure: if wake lock was not acquired
*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
QDF_STATUS qdf_wake_lock_destroy(qdf_wake_lock_t *lock)
{
wakeup_source_trash(lock);
return QDF_STATUS_SUCCESS;
}
#else
QDF_STATUS qdf_wake_lock_destroy(qdf_wake_lock_t *lock)
{
return QDF_STATUS_SUCCESS;
}
#endif
qdf_export_symbol(qdf_wake_lock_destroy);

#ifdef CONFIG_MCL
Expand Down

0 comments on commit 522353c

Please sign in to comment.