Skip to content

Commit e31a821

Browse files
committed
Merge tag 'wireless-2024-10-21' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless
wireless fixes for v6.12-rc5 The first set of wireless fixes for v6.12. We have been busy and have not been able to send this earlier, so there are more fixes than usual. The fixes are all over, both in stack and in drivers, but nothing special really standing out.
2 parents d44cd82 + a940b3a commit e31a821

File tree

26 files changed

+225
-75
lines changed

26 files changed

+225
-75
lines changed

drivers/net/wireless/ath/ath10k/wmi-tlv.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3043,9 +3043,14 @@ ath10k_wmi_tlv_op_cleanup_mgmt_tx_send(struct ath10k *ar,
30433043
struct sk_buff *msdu)
30443044
{
30453045
struct ath10k_skb_cb *cb = ATH10K_SKB_CB(msdu);
3046+
struct ath10k_mgmt_tx_pkt_addr *pkt_addr;
30463047
struct ath10k_wmi *wmi = &ar->wmi;
30473048

3048-
idr_remove(&wmi->mgmt_pending_tx, cb->msdu_id);
3049+
spin_lock_bh(&ar->data_lock);
3050+
pkt_addr = idr_remove(&wmi->mgmt_pending_tx, cb->msdu_id);
3051+
spin_unlock_bh(&ar->data_lock);
3052+
3053+
kfree(pkt_addr);
30493054

30503055
return 0;
30513056
}

drivers/net/wireless/ath/ath10k/wmi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2441,6 +2441,7 @@ wmi_process_mgmt_tx_comp(struct ath10k *ar, struct mgmt_tx_compl_params *param)
24412441
dma_unmap_single(ar->dev, pkt_addr->paddr,
24422442
msdu->len, DMA_TO_DEVICE);
24432443
info = IEEE80211_SKB_CB(msdu);
2444+
kfree(pkt_addr);
24442445

24452446
if (param->status) {
24462447
info->flags &= ~IEEE80211_TX_STAT_ACK;
@@ -9612,6 +9613,7 @@ static int ath10k_wmi_mgmt_tx_clean_up_pending(int msdu_id, void *ptr,
96129613
dma_unmap_single(ar->dev, pkt_addr->paddr,
96139614
msdu->len, DMA_TO_DEVICE);
96149615
ieee80211_free_txskb(ar->hw, msdu);
9616+
kfree(pkt_addr);
96159617

96169618
return 0;
96179619
}

drivers/net/wireless/ath/ath11k/dp_rx.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5291,8 +5291,11 @@ int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id,
52915291
hal_status == HAL_TLV_STATUS_PPDU_DONE) {
52925292
rx_mon_stats->status_ppdu_done++;
52935293
pmon->mon_ppdu_status = DP_PPDU_STATUS_DONE;
5294-
ath11k_dp_rx_mon_dest_process(ar, mac_id, budget, napi);
5295-
pmon->mon_ppdu_status = DP_PPDU_STATUS_START;
5294+
if (!ab->hw_params.full_monitor_mode) {
5295+
ath11k_dp_rx_mon_dest_process(ar, mac_id,
5296+
budget, napi);
5297+
pmon->mon_ppdu_status = DP_PPDU_STATUS_START;
5298+
}
52965299
}
52975300

52985301
if (ppdu_info->peer_id == HAL_INVALID_PEERID ||

drivers/net/wireless/ath/wil6210/txrx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ static void wil_rx_add_radiotap_header(struct wil6210_priv *wil,
306306
struct sk_buff *skb)
307307
{
308308
struct wil6210_rtap {
309-
struct ieee80211_radiotap_header rthdr;
309+
struct ieee80211_radiotap_header_fixed rthdr;
310310
/* fields should be in the order of bits in rthdr.it_present */
311311
/* flags */
312312
u8 flags;

drivers/net/wireless/broadcom/brcm80211/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ source "drivers/net/wireless/broadcom/brcm80211/brcmfmac/Kconfig"
2727
config BRCM_TRACING
2828
bool "Broadcom device tracing"
2929
depends on BRCMSMAC || BRCMFMAC
30+
depends on TRACING
3031
help
3132
If you say Y here, the Broadcom wireless drivers will register
3233
with ftrace to dump event information into the trace ringbuffer.

drivers/net/wireless/intel/ipw2x00/ipw2100.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2518,7 +2518,7 @@ static void isr_rx_monitor(struct ipw2100_priv *priv, int i,
25182518
* to build this manually element by element, we can write it much
25192519
* more efficiently than we can parse it. ORDER MATTERS HERE */
25202520
struct ipw_rt_hdr {
2521-
struct ieee80211_radiotap_header rt_hdr;
2521+
struct ieee80211_radiotap_header_fixed rt_hdr;
25222522
s8 rt_dbmsignal; /* signal in dbM, kluged to signed */
25232523
} *ipw_rt;
25242524

drivers/net/wireless/intel/ipw2x00/ipw2200.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ struct ipw_prom_priv {
11431143
* structure is provided regardless of any bits unset.
11441144
*/
11451145
struct ipw_rt_hdr {
1146-
struct ieee80211_radiotap_header rt_hdr;
1146+
struct ieee80211_radiotap_header_fixed rt_hdr;
11471147
u64 rt_tsf; /* TSF */ /* XXX */
11481148
u8 rt_flags; /* radiotap packet flags */
11491149
u8 rt_rate; /* rate in 500kb/s */

drivers/net/wireless/intel/iwlegacy/common.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3122,6 +3122,7 @@ il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd)
31223122
struct il_cmd_meta *out_meta;
31233123
dma_addr_t phys_addr;
31243124
unsigned long flags;
3125+
u8 *out_payload;
31253126
u32 idx;
31263127
u16 fix_size;
31273128

@@ -3157,6 +3158,16 @@ il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd)
31573158
out_cmd = txq->cmd[idx];
31583159
out_meta = &txq->meta[idx];
31593160

3161+
/* The payload is in the same place in regular and huge
3162+
* command buffers, but we need to let the compiler know when
3163+
* we're using a larger payload buffer to avoid "field-
3164+
* spanning write" warnings at run-time for huge commands.
3165+
*/
3166+
if (cmd->flags & CMD_SIZE_HUGE)
3167+
out_payload = ((struct il_device_cmd_huge *)out_cmd)->cmd.payload;
3168+
else
3169+
out_payload = out_cmd->cmd.payload;
3170+
31603171
if (WARN_ON(out_meta->flags & CMD_MAPPED)) {
31613172
spin_unlock_irqrestore(&il->hcmd_lock, flags);
31623173
return -ENOSPC;
@@ -3170,7 +3181,7 @@ il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd)
31703181
out_meta->callback = cmd->callback;
31713182

31723183
out_cmd->hdr.cmd = cmd->id;
3173-
memcpy(&out_cmd->cmd.payload, cmd->data, cmd->len);
3184+
memcpy(out_payload, cmd->data, cmd->len);
31743185

31753186
/* At this point, the out_cmd now has all of the incoming cmd
31763187
* information */
@@ -4962,6 +4973,8 @@ il_pci_resume(struct device *device)
49624973
*/
49634974
pci_write_config_byte(pdev, PCI_CFG_RETRY_TIMEOUT, 0x00);
49644975

4976+
_il_wr(il, CSR_INT, 0xffffffff);
4977+
_il_wr(il, CSR_FH_INT_STATUS, 0xffffffff);
49654978
il_enable_interrupts(il);
49664979

49674980
if (!(_il_rd(il, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW))

drivers/net/wireless/intel/iwlegacy/common.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,18 @@ struct il_device_cmd {
560560

561561
#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct il_device_cmd))
562562

563+
/**
564+
* struct il_device_cmd_huge
565+
*
566+
* For use when sending huge commands.
567+
*/
568+
struct il_device_cmd_huge {
569+
struct il_cmd_header hdr; /* uCode API */
570+
union {
571+
u8 payload[IL_MAX_CMD_SIZE - sizeof(struct il_cmd_header)];
572+
} __packed cmd;
573+
} __packed;
574+
563575
struct il_host_cmd {
564576
const void *data;
565577
unsigned long reply_page;

drivers/net/wireless/marvell/libertas/radiotap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <net/ieee80211_radiotap.h>
33

44
struct tx_radiotap_hdr {
5-
struct ieee80211_radiotap_header hdr;
5+
struct ieee80211_radiotap_header_fixed hdr;
66
u8 rate;
77
u8 txpower;
88
u8 rts_retries;
@@ -31,7 +31,7 @@ struct tx_radiotap_hdr {
3131
#define IEEE80211_FC_DSTODS 0x0300
3232

3333
struct rx_radiotap_hdr {
34-
struct ieee80211_radiotap_header hdr;
34+
struct ieee80211_radiotap_header_fixed hdr;
3535
u8 flags;
3636
u8 rate;
3737
u8 antsignal;

drivers/net/wireless/mediatek/mt76/mcu.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,16 @@ int mt76_mcu_skb_send_and_get_msg(struct mt76_dev *dev, struct sk_buff *skb,
8484
mutex_lock(&dev->mcu.mutex);
8585

8686
if (dev->mcu_ops->mcu_skb_prepare_msg) {
87+
orig_skb = skb;
8788
ret = dev->mcu_ops->mcu_skb_prepare_msg(dev, skb, cmd, &seq);
8889
if (ret < 0)
8990
goto out;
9091
}
9192

9293
retry:
93-
orig_skb = skb_get(skb);
94+
/* orig skb might be needed for retry, mcu_skb_send_msg consumes it */
95+
if (orig_skb)
96+
skb_get(orig_skb);
9497
ret = dev->mcu_ops->mcu_skb_send_msg(dev, skb, cmd, &seq);
9598
if (ret < 0)
9699
goto out;
@@ -105,7 +108,7 @@ int mt76_mcu_skb_send_and_get_msg(struct mt76_dev *dev, struct sk_buff *skb,
105108
do {
106109
skb = mt76_mcu_get_response(dev, expires);
107110
if (!skb && !test_bit(MT76_MCU_RESET, &dev->phy.state) &&
108-
retry++ < dev->mcu_ops->max_retry) {
111+
orig_skb && retry++ < dev->mcu_ops->max_retry) {
109112
dev_err(dev->dev, "Retry message %08x (seq %d)\n",
110113
cmd, seq);
111114
skb = orig_skb;

drivers/net/wireless/microchip/wilc1000/mon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
#include "cfg80211.h"
88

99
struct wilc_wfi_radiotap_hdr {
10-
struct ieee80211_radiotap_header hdr;
10+
struct ieee80211_radiotap_header_fixed hdr;
1111
u8 rate;
1212
} __packed;
1313

1414
struct wilc_wfi_radiotap_cb_hdr {
15-
struct ieee80211_radiotap_header hdr;
15+
struct ieee80211_radiotap_header_fixed hdr;
1616
u8 rate;
1717
u8 dump;
1818
u16 tx_flags;

drivers/net/wireless/realtek/rtlwifi/rtl8192du/sw.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,6 @@ static const struct usb_device_id rtl8192d_usb_ids[] = {
352352
{RTL_USB_DEVICE(USB_VENDOR_ID_REALTEK, 0x8194, rtl92du_hal_cfg)},
353353
{RTL_USB_DEVICE(USB_VENDOR_ID_REALTEK, 0x8111, rtl92du_hal_cfg)},
354354
{RTL_USB_DEVICE(USB_VENDOR_ID_REALTEK, 0x0193, rtl92du_hal_cfg)},
355-
{RTL_USB_DEVICE(USB_VENDOR_ID_REALTEK, 0x8171, rtl92du_hal_cfg)},
356355
{RTL_USB_DEVICE(USB_VENDOR_ID_REALTEK, 0xe194, rtl92du_hal_cfg)},
357356
{RTL_USB_DEVICE(0x2019, 0xab2c, rtl92du_hal_cfg)},
358357
{RTL_USB_DEVICE(0x2019, 0xab2d, rtl92du_hal_cfg)},

drivers/net/wireless/realtek/rtw88/usb.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,6 @@ static void rtw_usb_dynamic_rx_agg_v1(struct rtw_dev *rtwdev, bool enable)
771771
u8 size, timeout;
772772
u16 val16;
773773

774-
rtw_write32_set(rtwdev, REG_RXDMA_AGG_PG_TH, BIT_EN_PRE_CALC);
775774
rtw_write8_set(rtwdev, REG_TXDMA_PQ_MAP, BIT_RXDMA_AGG_EN);
776775
rtw_write8_clr(rtwdev, REG_RXDMA_AGG_PG_TH + 3, BIT(7));
777776

drivers/net/wireless/realtek/rtw89/coex.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6445,6 +6445,8 @@ static void _update_wl_info_v7(struct rtw89_dev *rtwdev, u8 rid)
64456445

64466446
/* todo DBCC related event */
64476447
rtw89_debug(rtwdev, RTW89_DBG_BTC, "[BTC] wl_info phy_now=%d\n", phy_now);
6448+
rtw89_debug(rtwdev, RTW89_DBG_BTC,
6449+
"[BTC] rlink cnt_2g=%d cnt_5g=%d\n", cnt_2g, cnt_5g);
64486450

64496451
if (wl_rinfo->dbcc_en != rtwdev->dbcc_en) {
64506452
wl_rinfo->dbcc_chg = 1;

drivers/net/wireless/realtek/rtw89/pci.c

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3026,24 +3026,54 @@ static void rtw89_pci_declaim_device(struct rtw89_dev *rtwdev,
30263026
pci_disable_device(pdev);
30273027
}
30283028

3029-
static void rtw89_pci_cfg_dac(struct rtw89_dev *rtwdev)
3029+
static bool rtw89_pci_chip_is_manual_dac(struct rtw89_dev *rtwdev)
30303030
{
3031-
struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv;
30323031
const struct rtw89_chip_info *chip = rtwdev->chip;
30333032

3034-
if (!rtwpci->enable_dac)
3035-
return;
3036-
30373033
switch (chip->chip_id) {
30383034
case RTL8852A:
30393035
case RTL8852B:
30403036
case RTL8851B:
30413037
case RTL8852BT:
3042-
break;
3038+
return true;
30433039
default:
3044-
return;
3040+
return false;
3041+
}
3042+
}
3043+
3044+
static bool rtw89_pci_is_dac_compatible_bridge(struct rtw89_dev *rtwdev)
3045+
{
3046+
struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv;
3047+
struct pci_dev *bridge = pci_upstream_bridge(rtwpci->pdev);
3048+
3049+
if (!rtw89_pci_chip_is_manual_dac(rtwdev))
3050+
return true;
3051+
3052+
if (!bridge)
3053+
return false;
3054+
3055+
switch (bridge->vendor) {
3056+
case PCI_VENDOR_ID_INTEL:
3057+
return true;
3058+
case PCI_VENDOR_ID_ASMEDIA:
3059+
if (bridge->device == 0x2806)
3060+
return true;
3061+
break;
30453062
}
30463063

3064+
return false;
3065+
}
3066+
3067+
static void rtw89_pci_cfg_dac(struct rtw89_dev *rtwdev)
3068+
{
3069+
struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv;
3070+
3071+
if (!rtwpci->enable_dac)
3072+
return;
3073+
3074+
if (!rtw89_pci_chip_is_manual_dac(rtwdev))
3075+
return;
3076+
30473077
rtw89_pci_config_byte_set(rtwdev, RTW89_PCIE_L1_CTRL, RTW89_PCIE_BIT_EN_64BITS);
30483078
}
30493079

@@ -3061,6 +3091,9 @@ static int rtw89_pci_setup_mapping(struct rtw89_dev *rtwdev,
30613091
goto err;
30623092
}
30633093

3094+
if (!rtw89_pci_is_dac_compatible_bridge(rtwdev))
3095+
goto no_dac;
3096+
30643097
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(36));
30653098
if (!ret) {
30663099
rtwpci->enable_dac = true;
@@ -3073,6 +3106,7 @@ static int rtw89_pci_setup_mapping(struct rtw89_dev *rtwdev,
30733106
goto err_release_regions;
30743107
}
30753108
}
3109+
no_dac:
30763110

30773111
resource_len = pci_resource_len(pdev, bar_id);
30783112
rtwpci->mmap = pci_iomap(pdev, bar_id, resource_len);

drivers/net/wireless/virtual/mac80211_hwsim.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ static const struct rhashtable_params hwsim_rht_params = {
763763
};
764764

765765
struct hwsim_radiotap_hdr {
766-
struct ieee80211_radiotap_header hdr;
766+
struct ieee80211_radiotap_header_fixed hdr;
767767
__le64 rt_tsft;
768768
u8 rt_flags;
769769
u8 rt_rate;
@@ -772,7 +772,7 @@ struct hwsim_radiotap_hdr {
772772
} __packed;
773773

774774
struct hwsim_radiotap_ack_hdr {
775-
struct ieee80211_radiotap_header hdr;
775+
struct ieee80211_radiotap_header_fixed hdr;
776776
u8 rt_flags;
777777
u8 pad;
778778
__le16 rt_channel;

include/net/cfg80211.h

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6129,6 +6129,50 @@ void wiphy_delayed_work_cancel(struct wiphy *wiphy,
61296129
void wiphy_delayed_work_flush(struct wiphy *wiphy,
61306130
struct wiphy_delayed_work *dwork);
61316131

6132+
/**
6133+
* wiphy_delayed_work_pending - Find out whether a wiphy delayable
6134+
* work item is currently pending.
6135+
*
6136+
* @wiphy: the wiphy, for debug purposes
6137+
* @dwork: the delayed work in question
6138+
*
6139+
* Return: true if timer is pending, false otherwise
6140+
*
6141+
* How wiphy_delayed_work_queue() works is by setting a timer which
6142+
* when it expires calls wiphy_work_queue() to queue the wiphy work.
6143+
* Because wiphy_delayed_work_queue() uses mod_timer(), if it is
6144+
* called twice and the second call happens before the first call
6145+
* deadline, the work will rescheduled for the second deadline and
6146+
* won't run before that.
6147+
*
6148+
* wiphy_delayed_work_pending() can be used to detect if calling
6149+
* wiphy_work_delayed_work_queue() would start a new work schedule
6150+
* or delayed a previous one. As seen below it cannot be used to
6151+
* detect precisely if the work has finished to execute nor if it
6152+
* is currently executing.
6153+
*
6154+
* CPU0 CPU1
6155+
* wiphy_delayed_work_queue(wk)
6156+
* mod_timer(wk->timer)
6157+
* wiphy_delayed_work_pending(wk) -> true
6158+
*
6159+
* [...]
6160+
* expire_timers(wk->timer)
6161+
* detach_timer(wk->timer)
6162+
* wiphy_delayed_work_pending(wk) -> false
6163+
* wk->timer->function() |
6164+
* wiphy_work_queue(wk) | delayed work pending
6165+
* list_add_tail() | returns false but
6166+
* queue_work(cfg80211_wiphy_work) | wk->func() has not
6167+
* | been run yet
6168+
* [...] |
6169+
* cfg80211_wiphy_work() |
6170+
* wk->func() V
6171+
*
6172+
*/
6173+
bool wiphy_delayed_work_pending(struct wiphy *wiphy,
6174+
struct wiphy_delayed_work *dwork);
6175+
61326176
/**
61336177
* enum ieee80211_ap_reg_power - regulatory power for an Access Point
61346178
*

0 commit comments

Comments
 (0)