Skip to content

Commit 49fcf34

Browse files
committed
Merge tag 'wireless-2023-12-19' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless
Johannes Berg says: ==================== Just a couple of things: * debugfs fixes * rfkill fix in iwlwifi * remove mostly-not-working list ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 0ee2384 + 0a3d898 commit 49fcf34

File tree

6 files changed

+30
-23
lines changed

6 files changed

+30
-23
lines changed

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4127,7 +4127,6 @@ M: Franky Lin <franky.lin@broadcom.com>
41274127
M: Hante Meuleman <hante.meuleman@broadcom.com>
41284128
L: linux-wireless@vger.kernel.org
41294129
L: brcm80211-dev-list.pdl@broadcom.com
4130-
L: SHA-cyfmac-dev-list@infineon.com
41314130
S: Supported
41324131
F: drivers/net/wireless/broadcom/brcm80211/
41334132

drivers/net/wireless/intel/iwlwifi/pcie/internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ static inline void iwl_enable_rfkill_int(struct iwl_trans *trans)
770770
}
771771
}
772772

773-
void iwl_pcie_handle_rfkill_irq(struct iwl_trans *trans);
773+
void iwl_pcie_handle_rfkill_irq(struct iwl_trans *trans, bool from_irq);
774774

775775
static inline bool iwl_is_rfkill_set(struct iwl_trans *trans)
776776
{
@@ -817,7 +817,7 @@ static inline bool iwl_pcie_dbg_on(struct iwl_trans *trans)
817817
return (trans->dbg.dest_tlv || iwl_trans_dbg_ini_valid(trans));
818818
}
819819

820-
void iwl_trans_pcie_rf_kill(struct iwl_trans *trans, bool state);
820+
void iwl_trans_pcie_rf_kill(struct iwl_trans *trans, bool state, bool from_irq);
821821
void iwl_trans_pcie_dump_regs(struct iwl_trans *trans);
822822

823823
#ifdef CONFIG_IWLWIFI_DEBUGFS

drivers/net/wireless/intel/iwlwifi/pcie/rx.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,7 +1783,7 @@ static u32 iwl_pcie_int_cause_ict(struct iwl_trans *trans)
17831783
return inta;
17841784
}
17851785

1786-
void iwl_pcie_handle_rfkill_irq(struct iwl_trans *trans)
1786+
void iwl_pcie_handle_rfkill_irq(struct iwl_trans *trans, bool from_irq)
17871787
{
17881788
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
17891789
struct isr_statistics *isr_stats = &trans_pcie->isr_stats;
@@ -1807,7 +1807,7 @@ void iwl_pcie_handle_rfkill_irq(struct iwl_trans *trans)
18071807
isr_stats->rfkill++;
18081808

18091809
if (prev != report)
1810-
iwl_trans_pcie_rf_kill(trans, report);
1810+
iwl_trans_pcie_rf_kill(trans, report, from_irq);
18111811
mutex_unlock(&trans_pcie->mutex);
18121812

18131813
if (hw_rfkill) {
@@ -1947,7 +1947,7 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id)
19471947

19481948
/* HW RF KILL switch toggled */
19491949
if (inta & CSR_INT_BIT_RF_KILL) {
1950-
iwl_pcie_handle_rfkill_irq(trans);
1950+
iwl_pcie_handle_rfkill_irq(trans, true);
19511951
handled |= CSR_INT_BIT_RF_KILL;
19521952
}
19531953

@@ -2370,7 +2370,7 @@ irqreturn_t iwl_pcie_irq_msix_handler(int irq, void *dev_id)
23702370

23712371
/* HW RF KILL switch toggled */
23722372
if (inta_hw & MSIX_HW_INT_CAUSES_REG_RF_KILL)
2373-
iwl_pcie_handle_rfkill_irq(trans);
2373+
iwl_pcie_handle_rfkill_irq(trans, true);
23742374

23752375
if (inta_hw & MSIX_HW_INT_CAUSES_REG_HW_ERR) {
23762376
IWL_ERR(trans,

drivers/net/wireless/intel/iwlwifi/pcie/trans.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ bool iwl_pcie_check_hw_rf_kill(struct iwl_trans *trans)
10821082
report = test_bit(STATUS_RFKILL_OPMODE, &trans->status);
10831083

10841084
if (prev != report)
1085-
iwl_trans_pcie_rf_kill(trans, report);
1085+
iwl_trans_pcie_rf_kill(trans, report, false);
10861086

10871087
return hw_rfkill;
10881088
}
@@ -1237,7 +1237,7 @@ static void iwl_pcie_init_msix(struct iwl_trans_pcie *trans_pcie)
12371237
trans_pcie->hw_mask = trans_pcie->hw_init_mask;
12381238
}
12391239

1240-
static void _iwl_trans_pcie_stop_device(struct iwl_trans *trans)
1240+
static void _iwl_trans_pcie_stop_device(struct iwl_trans *trans, bool from_irq)
12411241
{
12421242
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
12431243

@@ -1264,7 +1264,8 @@ static void _iwl_trans_pcie_stop_device(struct iwl_trans *trans)
12641264
if (test_and_clear_bit(STATUS_DEVICE_ENABLED, &trans->status)) {
12651265
IWL_DEBUG_INFO(trans,
12661266
"DEVICE_ENABLED bit was set and is now cleared\n");
1267-
iwl_pcie_synchronize_irqs(trans);
1267+
if (!from_irq)
1268+
iwl_pcie_synchronize_irqs(trans);
12681269
iwl_pcie_rx_napi_sync(trans);
12691270
iwl_pcie_tx_stop(trans);
12701271
iwl_pcie_rx_stop(trans);
@@ -1454,7 +1455,7 @@ void iwl_trans_pcie_handle_stop_rfkill(struct iwl_trans *trans,
14541455
clear_bit(STATUS_RFKILL_OPMODE, &trans->status);
14551456
}
14561457
if (hw_rfkill != was_in_rfkill)
1457-
iwl_trans_pcie_rf_kill(trans, hw_rfkill);
1458+
iwl_trans_pcie_rf_kill(trans, hw_rfkill, false);
14581459
}
14591460

14601461
static void iwl_trans_pcie_stop_device(struct iwl_trans *trans)
@@ -1469,12 +1470,12 @@ static void iwl_trans_pcie_stop_device(struct iwl_trans *trans)
14691470
mutex_lock(&trans_pcie->mutex);
14701471
trans_pcie->opmode_down = true;
14711472
was_in_rfkill = test_bit(STATUS_RFKILL_OPMODE, &trans->status);
1472-
_iwl_trans_pcie_stop_device(trans);
1473+
_iwl_trans_pcie_stop_device(trans, false);
14731474
iwl_trans_pcie_handle_stop_rfkill(trans, was_in_rfkill);
14741475
mutex_unlock(&trans_pcie->mutex);
14751476
}
14761477

1477-
void iwl_trans_pcie_rf_kill(struct iwl_trans *trans, bool state)
1478+
void iwl_trans_pcie_rf_kill(struct iwl_trans *trans, bool state, bool from_irq)
14781479
{
14791480
struct iwl_trans_pcie __maybe_unused *trans_pcie =
14801481
IWL_TRANS_GET_PCIE_TRANS(trans);
@@ -1487,7 +1488,7 @@ void iwl_trans_pcie_rf_kill(struct iwl_trans *trans, bool state)
14871488
if (trans->trans_cfg->gen2)
14881489
_iwl_trans_pcie_gen2_stop_device(trans);
14891490
else
1490-
_iwl_trans_pcie_stop_device(trans);
1491+
_iwl_trans_pcie_stop_device(trans, from_irq);
14911492
}
14921493
}
14931494

@@ -2887,7 +2888,7 @@ static ssize_t iwl_dbgfs_rfkill_write(struct file *file,
28872888
IWL_WARN(trans, "changing debug rfkill %d->%d\n",
28882889
trans_pcie->debug_rfkill, new_value);
28892890
trans_pcie->debug_rfkill = new_value;
2890-
iwl_pcie_handle_rfkill_irq(trans);
2891+
iwl_pcie_handle_rfkill_irq(trans, false);
28912892

28922893
return count;
28932894
}

net/mac80211/debugfs_netdev.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,9 +1043,12 @@ void ieee80211_debugfs_recreate_netdev(struct ieee80211_sub_if_data *sdata,
10431043
{
10441044
ieee80211_debugfs_remove_netdev(sdata);
10451045
ieee80211_debugfs_add_netdev(sdata, mld_vif);
1046-
drv_vif_add_debugfs(sdata->local, sdata);
1047-
if (!mld_vif)
1048-
ieee80211_link_debugfs_drv_add(&sdata->deflink);
1046+
1047+
if (sdata->flags & IEEE80211_SDATA_IN_DRIVER) {
1048+
drv_vif_add_debugfs(sdata->local, sdata);
1049+
if (!mld_vif)
1050+
ieee80211_link_debugfs_drv_add(&sdata->deflink);
1051+
}
10491052
}
10501053

10511054
void ieee80211_link_debugfs_add(struct ieee80211_link_data *link)

net/mac80211/driver-ops.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ int drv_add_interface(struct ieee80211_local *local,
7575
if (ret)
7676
return ret;
7777

78-
sdata->flags |= IEEE80211_SDATA_IN_DRIVER;
78+
if (!(sdata->flags & IEEE80211_SDATA_IN_DRIVER)) {
79+
sdata->flags |= IEEE80211_SDATA_IN_DRIVER;
7980

80-
if (!local->in_reconfig) {
8181
drv_vif_add_debugfs(local, sdata);
8282
/* initially vif is not MLD */
8383
ieee80211_link_debugfs_drv_add(&sdata->deflink);
@@ -113,9 +113,13 @@ void drv_remove_interface(struct ieee80211_local *local,
113113
if (!check_sdata_in_driver(sdata))
114114
return;
115115

116+
sdata->flags &= ~IEEE80211_SDATA_IN_DRIVER;
117+
118+
/* Remove driver debugfs entries */
119+
ieee80211_debugfs_recreate_netdev(sdata, sdata->vif.valid_links);
120+
116121
trace_drv_remove_interface(local, sdata);
117122
local->ops->remove_interface(&local->hw, &sdata->vif);
118-
sdata->flags &= ~IEEE80211_SDATA_IN_DRIVER;
119123
trace_drv_return_void(local);
120124
}
121125

@@ -534,7 +538,7 @@ int drv_change_vif_links(struct ieee80211_local *local,
534538
if (ret)
535539
return ret;
536540

537-
if (!local->in_reconfig) {
541+
if (!local->in_reconfig && !local->resuming) {
538542
for_each_set_bit(link_id, &links_to_add,
539543
IEEE80211_MLD_MAX_NUM_LINKS) {
540544
link = rcu_access_pointer(sdata->link[link_id]);
@@ -590,7 +594,7 @@ int drv_change_sta_links(struct ieee80211_local *local,
590594
return ret;
591595

592596
/* during reconfig don't add it to debugfs again */
593-
if (local->in_reconfig)
597+
if (local->in_reconfig || local->resuming)
594598
return 0;
595599

596600
for_each_set_bit(link_id, &links_to_add, IEEE80211_MLD_MAX_NUM_LINKS) {

0 commit comments

Comments
 (0)