Skip to content

Commit 7cc5f89

Browse files
committed
wifi: iwlwifi: mld: Revert "wifi: iwlwifi: mld: allow EMLSR with 2.4 GHz when BT is ON"
Due to a hw bug, this feature won't be enabled. Revert its implementation. This reverts commit 37808a3 ("wifi: iwlwifi: mld: allow EMLSR with 2.4 GHz when BT is ON") Reviewed-by: Johannes Berg <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250711183056.57755ac3f39d.I63ae0ee3e6cdc9b11175ad15927aaad3b8f8f47a@changeid
1 parent 0ce92d5 commit 7cc5f89

File tree

4 files changed

+18
-66
lines changed

4 files changed

+18
-66
lines changed

drivers/net/wireless/intel/iwlwifi/mld/coex.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,17 @@ int iwl_mld_send_bt_init_conf(struct iwl_mld *mld)
2424
void iwl_mld_handle_bt_coex_notif(struct iwl_mld *mld,
2525
struct iwl_rx_packet *pkt)
2626
{
27-
const struct iwl_bt_coex_profile_notif *notif = (const void *)pkt->data;
27+
const struct iwl_bt_coex_profile_notif *notif = (void *)pkt->data;
2828
const struct iwl_bt_coex_profile_notif zero_notif = {};
2929
/* zeroed structure means that BT is OFF */
3030
bool bt_is_active = memcmp(notif, &zero_notif, sizeof(*notif));
3131

32-
mld->last_bt_notif = *notif;
32+
if (bt_is_active == mld->bt_is_active)
33+
return;
34+
3335
IWL_DEBUG_INFO(mld, "BT was turned %s\n", bt_is_active ? "ON" : "OFF");
3436

37+
mld->bt_is_active = bt_is_active;
38+
3539
iwl_mld_emlsr_check_bt(mld);
3640
}

drivers/net/wireless/intel/iwlwifi/mld/mld.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
* cleanup using iwl_mld_free_internal_sta
128128
* @netdetect: indicates the FW is in suspend mode with netdetect configured
129129
* @p2p_device_vif: points to the p2p device vif if exists
130+
* @bt_is_active: indicates that BT is active
130131
* @dev: pointer to device struct. For printing purposes
131132
* @trans: pointer to the transport layer
132133
* @cfg: pointer to the device configuration
@@ -189,7 +190,6 @@
189190
* @ptp_data: data of the PTP clock
190191
* @time_sync: time sync data.
191192
* @ftm_initiator: FTM initiator data
192-
* @last_bt_notif: last received BT Coex notif
193193
*/
194194
struct iwl_mld {
195195
/* Add here fields that need clean up on restart */
@@ -214,7 +214,7 @@ struct iwl_mld {
214214
bool netdetect;
215215
#endif /* CONFIG_PM_SLEEP */
216216
struct ieee80211_vif *p2p_device_vif;
217-
struct iwl_bt_coex_profile_notif last_bt_notif;
217+
bool bt_is_active;
218218
);
219219
struct ieee80211_link_sta __rcu *fw_id_to_link_sta[IWL_STATION_COUNT_MAX];
220220
/* And here fields that survive a fw restart */

drivers/net/wireless/intel/iwlwifi/mld/mlo.c

Lines changed: 10 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -689,40 +689,6 @@ s8 iwl_mld_get_emlsr_rssi_thresh(struct iwl_mld *mld,
689689
#undef RSSI_THRESHOLD
690690
}
691691

692-
#define IWL_MLD_BT_COEX_DISABLE_EMLSR_RSSI_THRESH -69
693-
#define IWL_MLD_BT_COEX_ENABLE_EMLSR_RSSI_THRESH -63
694-
#define IWL_MLD_BT_COEX_WIFI_LOSS_THRESH 7
695-
696-
static bool
697-
iwl_mld_bt_allows_emlsr(struct iwl_mld *mld, struct ieee80211_bss_conf *link,
698-
bool check_entry)
699-
{
700-
int bt_penalty, rssi_thresh;
701-
s32 link_rssi;
702-
703-
if (WARN_ON_ONCE(!link->bss))
704-
return false;
705-
706-
link_rssi = MBM_TO_DBM(link->bss->signal);
707-
rssi_thresh = check_entry ?
708-
IWL_MLD_BT_COEX_ENABLE_EMLSR_RSSI_THRESH :
709-
IWL_MLD_BT_COEX_DISABLE_EMLSR_RSSI_THRESH;
710-
/* No valid RSSI - force to take low rssi */
711-
if (!link_rssi)
712-
link_rssi = rssi_thresh - 1;
713-
714-
if (link_rssi > rssi_thresh)
715-
bt_penalty = max(mld->last_bt_notif.wifi_loss_mid_high_rssi[PHY_BAND_24][0],
716-
mld->last_bt_notif.wifi_loss_mid_high_rssi[PHY_BAND_24][1]);
717-
else
718-
bt_penalty = max(mld->last_bt_notif.wifi_loss_low_rssi[PHY_BAND_24][0],
719-
mld->last_bt_notif.wifi_loss_low_rssi[PHY_BAND_24][1]);
720-
721-
IWL_DEBUG_EHT(mld, "BT penalty for link-id %0X is %d\n",
722-
link->link_id, bt_penalty);
723-
return bt_penalty < IWL_MLD_BT_COEX_WIFI_LOSS_THRESH;
724-
}
725-
726692
static u32
727693
iwl_mld_emlsr_disallowed_with_link(struct iwl_mld *mld,
728694
struct ieee80211_vif *vif,
@@ -737,8 +703,7 @@ iwl_mld_emlsr_disallowed_with_link(struct iwl_mld *mld,
737703
if (WARN_ON_ONCE(!conf))
738704
return IWL_MLD_EMLSR_EXIT_INVALID;
739705

740-
if (link->chandef->chan->band == NL80211_BAND_2GHZ &&
741-
!iwl_mld_bt_allows_emlsr(mld, conf, true))
706+
if (link->chandef->chan->band == NL80211_BAND_2GHZ && mld->bt_is_active)
742707
ret |= IWL_MLD_EMLSR_EXIT_BT_COEX;
743708

744709
if (link->signal <
@@ -1076,41 +1041,30 @@ static void iwl_mld_emlsr_check_bt_iter(void *_data, u8 *mac,
10761041
struct ieee80211_vif *vif)
10771042
{
10781043
struct iwl_mld_vif *mld_vif = iwl_mld_vif_from_mac80211(vif);
1079-
const struct iwl_bt_coex_profile_notif zero_notif = {};
10801044
struct iwl_mld *mld = mld_vif->mld;
10811045
struct ieee80211_bss_conf *link;
10821046
unsigned int link_id;
1083-
const struct iwl_bt_coex_profile_notif *notif = &mld->last_bt_notif;
10841047

10851048
if (!iwl_mld_vif_has_emlsr_cap(vif))
10861049
return;
10871050

1088-
/* zeroed structure means that BT is OFF */
1089-
if (!memcmp(notif, &zero_notif, sizeof(*notif))) {
1051+
if (!mld->bt_is_active) {
10901052
iwl_mld_retry_emlsr(mld, vif);
10911053
return;
10921054
}
10931055

1094-
for_each_vif_active_link(vif, link, link_id) {
1095-
bool emlsr_active, emlsr_allowed;
1056+
/* BT is turned ON but we are not in EMLSR, nothing to do */
1057+
if (!iwl_mld_emlsr_active(vif))
1058+
return;
10961059

1097-
if (WARN_ON(!link->chanreq.oper.chan))
1098-
continue;
1060+
/* In EMLSR and BT is turned ON */
10991061

1100-
if (link->chanreq.oper.chan->band != NL80211_BAND_2GHZ)
1062+
for_each_vif_active_link(vif, link, link_id) {
1063+
if (WARN_ON(!link->chanreq.oper.chan))
11011064
continue;
11021065

1103-
emlsr_active = iwl_mld_emlsr_active(vif);
1104-
emlsr_allowed = iwl_mld_bt_allows_emlsr(mld, link,
1105-
!emlsr_active);
1106-
if (emlsr_allowed && !emlsr_active) {
1107-
iwl_mld_retry_emlsr(mld, vif);
1108-
return;
1109-
}
1110-
1111-
if (!emlsr_allowed && emlsr_active) {
1112-
iwl_mld_exit_emlsr(mld, vif,
1113-
IWL_MLD_EMLSR_EXIT_BT_COEX,
1066+
if (link->chanreq.oper.chan->band == NL80211_BAND_2GHZ) {
1067+
iwl_mld_exit_emlsr(mld, vif, IWL_MLD_EMLSR_EXIT_BT_COEX,
11141068
iwl_mld_get_primary_link(vif));
11151069
return;
11161070
}

drivers/net/wireless/intel/iwlwifi/mld/tests/link-selection.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ static void test_iwl_mld_link_pair_allows_emlsr(struct kunit *test)
287287
const struct link_pair_case *params = test->param_value;
288288
struct iwl_mld *mld = test->priv;
289289
struct ieee80211_vif *vif;
290-
struct ieee80211_bss_conf *link;
291290
/* link A is the primary and link B is the secondary */
292291
struct iwl_mld_link_sel_data a = {
293292
.chandef = params->chandef_a,
@@ -311,11 +310,6 @@ static void test_iwl_mld_link_pair_allows_emlsr(struct kunit *test)
311310

312311
wiphy_lock(mld->wiphy);
313312

314-
link = wiphy_dereference(mld->wiphy, vif->link_conf[a.link_id]);
315-
KUNIT_ALLOC_AND_ASSERT(test, link->bss);
316-
link = wiphy_dereference(mld->wiphy, vif->link_conf[b.link_id]);
317-
KUNIT_ALLOC_AND_ASSERT(test, link->bss);
318-
319313
/* Simulate channel load */
320314
if (params->primary_link_active) {
321315
struct iwl_mld_phy *phy =

0 commit comments

Comments
 (0)