11 Commits

Author SHA1 Message Date
claude-noether 731e98e079 fleet/ohm.yaml: fix arch/arm64 include path after merge rename
The merge commit renamed arch/arm64/xor-neon-ffixed-x18-scs-build-fix-danctnix/
to arch/arm64/scs-arm-neon-build-fix/ (= main's canonical name) but the
include reference in ohm.yaml didn't get updated atomically.

Update the include path to match the renamed dir; ka-promote would have
exit-2'd on this manifest otherwise.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 20:52:59 +00:00
claude-noether bae99da612 Merge upstream/main into noether/migrate-pinetab2-pkg-and-patches
Resolves the conflict-window between the PR's "switch bes2600 to
cumulative-c5x interim" intent and main's incremental per-patch
evolution.

Resolution per discussion:
- fleet/ohm.yaml: keep PR's cumulative-c5x layout (replaces per-patch
  list) but rename arch/arm64 include to main's canonical
  'scs-arm-neon-build-fix/' (branch's renamed dir dropped).
- patches/driver/bes2600/queue-pending-record-lock-bh-danctnix/
  0001-*.patch: take main's (= identical content + the git-format-patch
  trailer that the branch's earlier add omitted).
- patches/driver/bes2600/scan-filter-5ghz-danctnix/: drop branch's
  older '0001-...-allow-single-channel.patch' variant; keep main's
  newer '0001-...-filter-at-driver-boundary.patch' to avoid 0001-*
  collisions in ka-promote's series-dir resolver.
- patches/arch/arm64/xor-neon-ffixed-x18-scs-build-fix-danctnix/:
  dropped (= duplicate of main's scs-arm-neon-build-fix/).
- All other main additions (rkvdec vp9 patches, scan-filter-5ghz/,
  fleet/ampere.yaml updates) auto-merged cleanly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 20:52:27 +00:00
marfrit 3d10a2c21a Merge pull request 'patches/driver/bes2600/queue-pending-record-lock-bh-danctnix: mirror besser#18 fix' (#30) from claude-noether/kernel-agent:noether/bes2600-pending-record-lock-bh into main
Reviewed-on: marfrit/kernel-agent#30
2026-05-18 19:18:51 +00:00
claude-noether c9e9ad973c patches/driver/bes2600/queue-pending-record-lock-bh-danctnix: mirror besser#18 fix from bes2600-dkms
Single-patch series-dir, mirror of the Markus-authored commit d95453c
on marfrit/bes2600-dkms branch bes2600/queue-pending-record-lock-bh-fix
(PR #11). Paths rewritten from DKMS-style (bes2600/foo.c) to in-tree
staging (drivers/staging/bes2600/foo.c) via sed -- this is the
in-tree variant.

Fix: convert plain spin_lock(&pending_record_lock) to spin_lock_bh()
at the 5 sites where it's taken in non-BH-disabled contexts
(queue.c:832/839/844, tx_loop.c:112/114). queue.c:289/295 stays as
plain spin_lock because BH is already disabled by the outer
queue->lock_bh acquired at queue.c:285.

Eliminates the SOFTIRQ-safe -> SOFTIRQ-unsafe lockdep warning
reported in besser#18 (PROVE_LOCKING-only -- non-fatal on production
builds where lockdep is off, but real AB-BA window between
bes2600_join_work workqueue context and bes2600_tx softirq context).

This commit does NOT add the include to fleet/ohm.yaml. The patch
will be wired into ohm's manifest in a follow-up commit (or this
branch's PR can extend with the ohm.yaml change once the migration
PR #28 lands and the bes2600-dkms PR #11 is reviewed).

Closes: besser#18
Refs: marfrit/bes2600-dkms #11 (source-of-truth PR)
2026-05-18 16:59:28 +02:00
marfrit a254b6f0bb Merge pull request 'bes2600/scan-filter-5ghz: refine to allow targeted single-channel scans' (#26) from noether/scan-filter-5ghz-refine-targeted-allowed into main
Reviewed-on: marfrit/kernel-agent#26
2026-05-18 14:06:53 +00:00
test0r 43c8f0cba8 patches/driver/bes2600: scan-filter-5ghz refinement — allow targeted single-channel scans
Updates both flavors with the n_channels > 1 refinement (was > 0).
The original guard refused ALL 5 GHz scans which broke 5 GHz
association via NM band=a profiles (NM iterates freq_list per
channel, single-channel scans were also refused).

Tightened: only multi-channel 5 GHz scans (the per-band-sweep
that triggers the firmware storm) are refused; single-channel
5 GHz scans pass through so NM/wpa_supplicant can find and
associate to 5 GHz BSSes.

Verified on ohm with locally-built pkgrel=3 (srcversion
BEB625FA7443171EA8D55F7): associated to 5 GHz BSSID
c0:25:06:e6:5b:33 on 5240 MHz / ch.48, 150 Mbit/s MCS 7
40MHz short-GI; Pattern A still 0 since boot.

Patch file is now a concatenation of two commits from
marfrit/bes2600-dkms bes2600/scan-filter-5ghz branch:
  093a503 (original Patch I)
  8cd10f4 (this refinement)
patch -Np1 applies them sequentially -> net effect = single squash.

Refs: besser#1 (closed), PKGBUILD update at marfrit/besser
claude-noether-14 commit 122582e (pkgrel=3 deployed to ohm
on 2026-05-18 same session).
2026-05-18 15:57:20 +02:00
marfrit 42b0c5042a Merge pull request 'fleet/ohm: import Patch I (5GHz scan filter, closes besser#1) + arm64 SCS build-fix' (#25) from noether/import-scan-filter-5ghz-and-scs-fix into main
Reviewed-on: marfrit/kernel-agent#25
2026-05-18 13:34:55 +00:00
test0r 4c80458d1f fleet/ohm: import Patch I (5GHz scan filter) + arm64 SCS build-fix
Patch I closes besser#1 — the wsm_generic_confirm 0x0007 dmesg storm.
One-line guard in bes2600_hw_scan() refuses the 5 GHz iteration of
mac80211's per-band hw_scan loop with -EOPNOTSUPP, so the firmware
never sees the scan request that would be rejected with status 2 →
-EINVAL cascade.  Phase 7 verified 2026-05-18 on ohm running pkgrel=2:
Pattern A 14.3/h → 0/h over 30-min window, no WARN/BUG, single-band
2.4 GHz scans still return BSSes cleanly.

Two flavors imported (scan-filter-5ghz and scan-filter-5ghz-danctnix)
matching the convention of other bes2600 series — the code path
doesn't touch timer APIs so the two are byte-identical for now;
flavor separation is kept to preserve consistency in ohm.yaml.

The arm64 scs-arm-neon-build-fix series is a build-environment
workaround: GCC 15.2.1 strictly validates that -fsanitize=shadow-
call-stack requires -ffixed-x18, and arm_neon.h's #pragma target/
push/pop blocks lose x18 fixing inside the wrapped section.  The
Makefile tweak re-adds -ffixed-x18 explicitly for xor-neon.o.  It's
a no-op when SCS is off (current pkgrel=2 ohm config) and unblocks
SCS=y once GCC upstream is fixed.

ohm.yaml gains a CONFIG_SHADOW_CALL_STACK=n config override with a
pointer to besser#20 (the re-enable tracking issue) so future
manifest-driven kconfig generation honors the workaround without
silently dropping it.

Source-of-truth commit for Patch I:
  marfrit/bes2600-dkms branch bes2600/scan-filter-5ghz sha 093a503
PKGBUILD-side (already deployed to ohm via pkgrel=2):
  marfrit/besser branch claude-noether-14 sha ae175f9

Refs: besser#1 (closed), besser#20, kernel-agent#5
2026-05-18 15:25:37 +02:00
marfrit 96af34d775 Merge PR #24: import Sarma VP9-VDPU381 series + enable in fleet/ampere.yaml 2026-05-18 13:15:19 +00:00
marfrit 95be39ef80 fleet/ampere: enable Sarma VP9-VDPU381 patches in baseline
Reference the 3 patches imported in the previous commit under the
scope-tagged patch list. Apply order is strict (0001 → 0002 → 0003).

Verified 2026-05-18 via the arch_vp9_test extlinux boot on ampere:
- VP9F enumerates on rkvdec /dev/video2
- kdirect decode bit-exact vs libavcodec SW reference at -ss 30
- libva decode (firefox/chromium-style consumer) also bit-exact
- vainfo lists VAProfileVP9Profile0 (iter38 multi-device probe auto-picks)
- All three paths agree on sha
  c8624d7c42db66525f53a02a515bc38d0a17ef39f692660cc7bebb1e2d2e1b48

Removes VP9 from the "explicitly not included" comment block — issue
#12 closes with this change.

Also: AV1 stays out-of-scope per issue #6 ask 3 (kernel side fine via
the existing av1-vpu-dec node; backend just needs the 4th-fd
generalization tracked in libva-v4l2-request-fourier#2).

The next linux-ampere-fourier package rebuild from this manifest
will pick up VP9 automatically; ampere's running
7.0.0-rc3-vp9-test+ kernel already has these patches via the
operator's manual build session today.
2026-05-18 13:15:09 +00:00
marfrit 9092d9aaaa patches/driver/media: import Sarma's VP9-VDPU381 series (out-of-tree, v8)
Three patches from D.V.A.B. Sarma adding VP9 decode support to the
VDPU381 variant of rkvdec (RK3588 generation). Combined ~1500 LOC,
5 new files in drivers/media/platform/rockchip/rkvdec/.

Provenance: github.com/dvab-sarma/android_kernel_rk_opi branch
add-rkvdec-vdpu381-vp9-v8. Collabora's blog cites the work but it
hasn't reached linux-media patchwork yet (Collabora: "v1 series
needs to be sent for review soon"). Casanova's underlying
VDPU381/VDPU383 H.264+HEVC base IS in mainline 7.0 release.

Tested by author on Orange Pi 5 Pro (RK3588) with AOSP 16 + FFMPEG,
Profile 0 + Profile 2.

Tested in our fleet 2026-05-18: cherry-picks cleanly on top of
ampere-minimal-devices, full kernel build (KERNELRELEASE
7.0.0-rc3-vp9-test+) succeeds clean with GCC 16.1.1. Image + DTB +
modules + initramfs installed under -vp9-test+ suffix on ampere
without touching the running -devices+ kernel; new extlinux label
arch_vp9_test added (default unchanged at arch_devices). End-to-end
VP9 decode verification pending operator reboot into the new label.

Patches NOT yet referenced from fleet/ampere.yaml — that bump is
the operator's call (manifest preamble currently scopes VP9 out per
issue #6). Once verified, ampere.yaml can add these three under the
scope-tagged patch list in apply order 0001→0002→0003.

Cross-reference: marfrit/kernel-agent#12.
2026-05-18 12:56:15 +00:00
11 changed files with 2093 additions and 29 deletions
+11 -4
View File
@@ -53,12 +53,19 @@ includes:
- board/coolpi-cm5-genbook/0005-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Enable-USB-C-PD-charging-via-FUSB302.patch - board/coolpi-cm5-genbook/0005-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Enable-USB-C-PD-charging-via-FUSB302.patch
- board/coolpi-cm5-genbook/0008-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Add-lid-switch-and-USB3-PHY-lane-config.patch - board/coolpi-cm5-genbook/0008-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Add-lid-switch-and-USB3-PHY-lane-config.patch
- board/coolpi-cm5-genbook/0011-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-wire-internal-microphone.patch - board/coolpi-cm5-genbook/0011-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-wire-internal-microphone.patch
# VP9 enablement for RK3588 rkvdec (issue #12, closed 2026-05-18).
# Cherry-picked from D.V.A.B. Sarma's add-rkvdec-vdpu381-vp9-v8 branch
# at github.com/dvab-sarma/android_kernel_rk_opi. Bit-exact HW==SW==libva
# verified at -ss 30 on bbb_60s_720p.vp9.webm via all three decode paths
# (kdirect / SW / libva); sha c8624d7c42db66525f53a02a515bc38d0a17ef39f692660cc7bebb1e2d2e1b48.
# Apply order is STRICT (0003 depends on the rkvdec-vp9-common refactor
# added in 0002, which depends on the helper rename in 0001).
# See patches/driver/media/README.md for provenance + removal criteria.
- driver/media/0001-rkvdec-vp9-rename-get_ref_buf-to-get_ref_buf_vp9.patch
- driver/media/0002-rkvdec-move-vp9-functions-to-common-file.patch
- driver/media/0003-rkvdec-add-vp9-support-for-vdpu381-variant.patch
# Explicitly NOT included this round (tracked for later sprints): # Explicitly NOT included this round (tracked for later sprints):
# - VP9 enablement for RK3588 rkvdec (issue #6 ask 2). /dev/video0 only
# advertises S265 + S264 today; vainfo lists 9 profiles, target is
# 10. Requires identifying the VDPU381/383 patch chain + possible
# DTS additions. RFC-stage work, scope unclear until research lands.
# - AV1 decoder integration (issue #6 ask 3). Kernel side is fine # - AV1 decoder integration (issue #6 ask 3). Kernel side is fine
# (/dev/video4 advertises AV1F). Backend libva-v4l2-request-fourier # (/dev/video4 advertises AV1F). Backend libva-v4l2-request-fourier
# needs iter39 for a third fd. Backend work, not kernel. # needs iter39 for a third fd. Backend work, not kernel.
+1 -1
View File
@@ -48,7 +48,7 @@ includes:
# Runtime no-op as long as the config has CONFIG_SHADOW_CALL_STACK=n # Runtime no-op as long as the config has CONFIG_SHADOW_CALL_STACK=n
# (current ohm setting). Kept in the manifest for the day SCS gets # (current ohm setting). Kept in the manifest for the day SCS gets
# re-enabled. See reference_arm64_scs_arm_neon_gcc15 memory. # re-enabled. See reference_arm64_scs_arm_neon_gcc15 memory.
- arch/arm64/xor-neon-ffixed-x18-scs-build-fix-danctnix/ - arch/arm64/scs-arm-neon-build-fix/
# close besser#18 — pending_record_lock SOFTIRQ-safe -> -unsafe inversion. # close besser#18 — pending_record_lock SOFTIRQ-safe -> -unsafe inversion.
# Mirror of marfrit/bes2600-dkms#11 (d95453c). 5-site spin_lock -> _bh. # Mirror of marfrit/bes2600-dkms#11 (d95453c). 5-site spin_lock -> _bh.
- driver/bes2600/queue-pending-record-lock-bh-danctnix/ - driver/bes2600/queue-pending-record-lock-bh-danctnix/
@@ -22,7 +22,7 @@ diff --git a/arch/arm64/lib/Makefile b/arch/arm64/lib/Makefile
index 1234567..2345678 100644 index 1234567..2345678 100644
--- a/arch/arm64/lib/Makefile --- a/arch/arm64/lib/Makefile
+++ b/arch/arm64/lib/Makefile +++ b/arch/arm64/lib/Makefile
@@ -9,6 +9,11 @@ ifeq ($(CONFIG_KERNEL_MODE_NEON), y) @@ -9,6 +9,10 @@ ifeq ($(CONFIG_KERNEL_MODE_NEON), y)
obj-$(CONFIG_XOR_BLOCKS) += xor-neon.o obj-$(CONFIG_XOR_BLOCKS) += xor-neon.o
CFLAGS_xor-neon.o += $(CC_FLAGS_FPU) CFLAGS_xor-neon.o += $(CC_FLAGS_FPU)
CFLAGS_REMOVE_xor-neon.o += $(CC_FLAGS_NO_FPU) CFLAGS_REMOVE_xor-neon.o += $(CC_FLAGS_NO_FPU)
@@ -34,6 +34,3 @@ index 1234567..2345678 100644
endif endif
lib-$(CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE) += uaccess_flushcache.o lib-$(CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE) += uaccess_flushcache.o
--
2.54.0
@@ -1,20 +0,0 @@
# xor-neon-ffixed-x18-scs-build-fix-danctnix — GCC 15.2.1 build fix
Restores `-ffixed-x18` for `arch/arm64/lib/xor-neon.c` when
`CONFIG_SHADOW_CALL_STACK=y`. GCC 15.2.1 enforces that
`-fsanitize=shadow-call-stack` requires `-ffixed-x18` inside
arm_neon.h's `#pragma GCC target()` push/pop blocks; CC_FLAGS_REMOVE
strips the kernel-wide `-ffixed-x18` for xor-neon.o and CC_FLAGS_FPU
does not restore it.
**Note on current ohm config**: `linux-pinetab2-danctnix-besser`
config has `# CONFIG_SHADOW_CALL_STACK is not set` as of pkgrel=3,
which makes this patch a runtime no-op (`$(if $(CONFIG_SHADOW_CALL_STACK),
-ffixed-x18)` evaluates to nothing). Patch is kept in the manifest as
belt-and-suspenders for the day SCS gets re-enabled (tracked in
besser issue for GCC fix monitoring).
See [[reference_arm64_scs_arm_neon_gcc15]] for the full toolchain
analysis. This patch is the upstream-friendly Makefile fix; the
config-side `SHADOW_CALL_STACK=n` workaround is the immediate
runtime mitigation. Both are present in pkgrel=3 for safety.
@@ -116,3 +116,6 @@ index e6cf072..0cf7ce1 100644
if (atomic_read(&hw_priv->bh_rx) > 0) if (atomic_read(&hw_priv->bh_rx) > 0)
wake_up(&hw_priv->bh_wq); wake_up(&hw_priv->bh_wq);
--
2.54.0
@@ -0,0 +1,168 @@
From 093a5038b8b68f316d976b7cb69609ca7f24f322 Mon Sep 17 00:00:00 2001
From: Markus Fritsche <fritsche.markus@gmail.com>
Date: Mon, 18 May 2026 11:27:40 +0200
Subject: [PATCH 1/2] bes2600: filter 5 GHz scans at the driver boundary
(besser#1)
The BES2600 firmware refuses WSM start-scan for 5 GHz with status 2
("rejected by policy"). This shows up in dmesg as the recurring
wsm_generic_confirm failed for request 0x0007.
[SCAN] Scan failed (-22).
pattern (besser issue #1, ~14-16/h on ohm/PineTab2 baseline).
Trace shows every reject is the second of a back-to-back pair: mac80211
splits multi-band hw_scan requests per band when the driver does not
set IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS (we don't), then re-invokes
drv_hw_scan from __ieee80211_scan_completed for each subsequent band.
The 2.4 GHz iteration succeeds; the 5 GHz iteration is what the
firmware rejects. See ieee80211_prep_hw_scan in net/mac80211/scan.c
for the loop, and the existing memory reference_bes2600_5ghz_scan_reject
for the firmware behaviour.
The 056a71a defer-on-reject patch already in this tree handles the
BT-A2DP-coex branch and the consecutive-reject backoff, but it cannot
prevent the per-band-loop reject: by the time defer_should_scan is
consulted, the per-band call is already in flight, and the reject_count
gets reset on every successful 2.4 GHz scan in between (which is
~36% of attempts), so the threshold never trips.
The fix: refuse the 5 GHz iteration upfront in bes2600_hw_scan. The
2.4 GHz scan still runs normally. The 5 GHz portion is reported as
aborted to userspace -- same outcome as today, minus the dmesg storm
and the wsm_generic_confirm WARN cascade.
5 GHz band registration is intentionally left in place: direct-BSSID
association to a known 5 GHz AP still works (no scan is needed for
that path), and a future firmware update that fixes the scan behaviour
should not be foreclosed by changing band advertisement.
Contract: per include/net/mac80211.h ieee80211_ops.hw_scan, a negative
return aborts the scan without requiring ieee80211_scan_completed().
-EOPNOTSUPP is the semantically accurate code (operation is legal,
driver can't service it on this band today).
Phase 3 evidence:
- baseline N=3: rate ~14.3-23.6/h converged at 14.3/h (matches OP)
- back-to-back scan gap: 6/6 rejected pairs <200us, 1/1 successful
pair was 114ms (single-band-only, no 5 GHz leg)
- defer log fires: 0/9 in 30-min window (056a71a structurally bypassed)
Predicted Phase 7 delta: Pattern A 14/h -> 0/h.
---
bes2600/scan.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/drivers/staging/bes2600/scan.c b/drivers/staging/bes2600/scan.c
index fb1d298..a81afb6 100644
--- a/drivers/staging/bes2600/scan.c
+++ b/drivers/staging/bes2600/scan.c
@@ -238,6 +238,28 @@ int bes2600_hw_scan(struct ieee80211_hw *hw,
/* Scan when P2P_GO corrupt firmware MiniAP mode */
if (priv->join_status == BES2600_JOIN_STATUS_AP)
return -EOPNOTSUPP;
+
+ /*
+ * Firmware refuses WSM start-scan for 5 GHz with status 2 ("rejected
+ * by policy"); see besser issue #1. mac80211 splits multi-band
+ * hw_scan requests per-band when the driver does not set
+ * IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS (we don't -- see
+ * ieee80211_hw_set() calls in bes2600_main.c), so each per-band call
+ * has req->channels[] from one band only (see ieee80211_prep_hw_scan
+ * in net/mac80211/scan.c). Refuse the 5 GHz iteration at the driver
+ * boundary so userspace gets a clean aborted-scan for that portion
+ * rather than waiting for the firmware reject to cascade up. 5 GHz
+ * band registration stays intact so direct-BSSID association to a
+ * known 5 GHz AP still works (no scan needed for that path).
+ *
+ * Contract: per include/net/mac80211.h struct ieee80211_ops.hw_scan
+ * documentation, a negative return aborts the scan without requiring
+ * ieee80211_scan_completed().
+ */
+ if (req->n_channels > 0 &&
+ req->channels[0]->band == NL80211_BAND_5GHZ)
+ return -EOPNOTSUPP;
+
#if 0
if (work_pending(&priv->offchannel_work) ||
(hw_priv->roc_if_id != -1)) {
--
2.54.0
From 8cd10f487c8144d462a510812ba0fa717b3e24df Mon Sep 17 00:00:00 2001
From: Markus Fritsche <fritsche.markus@gmail.com>
Date: Mon, 18 May 2026 15:56:34 +0200
Subject: [PATCH 2/2] bes2600: scan-filter-5ghz: allow targeted single-channel
scans (besser#1 follow-up)
The original Patch I refused EVERY 5 GHz scan request unconditionally
(req->n_channels > 0 && band == NL80211_BAND_5GHZ). This eliminated
the Pattern A storm but also broke 5 GHz association entirely:
NM / wpa_supplicant iterates a freq_list when a connection profile
specifies 802-11-wireless.band=a, issuing per-frequency single-channel
scans to find the BSS before associating. Those single-channel scans
were also refused by our guard, so the BSS was never seen and
'Wi-Fi network could not be found' was the only outcome.
Tighten the guard: refuse only multi-channel 5 GHz scans (n_channels
> 1), which is the per-band-sweep pattern mac80211 issues internally
and the only one that triggers the firmware storm at the per-band
loop boundary. Single-channel 5 GHz scans pass through to firmware,
which generally accepts them -- and when they happen to be rejected,
the failure is isolated and doesn't cascade.
Verified on ohm with pkgrel=3 (srcversion BEB625FA7443171EA8D55F7):
- Pattern A count since boot: 0 (Phase 7 prediction still holds)
- iw dev wlan0 scan freq 5180 -> allowed
- iw dev wlan0 scan freq 5180 5200 ... -> refused -EOPNOTSUPP
- NM 'nmcli connection up' with band=a -> associated to BSSID
c0:25:06:e6:5b:33 on 5240 MHz / ch.48 in ~1 second
- TX bitrate 150 Mbit/s MCS 7 40MHz short-GI (vs 72.2 Mbit/s
HT20 on 2.4 GHz) -- ~2x throughput recovered
The change is a single byte (> 0 -> > 1) plus comment update; the
test confirmation above is what motivates it.
Refs: besser#1 (closed but tracked for follow-up like this), original
Patch I sha 093a503.
---
bes2600/scan.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/bes2600/scan.c b/drivers/staging/bes2600/scan.c
index a81afb6..497523b 100644
--- a/drivers/staging/bes2600/scan.c
+++ b/drivers/staging/bes2600/scan.c
@@ -248,15 +248,23 @@ int bes2600_hw_scan(struct ieee80211_hw *hw,
* has req->channels[] from one band only (see ieee80211_prep_hw_scan
* in net/mac80211/scan.c). Refuse the 5 GHz iteration at the driver
* boundary so userspace gets a clean aborted-scan for that portion
- * rather than waiting for the firmware reject to cascade up. 5 GHz
- * band registration stays intact so direct-BSSID association to a
- * known 5 GHz AP still works (no scan needed for that path).
+ * rather than waiting for the firmware reject to cascade up.
+ *
+ * Only the multi-channel case is refused (n_channels > 1): that's
+ * the per-band-sweep pattern mac80211 issues internally and the
+ * one that triggers the firmware storm at the per-band loop
+ * boundary. Single-channel 5 GHz scans (BSS verification, NM's
+ * per-freq iteration when 802-11-wireless.band=a is set) pass
+ * through to firmware, which generally accepts them since the
+ * storm is the back-to-back per-band issue, not a blanket 5 GHz
+ * reject. This preserves 5 GHz association via the
+ * "wpa_supplicant iterates freq_list per channel" path.
*
* Contract: per include/net/mac80211.h struct ieee80211_ops.hw_scan
* documentation, a negative return aborts the scan without requiring
* ieee80211_scan_completed().
*/
- if (req->n_channels > 0 &&
+ if (req->n_channels > 1 &&
req->channels[0]->band == NL80211_BAND_5GHZ)
return -EOPNOTSUPP;
--
2.54.0
@@ -0,0 +1,48 @@
From 9ddcae54a171f2fc7742e92e03b1478d87ae4bbb Mon Sep 17 00:00:00 2001
From: Venkata Atchuta Bheemeswara Sarma Darbha <vdarbha0473@gmail.com>
Date: Sat, 17 Jan 2026 14:27:22 -0600
Subject: [PATCH 1/3] media: rkvdec: vp9: Changing get_ref_buf function name to
get_ref_buf_vp9
This change is in preparation for the upcoming commits and to denote that this function is not to be confused with the similar function found in rkvdec's hevc.
Change-Id: I934684778c375c6960a19989a702be44655c55d6
Signed-off-by: Venkata Atchuta Bheemeswara Sarma Darbha <vdarbha0473@gmail.com>
(cherry picked from commit f60174f07d9c56e7499ca3111d0999e26444cdfd)
---
drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
index e4cdd2122873..bab2e9c83d06 100644
--- a/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
+++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
@@ -349,7 +349,7 @@ static void init_probs(struct rkvdec_ctx *ctx,
}
static struct rkvdec_decoded_buffer *
-get_ref_buf(struct rkvdec_ctx *ctx, struct vb2_v4l2_buffer *dst, u64 timestamp)
+get_ref_buf_vp9(struct rkvdec_ctx *ctx, struct vb2_v4l2_buffer *dst, u64 timestamp)
{
struct v4l2_m2m_ctx *m2m_ctx = ctx->fh.m2m_ctx;
struct vb2_queue *cap_q = &m2m_ctx->cap_q_ctx.q;
@@ -489,12 +489,12 @@ static void config_registers(struct rkvdec_ctx *ctx,
dec_params = run->decode_params;
dst = vb2_to_rkvdec_decoded_buf(&run->base.bufs.dst->vb2_buf);
- ref_bufs[0] = get_ref_buf(ctx, &dst->base.vb, dec_params->last_frame_ts);
- ref_bufs[1] = get_ref_buf(ctx, &dst->base.vb, dec_params->golden_frame_ts);
- ref_bufs[2] = get_ref_buf(ctx, &dst->base.vb, dec_params->alt_frame_ts);
+ ref_bufs[0] = get_ref_buf_vp9(ctx, &dst->base.vb, dec_params->last_frame_ts);
+ ref_bufs[1] = get_ref_buf_vp9(ctx, &dst->base.vb, dec_params->golden_frame_ts);
+ ref_bufs[2] = get_ref_buf_vp9(ctx, &dst->base.vb, dec_params->alt_frame_ts);
if (vp9_ctx->last.valid)
- last = get_ref_buf(ctx, &dst->base.vb, vp9_ctx->last.timestamp);
+ last = get_ref_buf_vp9(ctx, &dst->base.vb, vp9_ctx->last.timestamp);
else
last = dst;
--
2.54.0
@@ -0,0 +1,387 @@
From c5063d93e0e6011abe91418a98ed7c7550f0391b Mon Sep 17 00:00:00 2001
From: Venkata Atchuta Bheemeswara Sarma Darbha <vdarbha0473@gmail.com>
Date: Sat, 17 Jan 2026 14:37:07 -0600
Subject: [PATCH 2/3] media: rkvdec: Move vp9 functions to common file This is
a preparation commit to add support for new variants of the decoder.
The functions will later be shared with vdpu381 (rk3588).
Change-Id: Ib9b78331fb6eb0e3a607b06fd5138fc741b2c9c0
Signed-off-by: Venkata Atchuta Bheemeswara Sarma Darbha <vdarbha0473@gmail.com>
(cherry picked from commit e87662ca32e88ebb910f6cfc1c71096d5d7bc063)
---
.../media/platform/rockchip/rkvdec/Makefile | 1 +
.../rockchip/rkvdec/rkvdec-vp9-common.c | 77 +++++++++++
.../rockchip/rkvdec/rkvdec-vp9-common.h | 95 +++++++++++++
.../platform/rockchip/rkvdec/rkvdec-vp9.c | 125 +-----------------
4 files changed, 174 insertions(+), 124 deletions(-)
create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-vp9-common.c
create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-vp9-common.h
diff --git a/drivers/media/platform/rockchip/rkvdec/Makefile b/drivers/media/platform/rockchip/rkvdec/Makefile
index e629d571e4d8..2bbd67b2db11 100644
--- a/drivers/media/platform/rockchip/rkvdec/Makefile
+++ b/drivers/media/platform/rockchip/rkvdec/Makefile
@@ -12,4 +12,5 @@ rockchip-vdec-y += \
rkvdec-vdpu381-hevc.o \
rkvdec-vdpu383-h264.o \
rkvdec-vdpu383-hevc.o \
+ rkvdec-vp9-common.o \
rkvdec-vp9.o
diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9-common.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9-common.c
new file mode 100644
index 000000000000..93023737c1ed
--- /dev/null
+++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9-common.c
@@ -0,0 +1,77 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Rockchip video decoder VP9 common functions
+ *
+ * Copyright (C) 2019 Collabora, Ltd.
+ * Boris Brezillon <boris.brezillon@collabora.com>
+ * Copyright (C) 2021 Collabora, Ltd.
+ * Andrzej Pietrasiewicz <andrzej.p@collabora.com>
+ *
+ * Copyright (C) 2016 Rockchip Electronics Co., Ltd.
+ * Alpha Lin <Alpha.Lin@rock-chips.com>
+ */
+#include <linux/v4l2-common.h>
+#include <media/v4l2-h264.h>
+#include <media/v4l2-mem2mem.h>
+
+#include "rkvdec.h"
+#include "rkvdec-vp9-common.h"
+
+void write_coeff_plane(const u8 coef[6][6][3], u8 *coeff_plane)
+{
+ unsigned int idx = 0, byte_count = 0;
+ int k, m, n;
+ u8 p;
+
+ for (k = 0; k < 6; k++) {
+ for (m = 0; m < 6; m++) {
+ for (n = 0; n < 3; n++) {
+ p = coef[k][m][n];
+ coeff_plane[idx++] = p;
+ byte_count++;
+ if (byte_count == 27) {
+ idx += 5;
+ byte_count = 0;
+ }
+ }
+ }
+ }
+}
+
+struct rkvdec_decoded_buffer *
+get_ref_buf_vp9(struct rkvdec_ctx *ctx, struct vb2_v4l2_buffer *dst, u64 timestamp)
+{
+ struct v4l2_m2m_ctx *m2m_ctx = ctx->fh.m2m_ctx;
+ struct vb2_queue *cap_q = &m2m_ctx->cap_q_ctx.q;
+ struct vb2_buffer *buf;
+
+ /*
+ * If a ref is unused or invalid, address of current destination
+ * buffer is returned.
+ */
+ buf = vb2_find_buffer(cap_q, timestamp);
+ if (!buf)
+ buf = &dst->vb2_buf;
+
+ return vb2_to_rkvdec_decoded_buf(buf);
+}
+
+dma_addr_t get_mv_base_addr(struct rkvdec_decoded_buffer *buf)
+{
+ unsigned int aligned_pitch, aligned_height, yuv_len;
+
+ aligned_height = round_up(buf->vp9.height, 64);
+ aligned_pitch = round_up(buf->vp9.width * buf->vp9.bit_depth, 512) / 8;
+ yuv_len = (aligned_height * aligned_pitch * 3) / 2;
+
+ return vb2_dma_contig_plane_dma_addr(&buf->base.vb.vb2_buf, 0) +
+ yuv_len;
+}
+
+void update_dec_buf_info(struct rkvdec_decoded_buffer *buf,
+ const struct v4l2_ctrl_vp9_frame *dec_params)
+{
+ buf->vp9.width = dec_params->frame_width_minus_1 + 1;
+ buf->vp9.height = dec_params->frame_height_minus_1 + 1;
+ buf->vp9.bit_depth = dec_params->bit_depth;
+}
\ No newline at end of file
diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9-common.h b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9-common.h
new file mode 100644
index 000000000000..056842cf1bba
--- /dev/null
+++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9-common.h
@@ -0,0 +1,95 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Rockchip video decoder VP9 common functions
+ *
+ * Copyright (C) 2019 Collabora, Ltd.
+ * Boris Brezillon <boris.brezillon@collabora.com>
+ * Copyright (C) 2021 Collabora, Ltd.
+ * Andrzej Pietrasiewicz <andrzej.p@collabora.com>
+ *
+ * Copyright (C) 2016 Rockchip Electronics Co., Ltd.
+ * Alpha Lin <Alpha.Lin@rock-chips.com>
+ */
+
+#include <media/v4l2-h264.h>
+#include <media/v4l2-mem2mem.h>
+#include <media/v4l2-vp9.h>
+
+#include "rkvdec.h"
+
+struct rkvdec_vp9_run {
+ struct rkvdec_run base;
+ const struct v4l2_ctrl_vp9_frame *decode_params;
+};
+
+struct rkvdec_vp9_intra_mode_probs {
+ u8 y_mode[105];
+ u8 uv_mode[23];
+};
+
+struct rkvdec_vp9_intra_only_frame_probs {
+ u8 coef_intra[4][2][128];
+ struct rkvdec_vp9_intra_mode_probs intra_mode[10];
+};
+
+struct rkvdec_vp9_inter_frame_probs {
+ u8 y_mode[4][9];
+ u8 comp_mode[5];
+ u8 comp_ref[5];
+ u8 single_ref[5][2];
+ u8 inter_mode[7][3];
+ u8 interp_filter[4][2];
+ u8 padding0[11];
+ u8 coef[2][4][2][128];
+ u8 uv_mode_0_2[3][9];
+ u8 padding1[5];
+ u8 uv_mode_3_5[3][9];
+ u8 padding2[5];
+ u8 uv_mode_6_8[3][9];
+ u8 padding3[5];
+ u8 uv_mode_9[9];
+ u8 padding4[7];
+ u8 padding5[16];
+ struct {
+ u8 joint[3];
+ u8 sign[2];
+ u8 classes[2][10];
+ u8 class0_bit[2];
+ u8 bits[2][10];
+ u8 class0_fr[2][2][3];
+ u8 fr[2][3];
+ u8 class0_hp[2];
+ u8 hp[2];
+ u8 padding6[3];
+ } mv;
+};
+
+struct rkvdec_vp9_probs {
+ u8 partition[16][3];
+ u8 pred[3];
+ u8 tree[7];
+ u8 skip[3];
+ u8 tx32[2][3];
+ u8 tx16[2][2];
+ u8 tx8[2][1];
+ u8 is_inter[4];
+ /* 128 bit alignment */
+ u8 padding0[3];
+ union {
+ struct rkvdec_vp9_inter_frame_probs inter;
+ struct rkvdec_vp9_intra_only_frame_probs intra_only;
+ };
+ /* 128 bit alignment */
+ u8 padding1[8];
+};
+
+
+void write_coeff_plane(const u8 coef[6][6][3], u8 *coeff_plane);
+
+struct rkvdec_decoded_buffer *
+get_ref_buf_vp9(struct rkvdec_ctx *ctx, struct vb2_v4l2_buffer *dst, u64 timestamp);
+
+dma_addr_t get_mv_base_addr(struct rkvdec_decoded_buffer *buf);
+
+void update_dec_buf_info(struct rkvdec_decoded_buffer *buf,
+ const struct v4l2_ctrl_vp9_frame *dec_params);
diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
index bab2e9c83d06..2b368d7b61e0 100644
--- a/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
+++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-vp9.c
@@ -23,71 +23,12 @@
#include "rkvdec.h"
#include "rkvdec-regs.h"
+#include "rkvdec-vp9-common.h"
#define RKVDEC_VP9_PROBE_SIZE 4864
#define RKVDEC_VP9_COUNT_SIZE 13232
#define RKVDEC_VP9_MAX_SEGMAP_SIZE 73728
-struct rkvdec_vp9_intra_mode_probs {
- u8 y_mode[105];
- u8 uv_mode[23];
-};
-
-struct rkvdec_vp9_intra_only_frame_probs {
- u8 coef_intra[4][2][128];
- struct rkvdec_vp9_intra_mode_probs intra_mode[10];
-};
-
-struct rkvdec_vp9_inter_frame_probs {
- u8 y_mode[4][9];
- u8 comp_mode[5];
- u8 comp_ref[5];
- u8 single_ref[5][2];
- u8 inter_mode[7][3];
- u8 interp_filter[4][2];
- u8 padding0[11];
- u8 coef[2][4][2][128];
- u8 uv_mode_0_2[3][9];
- u8 padding1[5];
- u8 uv_mode_3_5[3][9];
- u8 padding2[5];
- u8 uv_mode_6_8[3][9];
- u8 padding3[5];
- u8 uv_mode_9[9];
- u8 padding4[7];
- u8 padding5[16];
- struct {
- u8 joint[3];
- u8 sign[2];
- u8 classes[2][10];
- u8 class0_bit[2];
- u8 bits[2][10];
- u8 class0_fr[2][2][3];
- u8 fr[2][3];
- u8 class0_hp[2];
- u8 hp[2];
- } mv;
-};
-
-struct rkvdec_vp9_probs {
- u8 partition[16][3];
- u8 pred[3];
- u8 tree[7];
- u8 skip[3];
- u8 tx32[2][3];
- u8 tx16[2][2];
- u8 tx8[2][1];
- u8 is_inter[4];
- /* 128 bit alignment */
- u8 padding0[3];
- union {
- struct rkvdec_vp9_inter_frame_probs inter;
- struct rkvdec_vp9_intra_only_frame_probs intra_only;
- };
- /* 128 bit alignment */
- u8 padding1[11];
-};
-
/* Data structure describing auxiliary buffer format. */
struct rkvdec_vp9_priv_tbl {
struct rkvdec_vp9_probs probs;
@@ -136,11 +77,6 @@ struct rkvdec_vp9_intra_frame_symbol_counts {
struct rkvdec_vp9_refs_counts ref_cnt[2][4][2][6][6];
};
-struct rkvdec_vp9_run {
- struct rkvdec_run base;
- const struct v4l2_ctrl_vp9_frame *decode_params;
-};
-
struct rkvdec_vp9_frame_info {
u32 valid : 1;
u32 segmapid : 1;
@@ -166,27 +102,6 @@ struct rkvdec_vp9_ctx {
struct rkvdec_regs regs;
};
-static void write_coeff_plane(const u8 coef[6][6][3], u8 *coeff_plane)
-{
- unsigned int idx = 0, byte_count = 0;
- int k, m, n;
- u8 p;
-
- for (k = 0; k < 6; k++) {
- for (m = 0; m < 6; m++) {
- for (n = 0; n < 3; n++) {
- p = coef[k][m][n];
- coeff_plane[idx++] = p;
- byte_count++;
- if (byte_count == 27) {
- idx += 5;
- byte_count = 0;
- }
- }
- }
- }
-}
-
static void init_intra_only_probs(struct rkvdec_ctx *ctx,
const struct rkvdec_vp9_run *run)
{
@@ -348,36 +263,6 @@ static void init_probs(struct rkvdec_ctx *ctx,
init_inter_probs(ctx, run);
}
-static struct rkvdec_decoded_buffer *
-get_ref_buf_vp9(struct rkvdec_ctx *ctx, struct vb2_v4l2_buffer *dst, u64 timestamp)
-{
- struct v4l2_m2m_ctx *m2m_ctx = ctx->fh.m2m_ctx;
- struct vb2_queue *cap_q = &m2m_ctx->cap_q_ctx.q;
- struct vb2_buffer *buf;
-
- /*
- * If a ref is unused or invalid, address of current destination
- * buffer is returned.
- */
- buf = vb2_find_buffer(cap_q, timestamp);
- if (!buf)
- buf = &dst->vb2_buf;
-
- return vb2_to_rkvdec_decoded_buf(buf);
-}
-
-static dma_addr_t get_mv_base_addr(struct rkvdec_decoded_buffer *buf)
-{
- unsigned int aligned_pitch, aligned_height, yuv_len;
-
- aligned_height = round_up(buf->vp9.height, 64);
- aligned_pitch = round_up(buf->vp9.width * buf->vp9.bit_depth, 512) / 8;
- yuv_len = (aligned_height * aligned_pitch * 3) / 2;
-
- return vb2_dma_contig_plane_dma_addr(&buf->base.vb.vb2_buf, 0) +
- yuv_len;
-}
-
static void config_ref_registers(struct rkvdec_ctx *ctx,
const struct rkvdec_vp9_run *run,
struct rkvdec_decoded_buffer *ref_buf,
@@ -446,14 +331,6 @@ static void config_seg_registers(struct rkvdec_ctx *ctx, unsigned int segid)
(seg->flags & V4L2_VP9_SEGMENTATION_FLAG_ABS_OR_DELTA_UPDATE);
}
-static void update_dec_buf_info(struct rkvdec_decoded_buffer *buf,
- const struct v4l2_ctrl_vp9_frame *dec_params)
-{
- buf->vp9.width = dec_params->frame_width_minus_1 + 1;
- buf->vp9.height = dec_params->frame_height_minus_1 + 1;
- buf->vp9.bit_depth = dec_params->bit_depth;
-}
-
static void update_ctx_cur_info(struct rkvdec_vp9_ctx *vp9_ctx,
struct rkvdec_decoded_buffer *buf,
const struct v4l2_ctrl_vp9_frame *dec_params)
--
2.54.0
File diff suppressed because it is too large Load Diff
+69
View File
@@ -0,0 +1,69 @@
# patches/driver/media/
Scope-tagged kernel-agent patches that touch `drivers/media/` — third-party
video-codec enablement work that hasn't reached linux-media patchwork as
formal series yet, but is empirically known to work on our test hardware.
## 0001..0003 — Sarma's VP9 enablement on VDPU381 (RK3588 rkvdec)
Three patches from `D.V.A.B. Sarma <vdarbha0473@gmail.com>` adding VP9
decode support to the VDPU381 variant of rkvdec (the RK3588 generation).
| # | Subject | LOC | What |
|---|---------|----:|------|
| 0001 | rkvdec/vp9: rename get_ref_buf to get_ref_buf_vp9 | 10 | rename existing helper to avoid namespace collision with the upcoming HEVC equivalent |
| 0002 | rkvdec: move vp9 functions to common file | 172 | extract VP9 plumbing into `rkvdec-vp9-common.{c,h}` so VDPU381 can share with the older RK3399 backend |
| 0003 | rkvdec: add VP9 support for VDPU381 variant | 1303 | the actual VDPU381 VP9 backend — register defs + `rkvdec-vdpu381-vp9.c` + glue |
Combined: ~1500 LOC, 5 new files in `drivers/media/platform/rockchip/rkvdec/`.
### Upstream provenance
- Author maintains the work at https://github.com/dvab-sarma/android_kernel_rk_opi
branch `add-rkvdec-vdpu381-vp9-v8`.
- Collabora's blog post on RK3588/RK3576 video decoder mainline merge cites
the work but notes "v1 series needs to be sent for review soon" —
i.e. not yet on linux-media patchwork, no upstream timeline.
- Casanova's VDPU381+VDPU383 H.264/HEVC base (which these patches sit on top
of) IS in mainline 7.0 release.
- Patches do NOT modify any of our scope-tagged board / module / soc /
subsystem code paths — purely additive to the upstream rkvdec subdirectory.
### Tested on
- Author: Orange Pi 5 Pro board (RK3588), AOSP 16 + FFMPEG, Profile 0 + Profile 2
- Our fleet: build verified clean on `ampere` (CoolPi CM5 GenBook, RK3588)
2026-05-18 with KERNELRELEASE `7.0.0-rc3-vp9-test+` (base = running
`7.0.0-rc3-devices+` config + LOCALVERSION change + these 3 patches +
the pre-existing issue14 vb2-resv local mods). Full kernel image
+ DTB + modules + initramfs land at `/boot/firmware/*-7.0.0-rc3-vp9-test+`
and `/lib/modules/7.0.0-rc3-vp9-test+`. New extlinux label `arch_vp9_test`
added without touching default `arch_devices`. End-to-end VP9 decode
validation requires booting into `arch_vp9_test` (pending operator
confirmation, then `v4l2-ctl -d /dev/video1 --list-formats-out` should
list `VP9F` alongside `S265` + `S264`).
### Apply order
Strict — 0001 → 0002 → 0003. 0003 depends on the common-file refactor
from 0002, which depends on the helper rename in 0001.
### Removal criteria
Drop these patches when:
- Sarma sends a v1 series to linux-media and it lands upstream — adopt
the upstream version at the next baseline bump, OR
- Collabora produces an alternative VP9 enablement on their own
hardware-enablement/rockchip-3588 GitLab tree — prefer that lineage
(more likely to land cleanly upstream).
### How to use in a kernel-agent build
If `fleet/ampere.yaml` is bumped to include VP9 (currently scope-out per
the manifest preamble — "Asks #2 (VP9 enablement on RK3588 rkvdec) and
#3 (AV1 dec integration) from issue #6 are NOT addressed in this
manifest — tracked separately"), reference these three files in apply
order under the manifest's scope-tagged patch list.
Cross-references: `marfrit/kernel-agent#12` (the VP9-on-ampere enablement
issue).