qcacld-3.0: Release TDLS wakelock upon peer teardown
Currently TDLS module acquires WIFI_POWER_EVENT_WAKELOCK_TDLS wakelock and prevents run time suspend when TDLS is enabled for a peer. While releasing the wakelock and allowing suspend, it checks for the connected peer count in tdls_update_pmo_status(). But the peer count is not decremented here yet. Below is the current call sequence: tdls_disable_offchan_and_teardown_links() -> 1. Call tdls_reset_peer() -> this calls tdls_set_peer_link_status() -> tdls_update_pmo_status() -> 2. tdls_decrement_peer_count() - Sets the connected peer count to 0 Update the sequence as below: call tdls_decrement_peer_count() first and then call tdls_reset_peer(). CRs-Fixed: 3735021 Change-Id: Idf91a0c96c9660df466143f8ac115f694b3070d2
This commit is contained in:

کامیت شده توسط
Ravindra Konda

والد
48b67ca706
کامیت
1b03ebf40c
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
|
||||||
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -665,10 +665,11 @@ void tdls_indicate_teardown(struct tdls_vdev_priv_obj *tdls_vdev,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tdls_set_peer_link_status(curr_peer,
|
tdls_set_peer_link_status(curr_peer, TDLS_LINK_TEARING,
|
||||||
TDLS_LINK_TEARING,
|
|
||||||
TDLS_LINK_UNSPECIFIED);
|
TDLS_LINK_UNSPECIFIED);
|
||||||
tdls_notice("Teardown reason %d", reason);
|
tdls_notice("vdev:%d Teardown reason %d peer:" QDF_MAC_ADDR_FMT,
|
||||||
|
wlan_vdev_get_id(tdls_vdev->vdev), reason,
|
||||||
|
QDF_MAC_ADDR_REF(curr_peer->peer_mac.bytes));
|
||||||
|
|
||||||
if (tdls_soc->tdls_dp_vdev_update)
|
if (tdls_soc->tdls_dp_vdev_update)
|
||||||
tdls_soc->tdls_dp_vdev_update(
|
tdls_soc->tdls_dp_vdev_update(
|
||||||
@@ -1561,13 +1562,14 @@ void tdls_disable_offchan_and_teardown_links(
|
|||||||
tdls_indicate_teardown(tdls_vdev, curr_peer,
|
tdls_indicate_teardown(tdls_vdev, curr_peer,
|
||||||
TDLS_TEARDOWN_PEER_UNSPEC_REASON);
|
TDLS_TEARDOWN_PEER_UNSPEC_REASON);
|
||||||
|
|
||||||
|
tdls_decrement_peer_count(vdev, tdls_soc);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Del Sta happened already as part of tdls_delete_all_tdls_peers
|
* Del Sta happened already as part of tdls_delete_all_tdls_peers
|
||||||
* Hence clear tdls vdev data structure.
|
* Hence clear tdls vdev data structure.
|
||||||
*/
|
*/
|
||||||
tdls_reset_peer(tdls_vdev, curr_peer->peer_mac.bytes);
|
tdls_reset_peer(tdls_vdev, curr_peer->peer_mac.bytes);
|
||||||
|
|
||||||
tdls_decrement_peer_count(vdev, tdls_soc);
|
|
||||||
tdls_soc->tdls_conn_info[staidx].valid_entry = false;
|
tdls_soc->tdls_conn_info[staidx].valid_entry = false;
|
||||||
tdls_soc->tdls_conn_info[staidx].session_id = 255;
|
tdls_soc->tdls_conn_info[staidx].session_id = 255;
|
||||||
tdls_soc->tdls_conn_info[staidx].index =
|
tdls_soc->tdls_conn_info[staidx].index =
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
|
||||||
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -759,6 +759,7 @@ static void tdls_prevent_suspend(struct tdls_soc_priv_obj *tdls_soc)
|
|||||||
WIFI_POWER_EVENT_WAKELOCK_TDLS);
|
WIFI_POWER_EVENT_WAKELOCK_TDLS);
|
||||||
qdf_runtime_pm_prevent_suspend(&tdls_soc->runtime_lock);
|
qdf_runtime_pm_prevent_suspend(&tdls_soc->runtime_lock);
|
||||||
tdls_soc->is_prevent_suspend = true;
|
tdls_soc->is_prevent_suspend = true;
|
||||||
|
tdls_debug("Acquire WIFI_POWER_EVENT_WAKELOCK_TDLS");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -778,6 +779,7 @@ static void tdls_allow_suspend(struct tdls_soc_priv_obj *tdls_soc)
|
|||||||
WIFI_POWER_EVENT_WAKELOCK_TDLS);
|
WIFI_POWER_EVENT_WAKELOCK_TDLS);
|
||||||
qdf_runtime_pm_allow_suspend(&tdls_soc->runtime_lock);
|
qdf_runtime_pm_allow_suspend(&tdls_soc->runtime_lock);
|
||||||
tdls_soc->is_prevent_suspend = false;
|
tdls_soc->is_prevent_suspend = false;
|
||||||
|
tdls_debug("Release WIFI_POWER_EVENT_WAKELOCK_TDLS");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -865,6 +867,21 @@ void tdls_set_link_status(struct tdls_vdev_priv_obj *vdev_obj,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline char *
|
||||||
|
tdls_link_status_str(enum tdls_link_state link_status)
|
||||||
|
{
|
||||||
|
switch (link_status) {
|
||||||
|
CASE_RETURN_STRING(TDLS_LINK_IDLE);
|
||||||
|
CASE_RETURN_STRING(TDLS_LINK_DISCOVERING);
|
||||||
|
CASE_RETURN_STRING(TDLS_LINK_DISCOVERED);
|
||||||
|
CASE_RETURN_STRING(TDLS_LINK_CONNECTING);
|
||||||
|
CASE_RETURN_STRING(TDLS_LINK_CONNECTED);
|
||||||
|
CASE_RETURN_STRING(TDLS_LINK_TEARING);
|
||||||
|
default:
|
||||||
|
return "UNKNOWN";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void tdls_set_peer_link_status(struct tdls_peer *peer,
|
void tdls_set_peer_link_status(struct tdls_peer *peer,
|
||||||
enum tdls_link_state link_status,
|
enum tdls_link_state link_status,
|
||||||
enum tdls_link_state_reason link_reason)
|
enum tdls_link_state_reason link_reason)
|
||||||
@@ -878,12 +895,14 @@ void tdls_set_peer_link_status(struct tdls_peer *peer,
|
|||||||
enum tdls_link_state old_status;
|
enum tdls_link_state old_status;
|
||||||
|
|
||||||
vdev_obj = peer->vdev_priv;
|
vdev_obj = peer->vdev_priv;
|
||||||
tdls_debug("vdev %d state %d reason %d peer:" QDF_MAC_ADDR_FMT,
|
|
||||||
wlan_vdev_get_id(vdev_obj->vdev), link_status, link_reason,
|
|
||||||
QDF_MAC_ADDR_REF(peer->peer_mac.bytes));
|
|
||||||
|
|
||||||
old_status = peer->link_status;
|
old_status = peer->link_status;
|
||||||
peer->link_status = link_status;
|
peer->link_status = link_status;
|
||||||
|
tdls_debug("vdev:%d new state: %s old state:%s reason %d peer:" QDF_MAC_ADDR_FMT,
|
||||||
|
wlan_vdev_get_id(vdev_obj->vdev),
|
||||||
|
tdls_link_status_str(link_status),
|
||||||
|
tdls_link_status_str(old_status), link_reason,
|
||||||
|
QDF_MAC_ADDR_REF(peer->peer_mac.bytes));
|
||||||
tdls_update_pmo_status(vdev_obj, old_status, link_status);
|
tdls_update_pmo_status(vdev_obj, old_status, link_status);
|
||||||
|
|
||||||
if (link_status >= TDLS_LINK_DISCOVERED)
|
if (link_status >= TDLS_LINK_DISCOVERED)
|
||||||
|
مرجع در شماره جدید
Block a user