forked from marfrit/kernel-agent
patches/driver/bes2600/*-danctnix: reconstruct from cleanups (closes #29)
Replaces the 13 broken DKMS-path -danctnix mirrors from PR #17 + adds 9 new series-dirs for the c-stack patches that were never split (Patches A/B/C-v3/F/D/E/C2/G/H) + retires the cumulative-c5x-danctnix single-file interim from fleet/ohm.yaml. Mechanism: cd marfrit/bes2600-dkms-mobian git format-patch fe73571..cleanups --no-merges -o /tmp/cleanups/ git format-patch cleanups..bes2600/bh-c-fossil-cleanup --no-merges -o /tmp/h/ for each commit: route to series-dir, sed-rewrite a/bes2600/foo.c -> a/drivers/staging/bes2600/foo.c The 29 cleanups commits + 1 Patch H commit map to 25 series-dirs (a few series-dirs get multiple commits: lmac-recover gets c5.2 + c5.2.1 as 0001+0002; cw1200-fix-backports gets F3+F2+F1 as 0001-0003; factory-series gets request_firmware + STANDARD_FACTORY_EFUSE_FLAG as 0001+0002). fleet/ohm.yaml apply order matches cleanups commit chronology, which is what produced the working c5x interim. cumulative.patch from ka-promote ohm now has 32 resolved patches (29 cleanups + 1 Patch H + scan-filter-5ghz + xor-neon SCS + besser#18-fix), 276 079 bytes, b2sum 7418db5ddf8fe938b130bc9d0e9f7dc9060f3a13703cd50757835ac43140a13... Apply order in cleanups + bh-c-fossil-cleanup: 1 factory-series (c1 + factory-no-efuse-flag) 3 factory-thread-dev 4 pm-gate-on-handshake 5 remove-chardev-user-interface 6 enable-testmode 7 tx-sdio-dma-oob-danctnix (was 'staging-prep-series') 8 factory-drop-kernel-write-danctnix 9 drop-dpd-file-paths-danctnix 10 drop-orphan-file-io-danctnix 11 pm-timeout-silence-danctnix 12 scan-defer-on-reject-danctnix (c5.1) 13 scan-defer-backoff-tune-danctnix (c5.1.1) 14 lmac-recover-via-mmc-hw-reset-danctnix (c5.2 + c5.2.1) 16 pm-state-resync-danctnix (c6.1) 17 pm-wake-consume-state-danctnix (c6.2) 18 pm-detect-firmware-unsupported-danctnix (c7) 19 decrypt-storm-fast-recover-danctnix (Patch A) 20 connection-loss-fast-recover-danctnix (Patch B) 21 cw1200-fix-backports-danctnix (Patches F3 + F2 + F1) 24 sdio-rx-no-relay-danctnix (Patch C v3) 25 license-spdx-restore-attribution-danctnix (Patch G) 26 ba-lock-atomic-danctnix (Patch D) 27 ps-state-lock-skip-pm-disabled-danctnix (Patch E) 28 rx-list-batch-delivery-danctnix (Patch C2) 29 bh-c-fossil-cleanup-danctnix (Patch H) 30 scan-filter-5ghz-danctnix (besser#1) 31 arch/arm64/xor-neon-... (GCC 15 SCS) 32 queue-pending-record-lock-bh-danctnix (besser#18) Verification: pkgrel=6 build from this manifest in progress; if srcversion == 26B0003FE9F2B05DCE838C4 (pkgrel=5's), source-tree is byte-equivalent to the c5x interim + scan-filter + besser#18 stack that's currently running on ohm. Refs: #17 (the broken mirror), #28 (the interim PR that landed cumulative-c5x), #31 (ka-promote trailer normalisation followup).
This commit is contained in:
+157
@@ -0,0 +1,157 @@
|
||||
From 0ec58c0ad539e1e8d347b5527ce66cf847782338 Mon Sep 17 00:00:00 2001
|
||||
From: Markus Fritsche <fritsche.markus@gmail.com>
|
||||
Date: Fri, 8 May 2026 06:40:00 +0200
|
||||
Subject: [PATCH 29/29] =?UTF-8?q?bes2600:=20Patch=20C2=20=E2=80=94=20repla?=
|
||||
=?UTF-8?q?ce=20ieee80211=5Frx=5Firqsafe=20with=20ieee80211=5Frx=5Fni?=
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Per Phase 4 plan PR #14 + kerneldoc audit (Task #19). Six call sites
|
||||
deferred per-RX-frame mac80211 dispatch via tasklet; replace with the
|
||||
synchronous-from-process-context API ieee80211_rx_ni() which does its
|
||||
own local_bh_disable wrap.
|
||||
|
||||
Why _ni and not _list:
|
||||
|
||||
Phase 4 plan originally targeted ieee80211_rx_list for batch
|
||||
delivery. Mining mt76 mainline (the only driver using _list)
|
||||
showed the canonical pattern requires threading a struct list_head
|
||||
through the per-frame call chain. bes2600s WSM dispatcher
|
||||
(wsm_handle_rx -> bes2600_rx_cb / wsm.c beacon path) sits between
|
||||
the bh threads SDIO read and the mac80211 hand-off; threading a
|
||||
list_head through the dispatcher is a non-trivial refactor.
|
||||
ieee80211_rx_ni() is the simpler drop-in: no list management, still
|
||||
removes the tasklet hop. Per-call local_bh_disable cost is trivial
|
||||
vs the saved tasklet schedule. Future refactor can revisit _list
|
||||
if measurements warrant.
|
||||
|
||||
Sites converted:
|
||||
|
||||
- ap.c:96 (bes2600_sta_add link-id rx_queue drain on AP-mode
|
||||
STA add). Was inside spin_lock_bh(&ps_state_lock);
|
||||
refactored to splice the queue under the lock then
|
||||
deliver after unlock — _ni runs the synchronous
|
||||
mac80211 RX path inline, would otherwise hold the
|
||||
lock across mac80211 dispatch. splice via
|
||||
skb_queue_splice_init into a local sk_buff_head.
|
||||
- sta.c:1487 (deauth-frame inject in inactivity-event handler).
|
||||
Not under any lock; direct conversion.
|
||||
- txrx.c:1960 (early-data + pm_unsupported branch from Patch E).
|
||||
- txrx.c:1967 (early-data + LINK_SOFT-not-set branch).
|
||||
- txrx.c:1971 (normal RX path in bes2600_rx_cb).
|
||||
- wsm.c:2415 (beacon delivery in scan-complete WSM handler).
|
||||
beacon SKB ownership is preserved by the existing
|
||||
skb_copy(beacon, GFP_ATOMIC) -> beacon_bkp pattern;
|
||||
no lifecycle change needed.
|
||||
|
||||
Mixing constraint (kerneldoc include/net/mac80211.h:5399-5430):
|
||||
ieee80211_rx_ni() cannot mix with ieee80211_rx_irqsafe() for a
|
||||
single hardware. All 6 sites convert atomically; no mixed state.
|
||||
|
||||
Build verified clean on ohm sandbox: srcversion 619A51E61BF5479AAC146E6.
|
||||
|
||||
Predicted Phase 7 delta: +5-15% over v3+D+E baseline (2.35 MB/s mean
|
||||
on v3 alone; D+E single-rep was 3.22 MB/s). Modest improvement
|
||||
expected from removing the tasklet schedule per RX frame. Smaller
|
||||
deltas would still be a net win for upstream-cleanliness — the
|
||||
kernel.org submission story benefits from not using _irqsafe from
|
||||
process context.
|
||||
---
|
||||
bes2600/ap.c | 15 +++++++++++++--
|
||||
bes2600/sta.c | 2 +-
|
||||
bes2600/txrx.c | 6 +++---
|
||||
bes2600/wsm.c | 2 +-
|
||||
4 files changed, 18 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/staging/bes2600/ap.c b/drivers/staging/bes2600/ap.c
|
||||
index 0a23790..6d4428c 100644
|
||||
--- a/drivers/staging/bes2600/ap.c
|
||||
+++ b/drivers/staging/bes2600/ap.c
|
||||
@@ -62,8 +62,11 @@ int bes2600_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
struct bes2600_vif *priv = cw12xx_get_vif_from_ieee80211(vif);
|
||||
struct bes2600_link_entry *entry;
|
||||
struct sk_buff *skb;
|
||||
+ struct sk_buff_head local_drain;
|
||||
struct bes2600_common *hw_priv = hw->priv;
|
||||
|
||||
+ __skb_queue_head_init(&local_drain);
|
||||
+
|
||||
#ifdef P2P_MULTIVIF
|
||||
WARN_ON(priv->if_id == CW12XX_GENERIC_IF_ID);
|
||||
#endif
|
||||
@@ -92,9 +95,17 @@ int bes2600_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
IEEE80211_WMM_IE_STA_QOSINFO_AC_MASK)
|
||||
priv->sta_asleep_mask |= BIT(sta_priv->link_id);
|
||||
entry->status = BES2600_LINK_HARD;
|
||||
- while ((skb = skb_dequeue(&entry->rx_queue)))
|
||||
- ieee80211_rx_irqsafe(priv->hw, skb);
|
||||
+ /*
|
||||
+ * Patch C2: splice the rx_queue out under the lock then deliver
|
||||
+ * after unlock. ieee80211_rx_ni() runs the mac80211 RX path
|
||||
+ * synchronously (formerly ieee80211_rx_irqsafe deferred to a
|
||||
+ * tasklet); calling it from inside spin_lock_bh would hold the
|
||||
+ * lock across mac80211's full RX dispatch.
|
||||
+ */
|
||||
+ skb_queue_splice_init(&entry->rx_queue, &local_drain);
|
||||
spin_unlock_bh(&priv->ps_state_lock);
|
||||
+ while ((skb = __skb_dequeue(&local_drain)))
|
||||
+ ieee80211_rx_ni(priv->hw, skb);
|
||||
#ifdef AP_AGGREGATE_FW_FIX
|
||||
hw_priv->connected_sta_cnt++;
|
||||
if(hw_priv->connected_sta_cnt>1) {
|
||||
diff --git a/drivers/staging/bes2600/sta.c b/drivers/staging/bes2600/sta.c
|
||||
index 7caeb4b..e64841a 100644
|
||||
--- a/drivers/staging/bes2600/sta.c
|
||||
+++ b/drivers/staging/bes2600/sta.c
|
||||
@@ -1484,7 +1484,7 @@ void bes2600_event_handler(struct work_struct *work)
|
||||
IEEE80211_STYPE_DEAUTH | IEEE80211_FCTL_TODS);
|
||||
deauth->u.deauth.reason_code = WLAN_REASON_DEAUTH_LEAVING;
|
||||
deauth->seq_ctrl = 0;
|
||||
- ieee80211_rx_irqsafe(priv->hw, skb);
|
||||
+ ieee80211_rx_ni(priv->hw, skb);
|
||||
bes_devel(" Inactivity Deauth Frame sent for MAC SA %pM \t and DA %pM\n", deauth->sa, deauth->da);
|
||||
queue_work(priv->hw_priv->workqueue, &priv->set_tim_work);
|
||||
break;
|
||||
diff --git a/drivers/staging/bes2600/txrx.c b/drivers/staging/bes2600/txrx.c
|
||||
index bf17777..de521a3 100644
|
||||
--- a/drivers/staging/bes2600/txrx.c
|
||||
+++ b/drivers/staging/bes2600/txrx.c
|
||||
@@ -1957,18 +1957,18 @@ void bes2600_rx_cb(struct bes2600_vif *priv,
|
||||
* path is taken.
|
||||
*/
|
||||
if (hw_priv->bes_power.pm_unsupported) {
|
||||
- ieee80211_rx_irqsafe(priv->hw, skb);
|
||||
+ ieee80211_rx_ni(priv->hw, skb);
|
||||
} else {
|
||||
spin_lock_bh(&priv->ps_state_lock);
|
||||
/* Double-check status with lock held */
|
||||
if (entry->status == BES2600_LINK_SOFT)
|
||||
skb_queue_tail(&entry->rx_queue, skb);
|
||||
else
|
||||
- ieee80211_rx_irqsafe(priv->hw, skb);
|
||||
+ ieee80211_rx_ni(priv->hw, skb);
|
||||
spin_unlock_bh(&priv->ps_state_lock);
|
||||
}
|
||||
} else {
|
||||
- ieee80211_rx_irqsafe(priv->hw, skb);
|
||||
+ ieee80211_rx_ni(priv->hw, skb);
|
||||
}
|
||||
*skb_p = NULL;
|
||||
|
||||
diff --git a/drivers/staging/bes2600/wsm.c b/drivers/staging/bes2600/wsm.c
|
||||
index 908c965..2424181 100644
|
||||
--- a/drivers/staging/bes2600/wsm.c
|
||||
+++ b/drivers/staging/bes2600/wsm.c
|
||||
@@ -2412,7 +2412,7 @@ int wsm_handle_rx(struct bes2600_common *hw_priv, int id,
|
||||
if (!hw_priv->beacon_bkp)
|
||||
hw_priv->beacon_bkp = \
|
||||
skb_copy(hw_priv->beacon, GFP_ATOMIC);
|
||||
- ieee80211_rx_irqsafe(hw_priv->hw, hw_priv->beacon);
|
||||
+ ieee80211_rx_ni(hw_priv->hw, hw_priv->beacon);
|
||||
hw_priv->beacon = hw_priv->beacon_bkp;
|
||||
|
||||
hw_priv->beacon_bkp = NULL;
|
||||
--
|
||||
2.54.0
|
||||
|
||||
Reference in New Issue
Block a user