From 843d40231f6914dd62c7eda238321a1c6b3b5e70 Mon Sep 17 00:00:00 2001 From: "Claude (noether)" Date: Fri, 8 May 2026 13:59:04 +0200 Subject: [PATCH 1/8] danctnix-besser: regen cumulative patch with bes_chardev.{c,h} merge fix Build (PID 558898 on boltzmann) failed at bes2600_btuart.c:81: error: implicit declaration of function 'bes2600_chrdev_switch_subsys_glb' Root cause: the original danctnix-flavor adaptation overlaid Mobian's heavily-trimmed bes_chardev.{c,h} on top of pristine danctnix. Mobian's flavor (694 lines) had stripped out the BT/WiFi subsystem-switch orchestration that pristine danctnix (1387 lines) carries and that danctnix-only bes2600_btuart.c calls. Fix: restore pristine danctnix bes_chardev.{c,h} as the baseline for those two files in the danctnix flavor, then reapply Mobian's campaign-relevant changes: - Patch G: SPDX-License-Identifier header + corrected attribution - Patch B: bes2600_chrdev_do_bus_reset + _trigger_bus_reset (definitions in bes_chardev.c, declarations in bes_chardev.h, EXPORT_SYMBOL_GPL on _trigger_bus_reset since it is called from sta.c connection-loss-storm fast-recover path) Phase 6 thread-safety contract: bus_reset functions read bes2600_cdev.{sbus_ops,sbus_priv} without locking, identical to the Mobian-flavor source-of-truth - acceptable given the bus_reset is invoked from already-serialized higher-level error paths in sta.c. 48 files unchanged in count, +1412/-1243 (was +1426/-2003). The delta vs the previous patch is concentrated in bes_chardev.{c,h}: +776/-16 in .c (restoring the BT/WiFi switching infrastructure plus appending Patch B), +2/-2 in .h (declarations + SPDX). Patch verified to apply cleanly to v7.0-danctnix1 baseline. b2sum updated in PKGBUILD. Build retrigger pending on his. Co-Authored-By: Claude Opus 4.7 (1M context) --- ...001-bes2600-besser-cumulative-series.patch | 927 +----------------- danctnix-besser-pkgbuild/kernel/PKGBUILD | 2 +- 2 files changed, 17 insertions(+), 912 deletions(-) diff --git a/danctnix-besser-pkgbuild/kernel/0001-bes2600-besser-cumulative-series.patch b/danctnix-besser-pkgbuild/kernel/0001-bes2600-besser-cumulative-series.patch index 7bf4b813f..a0adf6fd3 100644 --- a/danctnix-besser-pkgbuild/kernel/0001-bes2600-besser-cumulative-series.patch +++ b/danctnix-besser-pkgbuild/kernel/0001-bes2600-besser-cumulative-series.patch @@ -1,4 +1,4 @@ -From 777cbda9157951b6edbedfc8f3b0be8dc700ca3b Mon Sep 17 00:00:00 2001 +From 4e176b8f930373bc02382c903e6d739ab2d5fd47 Mon Sep 17 00:00:00 2001 From: Markus Fritsche Date: Fri, 8 May 2026 10:07:47 +0200 Subject: [PATCH] bes2600: BESser cumulative patch series (16 commits squashed) @@ -48,20 +48,20 @@ Signed-off-by: Markus Fritsche drivers/staging/bes2600/ap.c | 25 +- drivers/staging/bes2600/ap.h | 9 +- drivers/staging/bes2600/bes2600.h | 58 +- - drivers/staging/bes2600/bes2600_factory.c | 117 +-- + drivers/staging/bes2600/bes2600_factory.c | 117 ++- drivers/staging/bes2600/bes2600_factory.h | 12 +- drivers/staging/bes2600/bes2600_plat.h | 9 +- - drivers/staging/bes2600/bes2600_sdio.c | 268 ++++-- - drivers/staging/bes2600/bes_chardev.c | 837 ++---------------- - drivers/staging/bes2600/bes_chardev.h | 13 +- + drivers/staging/bes2600/bes2600_sdio.c | 268 +++++-- + drivers/staging/bes2600/bes_chardev.c | 65 +- + drivers/staging/bes2600/bes_chardev.h | 11 +- drivers/staging/bes2600/bes_fw.c | 43 +- drivers/staging/bes2600/bes_fw_common.c | 9 +- drivers/staging/bes2600/bes_fw_common.h | 9 +- drivers/staging/bes2600/bes_log.h | 30 + .../bes2600/bes_nl80211_testmode_msg.h | 9 +- - drivers/staging/bes2600/bes_pwr.c | 243 ++++- + drivers/staging/bes2600/bes_pwr.c | 243 +++++- drivers/staging/bes2600/bes_pwr.h | 33 +- - drivers/staging/bes2600/bh.c | 732 ++++----------- + drivers/staging/bes2600/bh.c | 732 ++++-------------- drivers/staging/bes2600/bh.h | 21 +- drivers/staging/bes2600/debug.c | 29 +- drivers/staging/bes2600/debug.h | 12 +- @@ -82,18 +82,18 @@ Signed-off-by: Markus Fritsche drivers/staging/bes2600/queue.c | 26 +- drivers/staging/bes2600/queue.h | 12 +- drivers/staging/bes2600/sbus.h | 31 +- - drivers/staging/bes2600/scan.c | 133 ++- + drivers/staging/bes2600/scan.c | 133 +++- drivers/staging/bes2600/scan.h | 23 +- drivers/staging/bes2600/sta.c | 204 +++-- drivers/staging/bes2600/sta.h | 12 +- drivers/staging/bes2600/tx_loop.c | 9 +- drivers/staging/bes2600/tx_loop.h | 9 +- - drivers/staging/bes2600/txrx.c | 168 +++- + drivers/staging/bes2600/txrx.c | 168 ++-- drivers/staging/bes2600/txrx.h | 12 +- drivers/staging/bes2600/wifi_testmode_cmd.c | 9 +- drivers/staging/bes2600/wsm.c | 29 +- drivers/staging/bes2600/wsm.h | 16 +- - 48 files changed, 1426 insertions(+), 2003 deletions(-) + 48 files changed, 1412 insertions(+), 1243 deletions(-) diff --git a/drivers/staging/bes2600/ap.c b/drivers/staging/bes2600/ap.c index 7b1e3b42c..16c0451e0 100644 @@ -1007,7 +1007,7 @@ index 13d4ff1e5..517e6f874 100644 return -EAGAIN; } diff --git a/drivers/staging/bes2600/bes_chardev.c b/drivers/staging/bes2600/bes_chardev.c -index f89dcb8fb..fe46fc569 100644 +index f89dcb8fb..5374d5117 100644 --- a/drivers/staging/bes2600/bes_chardev.c +++ b/drivers/staging/bes2600/bes_chardev.c @@ -1,12 +1,9 @@ @@ -1026,757 +1026,7 @@ index f89dcb8fb..fe46fc569 100644 */ #include #include -@@ -43,12 +40,6 @@ enum bus_probe_state { - }; - - struct bes_cdev { -- struct cdev cdev; -- dev_t dev_id; -- int major; -- int minor; -- struct class *class; -- struct device *device; - atomic_t num_proc; - wait_queue_head_t open_wq; - spinlock_t status_lock; -@@ -69,9 +60,6 @@ struct bes_cdev { - struct delayed_work probe_timeout_work; - enum bus_probe_state bus_probe; - struct work_struct wifi_force_close_work; --#ifdef BES2600_WRITE_DPD_TO_FILE -- int no_dpd; --#endif - enum pend_read_op read_flag; - enum wakeup_event wakeup_by_event; /* used to filter unwanted event wakeup reason report */ - u16 wakeup_state; /* for userspace check wakeup reason */ -@@ -91,9 +79,6 @@ struct bes2600_op_map { - - static struct bes_cdev bes2600_cdev; - module_param_named(fw_type, bes2600_cdev.fw_type, int, 0644); --#ifdef BES2600_WRITE_DPD_TO_FILE --module_param_named(no_dpd, bes2600_cdev.no_dpd, int, 0644); --#endif - - extern int bes2600_register_net_dev(struct sbus_priv *bus_priv); - extern int bes2600_unregister_net_dev(struct sbus_priv *bus_priv); -@@ -196,445 +181,19 @@ static int bes2600_switch_wifi(bool on) - return ret; - } - --static int bes2600_switch_bt(bool on) --{ -- int ret = 0; -- long status = 0; -- -- if (bes2600_cdev.bt_opened == on) -- return 0; -- -- if (on) { -- if (bes2600_chrdev_check_system_close()) { -- bes_devel("power up bes2600 when active bt.\n"); -- /* reset bus error status when restart bes2600 */ -- spin_lock(&bes2600_cdev.status_lock); -- bes2600_cdev.bus_error = false; -- bes2600_cdev.halt_dev = false; -- bes2600_cdev.bus_probe = BES2600_BUS_PROBE_NONE; -- spin_unlock(&bes2600_cdev.status_lock); -- -- /* set opend state in advance */ -- bes2600_cdev.bt_opened = true; -- bes2600_cdev.bton_pending = true; -- -- /* power up bes2600, trigger system to execute probe function */ -- bes2600_cdev.sbus_ops->power_switch(NULL, 1); -- -- /* wait bootup process end */ -- status = wait_event_timeout(bes2600_cdev.probe_done_wq, -- bes2600_bootup_end(), HZ * 8); -- WARN_ON(status <= 0); -- -- /* check if there is a error when bootup */ -- ret = (status <= 0 || bes2600_chrdev_is_bus_error()) ? -1 : 0; -- } else { -- bes_devel("bes2600 activate bt.\n"); -- ret = bes2600_chrdev_switch_subsys(GPIO_WAKE_FLAG_BT_ON, SUBSYSTEM_BT, true); -- } -- } else { -- bes_devel("bes2600 deactivate bt.\n"); -- bes2600_chrdev_switch_subsys(GPIO_WAKE_FLAG_BT_OFF, SUBSYSTEM_BT, false); -- } -- -- if (!ret) { -- bes2600_cdev.bt_opened = on; -- } else { -- bes2600_cdev.bt_opened = false; -- bes2600_cdev.bton_pending = false; -- if (ret) -- bes_info("open bt failed\n"); -- } -- -- return ret; --} -- --/* -- * This is a global function so we don't have to make many changes to -- * the driver. -- * -- * @wifi: 1 to turn on, 0 to turn off. Otherwise, leave unchanged -- * @bt: 1 to turn on, 0 to turn off. Otherwise, leave unchanged -- */ --int bes2600_chrdev_switch_subsys_glb(int wifi, int bt) --{ -- int ret = 0; -- -- switch (wifi) { -- case 0: -- ret = bes2600_switch_wifi(false); -- break; -- case 1: -- ret = bes2600_switch_wifi(true); -- break; -- default: -- break; -- } -- -- if (ret) -- goto result; -- -- switch (bt) { -- case 0: -- ret = bes2600_switch_bt(false); -- break; -- case 1: -- ret = bes2600_switch_bt(true); -- break; -- default: -- break; -- } -- --result: -- return ret; --} --EXPORT_SYMBOL_GPL(bes2600_chrdev_switch_subsys_glb); -- --static int bes2600_get_cmd_and_ifname(const char *str, char **result) --{ -- int cmd_len = 0; -- int ifname_len = 0; -- char *sp = NULL; -- char *tmp_ptr = NULL; -- char *cmd_ptr = NULL; -- -- /* check if input arguments is valid */ -- if (!str || strncmp(str, "ifname:", 7) != 0) -- return -1; - -- sp = strchr(str, ' '); -- if (strncmp(sp + 1, "cmd:", 4) != 0) -- return -1; - -- /* extract interface name */ -- ifname_len = sp - str - 7; -- tmp_ptr = kmalloc(ifname_len + 1, GFP_KERNEL); -- if (!tmp_ptr) { -- return -2; -- } - -- strncpy(tmp_ptr, str+7, ifname_len); -- tmp_ptr[ifname_len] = '\0'; -- result[0] = tmp_ptr; -- -- /* get command length */ -- cmd_ptr = strstr(str, "cmd:"); -- cmd_ptr += 4; -- sp = strchr(cmd_ptr, ' '); -- if (!sp) { /* the command don't have any parameter */ -- cmd_len = strlen(cmd_ptr); -- if (cmd_ptr[cmd_len - 1] == '\n') -- --cmd_len; -- } else { /* the command have one or more parameter */ -- cmd_len = sp - cmd_ptr; -- } - -- /* copy command to out buffer */ -- tmp_ptr = kmalloc( cmd_len + 1, GFP_KERNEL); -- if (!tmp_ptr) { -- kfree(result[0]); -- result[0] = NULL; -- return -3; -- } - -- strncpy(tmp_ptr, cmd_ptr, cmd_len); -- tmp_ptr[cmd_len] = '\0'; -- result[1] = tmp_ptr; - -- return 0; --} - --static void bes2600_recyle_cmd_and_ifname_mem(char **info) --{ -- if (info[0]) { -- kfree(info[0]); -- info[0] = NULL; -- } - -- if (info[1]) { -- kfree(info[1]); -- info[1] = NULL; -- } - --} -- --static int bes2600_op_default_handler(const char *str) --{ -- char *info[2] = {0}; -- -- if (bes2600_get_cmd_and_ifname(str, info) == 0) { -- bes_devel("cmd(%s) on %s not handled\n", info[1], info[0]); -- } else { -- bes_err("%s get command fail, the origin string is %s\n", __func__, str); -- } -- -- bes2600_recyle_cmd_and_ifname_mem(info); -- -- return 0; --} -- --static int bes2600_op_wifi_bt_on_off(const char *str) --{ -- char *info[2] = {0}; -- int ret = 0; -- enum wait_state wait_state; -- enum bus_probe_state probe_state; -- unsigned long status = 0; -- -- spin_lock(&bes2600_cdev.status_lock); -- probe_state = bes2600_cdev.bus_probe; -- wait_state = bes2600_cdev.wait_state; -- spin_unlock(&bes2600_cdev.status_lock); -- -- /* only work for wifi signal mode */ -- if (bes2600_cdev.fw_type != BES2600_FW_TYPE_WIFI_SIGNAL) -- return -EFAULT; -- -- /* wait bus probe operation end */ -- if (probe_state == BES2600_BUS_PROBE_START) { -- bes_devel("wait bus probe operation end\n"); -- status = wait_event_timeout(bes2600_cdev.probe_done_wq, -- (bes2600_cdev.bus_probe > BES2600_BUS_PROBE_START), -- HZ); -- WARN_ON(status <= 0); -- } -- -- /* must wait previous operation end in critical section */ -- if (wait_state != BES2600_BOOT_WAIT_NONE) { -- bes_devel("wait previous operation end\n"); -- status = wait_event_timeout(bes2600_cdev.probe_done_wq, -- (bes2600_cdev.wait_state == BES2600_BOOT_WAIT_NONE), -- HZ * 8); -- WARN_ON(status <= 0); -- } -- -- /* if dpd calibration is doing, modify wifi and bt state directly */ -- spin_lock(&bes2600_cdev.status_lock); -- if (bes2600_cdev.bus_probe == BES2600_BUS_PROBE_OK && !bes2600_cdev.dpd_calied) { -- if (bes2600_get_cmd_and_ifname(str, info) == 0) { -- if (strncmp(info[1], "WIFI_ON", 7) == 0) { -- bes2600_cdev.wifi_opened = true; -- } else if (strncmp(info[1], "WIFI_OFF", 8) == 0) { -- bes2600_cdev.wifi_opened = false; -- } else if (strncmp(info[1], "BT_ON", 5) == 0) { -- bes2600_cdev.bt_opened = true; -- bes2600_cdev.bton_pending = true; -- } else if (strncmp(info[1], "BT_OFF", 6) == 0) { -- bes2600_cdev.bt_opened = false; -- bes2600_cdev.bton_pending = false; -- } -- } -- bes2600_recyle_cmd_and_ifname_mem(info); -- spin_unlock(&bes2600_cdev.status_lock); -- -- /* wait probe done event */ -- status = wait_event_timeout(bes2600_cdev.probe_done_wq, -- bes2600_bootup_end(), HZ * 8); -- WARN_ON(status <= 0); -- -- return (status <= 0 || bes2600_chrdev_is_bus_error()) ? -EFAULT : 0; -- } -- spin_unlock(&bes2600_cdev.status_lock); -- -- /* process wifi/bt on/off operation */ -- if (bes2600_get_cmd_and_ifname(str, info) == 0) { -- if (strncmp(info[1], "WIFI_ON", 7) == 0) { -- ret = bes2600_switch_wifi(1); -- } else if (strncmp(info[1], "WIFI_OFF", 8) == 0) { -- ret = bes2600_switch_wifi(0); -- } else if (strncmp(info[1], "BT_ON", 5) == 0) { -- ret = bes2600_switch_bt(1); -- } else if (strncmp(info[1], "BT_OFF", 6) == 0) { -- ret = bes2600_switch_bt(0); -- } -- } -- -- if (!ret && bes2600_chrdev_check_system_close()) -- ret = bes2600_chrdev_do_system_close(bes2600_cdev.sbus_ops, -- bes2600_cdev.sbus_priv); -- -- bes2600_recyle_cmd_and_ifname_mem(info); -- -- return ret ; --} -- -- --static int bes2600_op_change_fw_type(const char *str) --{ -- int ret = 0; -- int temp = 0; -- long status = 0; -- char *cmd_ptr = NULL; -- char fw_type[5] = {0}; -- bool sys_closed = bes2600_chrdev_check_system_close(); -- -- bes_devel("%s is called, arg:%s\n", __func__, str); -- -- if (!bes2600_cdev.sbus_ops->power_switch && !bes2600_cdev.sbus_ops->reboot) -- return -EPERM; -- -- /* check if user input is valid */ -- cmd_ptr = strstr(str, "CHANGE_FW_TYPE "); -- if (strlen(str) < 16 || !cmd_ptr) { -- bes_err("the format of \"%s\" is error\n", str); -- return -EINVAL; -- } -- -- /* convert fw_type from string to int */ -- strncpy(fw_type, cmd_ptr + 14, 4); -- fw_type[0] = '+'; -- ret = kstrtoint(fw_type, 10, &temp); -- if (ret < 0) { -- bes_err("%s parse error\n", __func__); -- return -EINVAL; -- } -- -- /* no need to realod firmware if new fw_type is equal to the old */ -- if (temp == bes2600_cdev.fw_type ) { -- bes_devel("fw type is equal\n"); -- return 0; -- } -- -- /* close wifi net device */ -- if (bes2600_cdev.sbus_priv -- && bes2600_is_net_dev_created(bes2600_cdev.sbus_priv)) { -- bes2600_unregister_net_dev(bes2600_cdev.sbus_priv); -- } -- -- /* update firmware type */ -- bes2600_cdev.fw_type = temp; -- bes2600_chrdev_update_signal_mode(); -- -- if (!sys_closed) { -- /* close device to call disconnect function */ -- if (bes2600_cdev.sbus_ops->power_switch) -- bes2600_cdev.sbus_ops->power_switch(bes2600_cdev.sbus_priv, 0); -- else if (bes2600_cdev.sbus_ops->reboot) -- bes2600_cdev.sbus_ops->reboot(bes2600_cdev.sbus_priv); -- } -- -- if (bes2600_cdev.sbus_ops->reboot) -- bes2600_chrdev_start_bus_probe(); -- -- /* wait disconnect event */ -- status = wait_event_timeout(bes2600_cdev.probe_done_wq, (bes2600_cdev.sbus_priv == NULL), HZ * 10); -- WARN_ON(status <= 0); -- -- if (bes2600_cdev.dpd_calied -- && bes2600_chrdev_check_system_close()) { -- bes_devel("no need to reload firmware\n"); -- return 0; -- } -- -- bes_devel("reload firmware...\n"); -- /* power on device to call probe function */ -- if (bes2600_cdev.sbus_ops->power_switch) -- bes2600_cdev.sbus_ops->power_switch(NULL, 1); -- -- /* wait probe done event */ -- status = wait_event_timeout(bes2600_cdev.probe_done_wq, -- bes2600_bootup_end(), HZ * 10); -- WARN_ON(status <= 0); -- -- ret = (status <= 0 || bes2600_chrdev_is_bus_error()) ? -1 : 0; -- -- -- return ret; --} -- --static int bes2600_op_bt_wakeup(const char *str) --{ -- int ret = 0; -- unsigned long status = 0; -- -- spin_lock(&bes2600_cdev.status_lock); -- if (!bes2600_cdev.bt_opened) { -- spin_unlock(&bes2600_cdev.status_lock); -- return -EFAULT; -- } -- spin_unlock(&bes2600_cdev.status_lock); -- -- /* wait probe done event */ -- status = wait_event_timeout(bes2600_cdev.probe_done_wq, -- bes2600_bootup_end(), HZ * 8); -- if (status <= 0 || bes2600_chrdev_is_bus_error()) -- return -EFAULT; -- -- bes_devel("bes2600 wakeup bt.\n"); -- ret = bes2600_chrdev_switch_subsys(GPIO_WAKE_FLAG_BT_LP_ON, SUBSYSTEM_BT_LP, true); -- -- return ret; --} -- --static int bes2600_op_bt_sleep(const char *str) --{ -- int ret = 0; -- unsigned long status = 0; -- -- spin_lock(&bes2600_cdev.status_lock); -- if (!bes2600_cdev.bt_opened) { -- spin_unlock(&bes2600_cdev.status_lock); -- return -EFAULT; -- } -- spin_unlock(&bes2600_cdev.status_lock); -- -- /* wait probe done event */ -- status = wait_event_timeout(bes2600_cdev.probe_done_wq, -- bes2600_bootup_end(), HZ * 8); -- if (status <= 0 || bes2600_chrdev_is_bus_error()) -- return -EFAULT; -- -- bes_devel("bes2600 allow bt sleep.\n"); -- ret = bes2600_chrdev_switch_subsys(GPIO_WAKE_FLAG_BT_LP_OFF, SUBSYSTEM_BT_LP, false); -- -- return ret; --} -- --static int bes2600_op_set_wakeup_read_flag(const char *str) --{ -- bes_devel("%s is called, arg:%s\n", __func__, str); -- spin_lock(&bes2600_cdev.status_lock); -- bes2600_cdev.read_flag = BES_CDEV_READ_WAKEUP_STATE; -- spin_unlock(&bes2600_cdev.status_lock); -- -- return 0; --} - - #ifdef FW_DOWNLOAD_UART_DAEMON --int bes2600_load_uevent(char *env[]) --{ -- return kobject_uevent_env(&bes2600_cdev.device->kobj, KOBJ_CHANGE, env); --} - #endif - --static struct bes2600_op_map bes2600_op_map_tab[] ={ -- /*op op_len handler */ -- {"P2P_SET_NOA", 11, bes2600_op_default_handler}, -- {"P2P_SET_PS", 10, bes2600_op_default_handler}, -- {"SET_AP_WPS_P2P_IE", 17, bes2600_op_default_handler}, -- {"LINKSPEED", 9, bes2600_op_default_handler}, -- {"RSSI", 4, bes2600_op_default_handler}, -- {"GETBAND", 7, bes2600_op_default_handler}, -- {"WLS_BATCHING", 12, bes2600_op_default_handler}, -- {"MACADDR", 7, bes2600_op_default_handler}, -- {"RXFILTER-START", 14, bes2600_op_default_handler}, -- {"RXFILTER-STOP", 13, bes2600_op_default_handler}, -- {"RXFILTER-ADD", 12, bes2600_op_default_handler}, -- {"RXFILTER-REMOVE", 15, bes2600_op_default_handler}, -- {"BTCOEXMODE", 10, bes2600_op_default_handler}, -- {"BTCOEXSCAN-START", 16, bes2600_op_default_handler}, -- {"BTCOEXSCAN-STOP", 15, bes2600_op_default_handler}, -- {"SETSUSPENDMODE", 14, bes2600_op_default_handler}, -- {"COUNTRY", 7, bes2600_op_default_handler}, -- {"WIFI_ON", 7, bes2600_op_wifi_bt_on_off}, -- {"WIFI_OFF", 8, bes2600_op_wifi_bt_on_off}, -- {"BT_ON", 5, bes2600_op_wifi_bt_on_off}, -- {"BT_OFF", 6, bes2600_op_wifi_bt_on_off}, -- {"CHANGE_FW_TYPE", 14, bes2600_op_change_fw_type}, -- {"BT_WAKEUP", 9, bes2600_op_bt_wakeup}, -- {"BT_SLEEP", 8, bes2600_op_bt_sleep}, -- {"WAKEUP_STATE", 12, bes2600_op_set_wakeup_read_flag}, --}; - - static int bes2600_chrdev_check_system_close_internal(void) - { -@@ -644,255 +203,13 @@ static int bes2600_chrdev_check_system_close_internal(void) - && (bes2600_cdev.wifi_opened == false); - } - --static int bes2600_chrdev_open(struct inode *inode, struct file *filp) --{ -- if (atomic_read(&bes2600_cdev.num_proc) > 0) { -- wait_event_timeout(bes2600_cdev.open_wq, -- (atomic_read(&bes2600_cdev.num_proc) == 0), -- MAX_SCHEDULE_TIMEOUT); -- } -- -- bes_devel("bes2600 char device is opened\n"); -- atomic_inc(&bes2600_cdev.num_proc); -- -- return 0; --} -- --static ssize_t bes2600_chrdev_read(struct file *file, char __user *user_buf, -- size_t count, loff_t *ppos) --{ -- char buf[64] = {0}; -- unsigned int len; -- long status = 0; -- -- switch (bes2600_cdev.read_flag) { -- case BES_CDEV_READ_WAKEUP_STATE: -- if (bes2600_chrdev_wakeup_by_event_get() > WAKEUP_EVENT_NONE) { -- status = wait_event_timeout(bes2600_cdev.wakeup_reason_wq, -- bes2600_chrdev_wakeup_by_event_get() == WAKEUP_EVENT_NONE, HZ * 2); -- WARN_ON(status <= 0); -- } -- len = sprintf(buf, "wakeup_reason: %u, src_port: %u\n", -- bes2600_cdev.wakeup_state, bes2600_cdev.src_port); -- break; -- default: -- len = sprintf(buf, "dpd_calied:%d wifi_opened:%d bt_opened:%d fw_type:%d\n", -- bes2600_cdev.dpd_calied, -- bes2600_cdev.wifi_opened, -- bes2600_cdev.bt_opened, -- bes2600_cdev.fw_type); -- break; -- } -- -- len = sizeof(buf); -- /* reset read flag */ -- spin_lock(&bes2600_cdev.status_lock); -- bes2600_cdev.read_flag = BES_CDEV_READ_NUM_MAX; -- spin_unlock(&bes2600_cdev.status_lock); -- -- return simple_read_from_buffer(user_buf, count, ppos, buf, len); --} -- --static ssize_t bes2600_chrdev_write(struct file *file, -- const char __user *user_buf, size_t count, loff_t *ppos) --{ -- int i = 0; -- int cmd_num = ARRAY_SIZE(bes2600_op_map_tab); -- int cmd_len = 0; -- int ret = 0; -- char *info[2] = {0}; -- char *buf = NULL; -- -- /* copy content from user space to kernel */ -- /* message format:"ifname:wlanx cmd:xxx arg1 arg2 ..." */ -- buf = kmalloc(count + 1, GFP_KERNEL); -- if (copy_from_user(buf, user_buf, count)) -- return -EFAULT; -- -- /* add terminal character */ -- buf[count] = '\0'; -- -- /* extract comand and interface */ -- if (bes2600_get_cmd_and_ifname(buf, info) != 0) { -- bes_err("%s get command fail, the origin string is %s\n", __func__, buf); -- kfree(buf); -- return -EINVAL; -- } -- -- /* match operation item and execure its handler */ -- cmd_len = strlen(info[1]); -- for (i = 0; i < cmd_num; i++) { -- if (cmd_len < bes2600_op_map_tab[i].op_len) -- continue; -- -- if (strncasecmp(info[1], bes2600_op_map_tab[i].op, bes2600_op_map_tab[i].op_len) == 0) { -- ret = bes2600_op_map_tab[i].handler(buf); -- break; -- } -- } -- -- /* operation item mismatch */ -- if (i == cmd_num) { -- bes_err("cmd(%s) mismatch\n", info[1]); -- } -- -- bes2600_recyle_cmd_and_ifname_mem(info); -- kfree(buf); -- -- return (ret == 0) ? count : ret; --} -- --static int bes2600_chrdev_release (struct inode *inode, struct file *file) --{ -- if (atomic_dec_and_test(&bes2600_cdev.num_proc)) { -- wake_up(&bes2600_cdev.open_wq); -- } -- -- bes_devel("bes2600 char device is closed\n"); -- -- return 0; --} -- --static struct file_operations bes2600_chardev_fops = --{ -- .owner = THIS_MODULE, -- .open = bes2600_chrdev_open, -- .read = bes2600_chrdev_read, -- .write = bes2600_chrdev_write, -- .release = bes2600_chrdev_release, --}; -- --#ifdef BES2600_WRITE_DPD_TO_FILE --static int bes2600_chrdev_write_dpd_data_to_file(const char *path, void *buffer, int size) --{ -- int ret = 0; -- struct file *fp; -- -- if (buffer == NULL || size == 0) -- return 0; -- -- fp = filp_open(path, O_TRUNC | O_CREAT | O_RDWR, S_IRUSR); -- if (IS_ERR(fp)) { -- bes_err("BES2600 : can't open %s\n",path); -- return -1; -- } -- -- ret = kernel_write(fp, buffer, size, &fp->f_pos); -- if (ret < 0) -- bes_err("write dpd to file failed\n"); -- -- filp_close(fp,NULL); -- -- bes_devel("write dpd to %s\n", path); -- -- return ret; --} -- --static bool bes2600_chrdev_dpd_is_vaild(u8 *dpd_data) --{ -- u32 cal_crc = 0; -- u32 dpd_crc = le32_to_cpup((__le32 *)(dpd_data)); -- u32 dpd_ver = le32_to_cpup((__le32 *)(dpd_data + DPD_VERSION_OFFSET)); -- -- /* check version */ -- if (dpd_ver < DPD_CUR_VERSION) -- return false; -- -- cal_crc ^= 0xffffffffL; -- cal_crc = crc32_le(cal_crc, dpd_data + 4, DPD_BIN_SIZE - 4); -- cal_crc ^= 0xffffffffL; -- -- /* check if the dpd data is valid */ -- if (cal_crc != dpd_crc) { -- bes_err( -- "bes2600 dpd data from file check failed, calc_crc:0x%08x dpd_crc: 0x%08x\n", -- cal_crc, dpd_crc); -- return false; -- } -- -- return true; --} -- --static int bes2600_chrdev_read_and_check_dpd_data(const char *file, u8 **data, u32 *len) --{ -- int ret = 0; -- u8* read_data = NULL; -- struct file *fp; - -- /* open file */ -- fp = filp_open(file, O_RDONLY, 0);//S_IRUSR -- if (IS_ERR(fp)) { -- bes_devel("BES2600 : can't open %s\n",file); -- return -1; -- } - --#ifdef BES2600_WRITE_DPD_TO_FILE -- if (fp->f_inode->i_size != DPD_BIN_FILE_SIZE) { -- bes_err( -- "bes2600 dpd data file size check failed, read_size: %lld file_size: %d\n", -- fp->f_inode->i_size, DPD_BIN_FILE_SIZE); -- filp_close(fp, NULL); -- return -1; -- } --#endif -- -- /* allocate memory for storing reading data */ -- read_data = kmalloc(fp->f_inode->i_size, GFP_KERNEL); -- if (read_data == NULL) { -- bes_devel("%s alloc mem fail\n", __func__); -- goto err1; -- } -- -- /* read data from file */ -- ret = kernel_read(fp, read_data, fp->f_inode->i_size, &fp->f_pos); -- if (ret < DPD_BIN_SIZE) { -- bes_err("%s read fail, ret=%d\n", __func__, ret); -- goto err2; -- } -- -- /* check dpd version and crc */ -- if (!bes2600_chrdev_dpd_is_vaild(read_data)) -- goto err2; -- -- /* close file */ -- filp_close(fp, NULL); -- -- /* copy data to external */ -- *data = read_data; -- *len = DPD_BIN_SIZE;; -- -- /* output debug information */ -- bes_devel("read dpd data from %s\n", file); - -- return 0; - --err2: -- kfree(read_data); --err1: -- filp_close(fp, NULL); -- *data = NULL; -- *len = 0; -- return -1; --} --#endif - - const u8* bes2600_chrdev_get_dpd_data(u32 *len) - { --#ifdef BES2600_WRITE_DPD_TO_FILE -- if (!bes2600_cdev.dpd_calied && bes2600_cdev.no_dpd) { -- /* read dpd data from file that stores factory dpd calibration data */ -- if ((bes2600_chrdev_read_and_check_dpd_data(BES2600_DPD_GOLDEN_PATH, -- &bes2600_cdev.dpd_data, &bes2600_cdev.dpd_len) < 0) && -- (bes2600_chrdev_read_and_check_dpd_data(BES2600_DEFAULT_DPD_PATH, -- &bes2600_cdev.dpd_data, &bes2600_cdev.dpd_len) < 0)) { -- bes_err("%s read dpd data fail\n", __func__); -- return NULL; -- } else { -- bes2600_cdev.dpd_calied = true; -- } -- } --#endif -- - if (!bes2600_cdev.dpd_calied) - return NULL; - if (len) -@@ -953,14 +270,6 @@ int bes2600_chrdev_update_dpd_data(void) - } - spin_unlock(&bes2600_cdev.status_lock); - --#ifdef BES2600_WRITE_DPD_TO_FILE -- /* write dpd data to file */ -- memset(bes2600_cdev.dpd_data + DPD_BIN_SIZE, 0, DPD_BIN_FILE_SIZE - DPD_BIN_SIZE); -- bes2600_chrdev_write_dpd_data_to_file(BES2600_DPD_PATH, -- bes2600_cdev.dpd_data, DPD_BIN_FILE_SIZE); --#endif -- -- - return 0; - } - -@@ -1078,6 +387,60 @@ int bes2600_chrdev_do_system_close(const struct sbus_ops *sbus_ops, struct sbus_ +@@ -1078,6 +1075,62 @@ int bes2600_chrdev_do_system_close(const struct sbus_ops *sbus_ops, struct sbus_ return ret; } @@ -1821,6 +1071,7 @@ index f89dcb8fb..fe46fc569 100644 + + return 0; +} ++EXPORT_SYMBOL_GPL(bes2600_chrdev_do_bus_reset); + +/* + * Trigger bes2600_chrdev_do_bus_reset() against the file-global @@ -1833,149 +1084,13 @@ index f89dcb8fb..fe46fc569 100644 + return bes2600_chrdev_do_bus_reset(bes2600_cdev.sbus_ops, + bes2600_cdev.sbus_priv); +} ++EXPORT_SYMBOL_GPL(bes2600_chrdev_trigger_bus_reset); + bool bes2600_chrdev_is_wifi_opened(void) { bool wifi_opened = false; -@@ -1126,7 +489,6 @@ void bes2600_chrdev_wakeup_bt(void) - bes_err("Wakeup BT fail in resume\n"); - } - } --EXPORT_SYMBOL_GPL(bes2600_chrdev_wakeup_bt); - - int bes2600_chrdev_get_fw_type(void) - { -@@ -1148,7 +510,6 @@ bool bes2600_chrdev_is_bus_error(void) - - return error; - } --EXPORT_SYMBOL_GPL(bes2600_chrdev_is_bus_error); - - void bes2600_chrdev_update_signal_mode(void) - { -@@ -1167,12 +528,6 @@ void bes2600_chrdev_update_signal_mode(void) - - static void bes2600_chrdev_wifi_force_close_work(struct work_struct *work) - { -- char wifi_state[15]; -- char bt_state[15]; -- char fw_type[15]; -- char *env[] = { wifi_state, bt_state, fw_type, NULL }; -- int ret; -- - if (bes2600_chrdev_is_wifi_opened()) { - bes_devel("system exeception, force wifi down\n"); - -@@ -1184,19 +539,24 @@ static void bes2600_chrdev_wifi_force_close_work(struct work_struct *work) - /* unregister wifi */ - bes2600_switch_wifi(0); - -- /* power down device if wifi is only opened */ -- if (bes2600_chrdev_check_system_close()) { -+ /* -+ * Hard exception with a bus_reset implementation: tear the -+ * bus down via mmc_hw_reset() (or equivalent) so the next -+ * bringup probes a freshly reset chip. On PineTab2 this is -+ * the only effective recovery path -- the existing -+ * power_switch(0)/(1) sequence has no chip-reset signal of -+ * its own (sdio_pwrseq owns wifi_reset). -+ * -+ * Soft close, or hard close on a board without bus_reset: -+ * fall back to the legacy power_switch(0) sequence. -+ */ -+ if (bes2600_cdev.halt_dev && bes2600_cdev.sbus_ops->bus_reset) { -+ bes2600_chrdev_do_bus_reset(bes2600_cdev.sbus_ops, -+ bes2600_cdev.sbus_priv); -+ } else if (bes2600_chrdev_check_system_close()) { - bes2600_chrdev_do_system_close(bes2600_cdev.sbus_ops, - bes2600_cdev.sbus_priv); - } -- -- /* notify userspace */ -- snprintf(wifi_state, sizeof(wifi_state), "WIFI_OPENED=%d", bes2600_cdev.wifi_opened); -- snprintf(bt_state, sizeof(bt_state), "BT_OPENED=%d", bes2600_cdev.bt_opened); -- snprintf(fw_type, sizeof(fw_type), "FW_TYPE=%d", bes2600_cdev.fw_type); -- ret = kobject_uevent_env(&bes2600_cdev.device->kobj, KOBJ_CHANGE, env); -- if (!ret) -- bes_err("bes2600 notify userspace failed\n"); - } - } - -@@ -1290,46 +650,6 @@ int bes2600_chrdev_wakeup_by_event_get(void) - - int bes2600_chrdev_init(struct sbus_ops *ops) - { -- int ret = 0; -- -- /* allocate devide id */ -- ret = alloc_chrdev_region(&bes2600_cdev.dev_id, 0, 1, "bes2600_chrdev"); -- if (ret < 0){ -- bes_err("bes2600 alloc device id fail\n"); -- ret = -EFAULT; -- goto fail; -- } -- -- /* extract major and minor device id */ -- bes2600_cdev.major = MAJOR(bes2600_cdev.dev_id); -- bes2600_cdev.minor = MINOR(bes2600_cdev.dev_id); -- -- /* add char device and bind operation function */ -- bes2600_cdev.cdev.owner = THIS_MODULE; -- cdev_init(&bes2600_cdev.cdev, &bes2600_chardev_fops); -- ret = cdev_add(&bes2600_cdev.cdev, bes2600_cdev.dev_id, 1); -- if (ret < 0){ -- bes_err("bes2600 char device add fail\n"); -- ret = -EFAULT; -- goto fail1; -- } -- -- /* create class for creating device node */ -- bes2600_cdev.class = class_create("bes2600_chrdev"); -- if (IS_ERR(bes2600_cdev.class)){ -- bes_err("bes2600 char device add fail\n"); -- ret = -EFAULT; -- goto fail2; -- } -- -- /* get char device pointer */ -- bes2600_cdev.device = device_create(bes2600_cdev.class, NULL, bes2600_cdev.dev_id, NULL, "bes2600"); -- if (IS_ERR(bes2600_cdev.device)){ -- bes_err("bes2600 char device create fail\n"); -- ret = -EFAULT; -- goto fail3; -- } -- - /* initialise global variable */ - atomic_set(&bes2600_cdev.num_proc, 0); - init_waitqueue_head(&bes2600_cdev.open_wq); -@@ -1361,15 +681,6 @@ int bes2600_chrdev_init(struct sbus_ops *ops) - bes_devel("%s done\n", __func__); - - return 0; -- --fail3: -- class_destroy(bes2600_cdev.class); --fail2: -- cdev_del(&bes2600_cdev.cdev); --fail1: -- unregister_chrdev_region(bes2600_cdev.dev_id, 1); --fail: -- return ret; - } - - void bes2600_chrdev_free(void) -@@ -1379,9 +690,5 @@ void bes2600_chrdev_free(void) - bes2600_free_dpd_log_buffer(); - #endif - bes2600_chrdev_free_dpd_data(); -- cdev_del(&bes2600_cdev.cdev); -- unregister_chrdev_region(bes2600_cdev.dev_id, 1); -- device_destroy(bes2600_cdev.class, bes2600_cdev.dev_id); -- class_destroy(bes2600_cdev.class); - bes_devel("%s done\n", __func__); - } diff --git a/drivers/staging/bes2600/bes_chardev.h b/drivers/staging/bes2600/bes_chardev.h -index c627bb7c3..9cd994cf2 100644 +index c627bb7c3..9edb2067a 100644 --- a/drivers/staging/bes2600/bes_chardev.h +++ b/drivers/staging/bes2600/bes_chardev.h @@ -1,12 +1,9 @@ @@ -1994,7 +1109,7 @@ index c627bb7c3..9cd994cf2 100644 */ #ifndef __BES_CHARDEV_H__ #define __BES_CHARDEV_H__ -@@ -60,10 +57,11 @@ struct sbus_priv *bes2600_chrdev_get_sbus_priv_data(void); +@@ -60,6 +57,8 @@ struct sbus_priv *bes2600_chrdev_get_sbus_priv_data(void); /* used to control device power down */ int bes2600_chrdev_check_system_close(void); int bes2600_chrdev_do_system_close(const struct sbus_ops *sbus_ops, struct sbus_priv *priv); @@ -2003,16 +1118,6 @@ index c627bb7c3..9cd994cf2 100644 void bes2600_chrdev_wakeup_bt(void); void bes2600_chrdev_wifi_force_close(struct bes2600_common *hw_priv, bool halt_dev); void bes2600_chrdev_usb_remove(struct bes2600_common *hw_priv); --int bes2600_chrdev_switch_subsys_glb(int wifi, int bt); - - /* get and set internal state */ - bool bes2600_chrdev_is_wifi_opened(void); -@@ -92,4 +90,5 @@ u8* bes2600_alloc_dpd_log_buffer(u16 len); - void bes2600_get_dpd_log(char **data, size_t *len); - #endif - -+ - #endif /* __BES_CHARDEV_H__ */ diff --git a/drivers/staging/bes2600/bes_fw.c b/drivers/staging/bes2600/bes_fw.c index 133c9453b..6c5598b94 100644 --- a/drivers/staging/bes2600/bes_fw.c diff --git a/danctnix-besser-pkgbuild/kernel/PKGBUILD b/danctnix-besser-pkgbuild/kernel/PKGBUILD index 60e77b824..76e2492b3 100644 --- a/danctnix-besser-pkgbuild/kernel/PKGBUILD +++ b/danctnix-besser-pkgbuild/kernel/PKGBUILD @@ -50,7 +50,7 @@ b2sums=('3d9795083c8938f80f480de0d10bfd9c525640e59d5c7f22983de3f12ee42c84c31be90 'SKIP' '71fe98221e802b315e54b4b10d3e8c8f376695a36bae3541d876e5776a37f3fa33c8f8dfa6e51fcbd6f5396add02e5166634165f2351836a0ea0453c172fe56c' 'SKIP' - '93fa699a467ed671632eae6e4b47cd544b1a591619d58a33e9be9fa3a77d21e108a57847517138b43ee12efbc11cd1ad848d14673ea4224b3d516783a0b5b0e7' + 'fca0a5badf762d5dbc085261cccc07ddeef96384d2ae0a426fb0412acd7a180e068cabd59f01342b7575d41889afc0f47dfbc9256801ab809f746278e6dab510' '19c35c69a4ed40635fb6ad108d2e0ed3d0edc682972255b4a9b719d09e377aa916e533b2e29f4aed256d3a393d77df9e11b661b690acd96edcf61eafe016f55b') export KBUILD_BUILD_HOST=archlinux -- 2.47.3 From 0f783a1e6982c7f6b10389a6d4ed494901949bed Mon Sep 17 00:00:00 2001 From: "Claude (noether)" Date: Fri, 8 May 2026 15:08:16 +0200 Subject: [PATCH 2/8] danctnix-besser PKGBUILD polish: drop-in replacement metadata + DTB strip fix (1) Add `provides=("linux-pinetab2=$pkgver-$pkgrel")` and `conflicts=(linux-pinetab2)` so pacman -U cleanly replaces the upstream linux-pinetab2 package without needing --overwrite for the shared rk3566-pinetab2-*.dtb files. Verified end-to-end on ohm 2026-05-08: with these declarations pacman would refuse coexistence (matching the actual filesystem reality - both packages own the same DTB paths) and accept upgrade when removing the old package. Keeping `replaces=(wireguard-arch)` from upstream linux-pinetab2. Not adding linux-pinetab2 to replaces= since the soft-upstream intent is opt-in sidegrade, not auto-install on -Syu. (2) Replace the bash for-loop DTB strip with find -delete. The original loop silently no-op'd during the makepkg-fakeroot package() phase: build verification of the published .pkg.tar.zst showed 236 DTBs, 234 of them unrelated boards (px30-*, rk3308-*, rk3328-*, rk3399-*, etc). Root cause not pinned down (suspected nullglob or cwd interaction), but find -mindepth 1 -maxdepth 1 ! -name 'rk3566-pinetab2-*' -delete is robust to that environment and correctly identifies 2 to keep / 234 to remove on the existing pkgdir. Net pkg size impact: ~5 MB reduction (most non-pinetab2 DTBs are 20-40 KB). No kernel rebuild required - PKGBUILD-only metadata + package() logic change. Will take effect on the next makepkg run. Co-Authored-By: Claude Opus 4.7 (1M context) --- danctnix-besser-pkgbuild/kernel/PKGBUILD | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/danctnix-besser-pkgbuild/kernel/PKGBUILD b/danctnix-besser-pkgbuild/kernel/PKGBUILD index 76e2492b3..64eb1c01a 100644 --- a/danctnix-besser-pkgbuild/kernel/PKGBUILD +++ b/danctnix-besser-pkgbuild/kernel/PKGBUILD @@ -103,7 +103,9 @@ _package() { provides=( KSMBD-MODULE WIREGUARD-MODULE + "linux-pinetab2=$pkgver-$pkgrel" ) + conflicts=(linux-pinetab2) replaces=( wireguard-arch ) @@ -126,12 +128,12 @@ _package() { echo "Installing device trees..." make INSTALL_DTBS_PATH="$pkgdir/boot/dtbs" dtbs_install - # Removing unnecessary device tree - for dtb in "$pkgdir"/boot/dtbs/rockchip/*; do - [[ $dtb = *-pinetab2-* ]] && continue - echo "Removing $(basename "$dtb")" - rm "$dtb" - done + # Removing unnecessary device trees (keep only pinetab2 variants). + # Use find -delete instead of a bash for-loop: the previous for-loop + # silently no-op'd in the makepkg environment, leaving 234 unrelated + # board DTBs in the package. find is robust to nullglob/cwd quirks. + find "$pkgdir"/boot/dtbs/rockchip/ -mindepth 1 -maxdepth 1 -type f \ + ! -name 'rk3566-pinetab2-*' -delete # remove build link rm "$modulesdir"/build -- 2.47.3 From 693e9b42aa41166f4a24d1fa840d62c46c362fd7 Mon Sep 17 00:00:00 2001 From: "Claude (noether)" Date: Fri, 8 May 2026 17:31:35 +0200 Subject: [PATCH 3/8] danctnix-besser README: install/verify/rollback + per-patch source link Two readiness gaps surfaced after the end-to-end install verification on ohm 2026-05-08: (1) The "Building" section was a one-liner ("makepkg -s ... pacman -U ... reboot") with no actual install commands. Replaced with proper Building / Installing / Verifying / Rolling back sections, using the exact commands that worked end-to-end on ohm: - sudo pacman -U - The new conflicts/provides metadata means no --overwrite needed - PineTab2 U-Boot script update via /boot/boot.txt + mkscr - Off-device backup (boot.scr.pre-besser) for trivial rollback - Post-reboot checks: uname -r, lsmod, /sys/module/bes2600/srcversion (2) The "What's in the patchset" table listed Patch G / Patch B / etc. without linking to the actual commits. Added a preamble pointer to the cleanups branch on marfrit/bes2600-dkms gitea, which is the source-of-truth for individual commits + Phase-7 verification logs. Co-Authored-By: Claude Opus 4.7 (1M context) --- danctnix-besser-pkgbuild/README.md | 65 +++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/danctnix-besser-pkgbuild/README.md b/danctnix-besser-pkgbuild/README.md index 23acccb72..dfdaa0c00 100644 --- a/danctnix-besser-pkgbuild/README.md +++ b/danctnix-besser-pkgbuild/README.md @@ -6,7 +6,9 @@ Drop-in replacement for `linux-pinetab2`. Same kernel version, same config, same ## What's in the patchset -A 16-commit cumulative diff over `v7.0-danctnix1`'s in-tree `drivers/staging/bes2600/`, capturing: +A 16-commit cumulative diff over `v7.0-danctnix1`'s in-tree `drivers/staging/bes2600/`, capturing the patch groups below. + +Individual commits with full rationale + Phase-7 verification logs live on the **`cleanups` branch** of [`marfrit/bes2600-dkms`](https://git.reauktion.de/marfrit/bes2600-dkms/commits/branch/cleanups) — this PKGBUILD ships them squashed (one cumulative diff) for build atomicity. | group | what it does | |---|---| @@ -45,7 +47,66 @@ A 16-commit cumulative diff over `v7.0-danctnix1`'s in-tree `drivers/staging/bes makepkg -s ``` -Identical workflow to upstream `linux-pinetab2`. Flash the resulting `.pkg.tar.zst` via `pacman -U`. Reboot to load. +Identical workflow to upstream `linux-pinetab2`. Produces `linux-pinetab2-danctnix-besser--aarch64.pkg.tar.zst` plus a matching `-headers` package. Build host can be aarch64 native (recommended — no cross-toolchain setup) or x86 with an aarch64 cross-compiler. + +Build time: ~45–55 min on an 8-core aarch64 host (boltzmann/RPi5-class), most of it the kernel modules phase. + +## Installing + +The package declares `provides=("linux-pinetab2=$pkgver-$pkgrel")` and `conflicts=(linux-pinetab2)`, so `pacman` will cleanly take over from upstream `linux-pinetab2`: + +```sh +sudo pacman -U linux-pinetab2-danctnix-besser-7.0.danctnix1-1-aarch64.pkg.tar.zst +``` + +That removes the upstream `linux-pinetab2` package (if installed) and registers the BESser-flavored kernel under the same provides slot. Headers package is optional; install it if you build out-of-tree modules. + +The pacman `mkinitcpio` hook auto-generates `/boot/initramfs-linux-pinetab2-danctnix-besser.img`. Modules land in `/usr/lib/modules/-pinetab2-danctnix-besser/`, vmlinuz at `/boot/vmlinuz-linux-pinetab2-danctnix-besser`, DTBs at `/boot/dtbs/rockchip/rk3566-pinetab2-{v0.1,v2.0}.dtb`. + +### Bootloader (PineTab2-specific) + +PineTab2 boots via U-Boot loading a script `boot.scr` (compiled from `/boot/boot.txt` via `mkscr`). After install, point the script at the new kernel + initramfs: + +```sh +sudo cp /boot/boot.txt /boot/boot.txt.pre-besser +sudo cp /boot/boot.scr /boot/boot.scr.pre-besser +sudo sed -i \ + -e 's|/vmlinuz-linux-pinetab2$|/vmlinuz-linux-pinetab2-danctnix-besser|' \ + -e 's|/initramfs-linux-pinetab2\.img|/initramfs-linux-pinetab2-danctnix-besser.img|' \ + /boot/boot.txt +cd /boot && sudo ./mkscr +sudo systemctl reboot +``` + +Backups (`*.pre-besser`) let you revert without touching the U-Boot console: `sudo cp /boot/boot.scr.pre-besser /boot/boot.scr` and reboot. + +## Verifying + +After reboot: + +```sh +uname -r +# expected: -pinetab2-danctnix-besser + +lsmod | grep -i bes2600 +# expected: bes2600 (loaded), bes2600_btuart (loaded if Bluetooth in use) + +cat /sys/module/bes2600/srcversion +# expected: a srcversion distinct from the upstream linux-pinetab2 module +``` + +`dmesg | grep bes2600` should show clean firmware load, no SDIO TX panic, no `wsm_release_tx_buffer` WARN storm under load. + +## Rolling back + +If the new kernel misbehaves: + +```sh +sudo cp /boot/boot.scr.pre-besser /boot/boot.scr +sudo systemctl reboot +``` + +That returns you to whatever kernel `boot.scr` was pointing at before the install (typically upstream `linux-pinetab2` or the previous `linux-pinetab2-danctnix-besser`). The package itself can be removed with `sudo pacman -R linux-pinetab2-danctnix-besser` and the original `linux-pinetab2` re-installed via `sudo pacman -S linux-pinetab2`. ## Soft-upstream intent -- 2.47.3 From ae175f9745dd3a2865f4d449e751fbb0af8781eb Mon Sep 17 00:00:00 2001 From: "Claude (noether)" Date: Mon, 18 May 2026 11:28:33 +0200 Subject: [PATCH 4/8] =?UTF-8?q?danctnix-besser:=20ship=20patch=200002=20?= =?UTF-8?q?=E2=80=94=20filter=205=20GHz=20scans=20at=20driver=20boundary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds 0002-bes2600-filter-5ghz-scan.patch on top of the existing cumulative series, addressing besser issue #1 (recurring wsm_generic_confirm 0x0007 / [SCAN] Scan failed (-22) pattern). The fix refuses 5 GHz hw_scan iterations in bes2600_hw_scan; the firmware-reject cascade for the 5 GHz leg of mac80211's per-band hw_scan loop is short-circuited. Source-of-truth commit lives on marfrit/bes2600-dkms branch bes2600/scan-filter-5ghz (sha 093a503). Predicted Phase 7 delta: Pattern A rate 14/h -> 0/h. See besser#1 comment 1171 for the full Phase 0-4 analysis and Phase 5 review. pkgrel bumped to 2. --- .../0002-bes2600-filter-5ghz-scan.patch | 91 +++++++++++++++++++ danctnix-besser-pkgbuild/kernel/PKGBUILD | 4 +- 2 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 danctnix-besser-pkgbuild/kernel/0002-bes2600-filter-5ghz-scan.patch diff --git a/danctnix-besser-pkgbuild/kernel/0002-bes2600-filter-5ghz-scan.patch b/danctnix-besser-pkgbuild/kernel/0002-bes2600-filter-5ghz-scan.patch new file mode 100644 index 000000000..444737813 --- /dev/null +++ b/danctnix-besser-pkgbuild/kernel/0002-bes2600-filter-5ghz-scan.patch @@ -0,0 +1,91 @@ +From 093a5038b8b68f316d976b7cb69609ca7f24f322 Mon Sep 17 00:00:00 2001 +From: Markus Fritsche +Date: Mon, 18 May 2026 11:27:40 +0200 +Subject: [PATCH] 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 + diff --git a/danctnix-besser-pkgbuild/kernel/PKGBUILD b/danctnix-besser-pkgbuild/kernel/PKGBUILD index 64eb1c01a..b7d76479c 100644 --- a/danctnix-besser-pkgbuild/kernel/PKGBUILD +++ b/danctnix-besser-pkgbuild/kernel/PKGBUILD @@ -11,7 +11,7 @@ pkgbase=linux-pinetab2-danctnix-besser pkgver=7.0.danctnix1 -pkgrel=1 +pkgrel=2 pkgdesc='PineTab2 (BESser bes2600 driver patchset)' _srcname=linux-pinetab2 _srctag=v${pkgver%.*}-${pkgver##*.} @@ -39,6 +39,7 @@ source=( https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/linux-${pkgver%.*}.tar.{xz,sign} ${_url_git}/releases/download/${_srctag}/${_srctag}.patch.zst{,.sig} 0001-bes2600-besser-cumulative-series.patch + 0002-bes2600-filter-5ghz-scan.patch config # the main kernel config file ) validpgpkeys=( @@ -51,6 +52,7 @@ b2sums=('3d9795083c8938f80f480de0d10bfd9c525640e59d5c7f22983de3f12ee42c84c31be90 '71fe98221e802b315e54b4b10d3e8c8f376695a36bae3541d876e5776a37f3fa33c8f8dfa6e51fcbd6f5396add02e5166634165f2351836a0ea0453c172fe56c' 'SKIP' 'fca0a5badf762d5dbc085261cccc07ddeef96384d2ae0a426fb0412acd7a180e068cabd59f01342b7575d41889afc0f47dfbc9256801ab809f746278e6dab510' + '7efbd3e09f2d37aa1ed185f24775fab76b31036c7eab76f7b0a7950a24b0439c5978afcae80feb248d3e7776fa04e34ffe412a3073cc40677679f77cb18be433' '19c35c69a4ed40635fb6ad108d2e0ed3d0edc682972255b4a9b719d09e377aa916e533b2e29f4aed256d3a393d77df9e11b661b690acd96edcf61eafe016f55b') export KBUILD_BUILD_HOST=archlinux -- 2.47.3 From 122582e2706b2f4bf136e06f443a7b30cd2782d2 Mon Sep 17 00:00:00 2001 From: "Claude (noether)" Date: Mon, 18 May 2026 15:57:05 +0200 Subject: [PATCH 5/8] =?UTF-8?q?danctnix-besser:=20pkgrel=3D3=20=E2=80=94?= =?UTF-8?q?=20refine=20Patch=20I,=20add=20SCS-off=20+=20GCC15=20workaround?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three things bundled because they were verified together in the same deploy cycle on ohm (kernel built fresh on boltzmann 2026-05-18): 1. 0002 (Patch I) refined: refuse only multi-channel 5 GHz scans (n_channels > 1). Original Patch I refused everything, which blocked NM's per-frequency BSS discovery and made 5 GHz association impossible. Tighter guard preserves the storm fix and unblocks 5 GHz attachment via NM 802-11-wireless.band=a profiles. Verified on ohm with pkgrel=3: associated to BSSID c0:25:06:e6:5b:33 on 5240 MHz (ch.48), TX 150 Mbit/s MCS 7 HT40 short-GI vs 72.2 Mbit/s on 2.4 GHz. Pattern A still 0. Source-of-truth: marfrit/bes2600-dkms branch bes2600/scan-filter-5ghz commits 093a503 + 8cd10f4 (squashed into this single 0002 file). 2. 0003 (new): arm64 xor-neon Makefile workaround for GCC 15.2.1 strict pragma validator vs arm_neon.h target() blocks losing -ffixed-x18 under SCS=y. This is a defensive workaround; currently dead-coded (SCS=n below) but in place for the day SCS re-enable becomes possible (tracked in besser#20). 3. config: CONFIG_SHADOW_CALL_STACK=n override for the current GCC 15.2.1 toolchain issue. Restore to =y once GCC upstream fixes the arm_neon.h pragma interaction (besser#20). pkgrel bumped 2 -> 3. Refs: besser#1 (closed), besser#20, kernel-agent#25 (PR mirroring this into the kernel-agent patch tree — needs follow-up to pick up the refinement). --- .../0002-bes2600-filter-5ghz-scan.patch | 79 ++++++++++++++++++- ...-arm64-xor-neon-ffixed-x18-build-fix.patch | 36 +++++++++ danctnix-besser-pkgbuild/kernel/PKGBUILD | 10 ++- danctnix-besser-pkgbuild/kernel/config | 2 +- 4 files changed, 122 insertions(+), 5 deletions(-) create mode 100644 danctnix-besser-pkgbuild/kernel/0003-arm64-xor-neon-ffixed-x18-build-fix.patch diff --git a/danctnix-besser-pkgbuild/kernel/0002-bes2600-filter-5ghz-scan.patch b/danctnix-besser-pkgbuild/kernel/0002-bes2600-filter-5ghz-scan.patch index 444737813..76df11789 100644 --- a/danctnix-besser-pkgbuild/kernel/0002-bes2600-filter-5ghz-scan.patch +++ b/danctnix-besser-pkgbuild/kernel/0002-bes2600-filter-5ghz-scan.patch @@ -1,7 +1,8 @@ From 093a5038b8b68f316d976b7cb69609ca7f24f322 Mon Sep 17 00:00:00 2001 From: Markus Fritsche Date: Mon, 18 May 2026 11:27:40 +0200 -Subject: [PATCH] bes2600: filter 5 GHz scans at the driver boundary (besser#1) +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 @@ -89,3 +90,79 @@ index fb1d298..a81afb6 100644 -- 2.54.0 + +From 8cd10f487c8144d462a510812ba0fa717b3e24df Mon Sep 17 00:00:00 2001 +From: Markus Fritsche +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 + diff --git a/danctnix-besser-pkgbuild/kernel/0003-arm64-xor-neon-ffixed-x18-build-fix.patch b/danctnix-besser-pkgbuild/kernel/0003-arm64-xor-neon-ffixed-x18-build-fix.patch new file mode 100644 index 000000000..a2648068d --- /dev/null +++ b/danctnix-besser-pkgbuild/kernel/0003-arm64-xor-neon-ffixed-x18-build-fix.patch @@ -0,0 +1,36 @@ +From: Markus Fritsche +Date: Mon, 18 May 2026 11:42:00 +0200 +Subject: [PATCH] arm64: xor-neon: restore -ffixed-x18 when SHADOW_CALL_STACK=y + (GCC 15+ build fix) + +GCC 15.2.1 enforces that -fsanitize=shadow-call-stack requires +-ffixed-x18 inside arm_neon.h's #pragma GCC target() blocks. The +existing CFLAGS_REMOVE_xor-neon.o line strips the kernel-wide +-ffixed-x18 (it's part of CC_FLAGS_NO_FPU) and CC_FLAGS_FPU does not +restore it, so xor-neon.c fails to build on stricter GCC versions +when CONFIG_SHADOW_CALL_STACK=y. + +Add an explicit -ffixed-x18 just for this object, gated on the +SCS config so non-SCS builds are unaffected. + +Build environment workaround; not a kernel-runtime bug. +--- + arch/arm64/lib/Makefile | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/arch/arm64/lib/Makefile b/arch/arm64/lib/Makefile +index 1234567..2345678 100644 +--- a/arch/arm64/lib/Makefile ++++ b/arch/arm64/lib/Makefile +@@ -9,6 +9,10 @@ ifeq ($(CONFIG_KERNEL_MODE_NEON), y) + obj-$(CONFIG_XOR_BLOCKS) += xor-neon.o + CFLAGS_xor-neon.o += $(CC_FLAGS_FPU) + CFLAGS_REMOVE_xor-neon.o += $(CC_FLAGS_NO_FPU) ++# GCC 15+ enforces that -fsanitize=shadow-call-stack requires -ffixed-x18 ++# even after a #pragma GCC pop_options inside arm_neon.h. CC_FLAGS_REMOVE ++# above strips the kernel-wide -ffixed-x18 (part of CC_FLAGS_NO_FPU); add ++# it back here so xor-neon.c still compiles when SHADOW_CALL_STACK=y. ++CFLAGS_xor-neon.o += $(if $(CONFIG_SHADOW_CALL_STACK),-ffixed-x18) + endif + + lib-$(CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE) += uaccess_flushcache.o diff --git a/danctnix-besser-pkgbuild/kernel/PKGBUILD b/danctnix-besser-pkgbuild/kernel/PKGBUILD index b7d76479c..1c69c58d5 100644 --- a/danctnix-besser-pkgbuild/kernel/PKGBUILD +++ b/danctnix-besser-pkgbuild/kernel/PKGBUILD @@ -11,7 +11,7 @@ pkgbase=linux-pinetab2-danctnix-besser pkgver=7.0.danctnix1 -pkgrel=2 +pkgrel=3 pkgdesc='PineTab2 (BESser bes2600 driver patchset)' _srcname=linux-pinetab2 _srctag=v${pkgver%.*}-${pkgver##*.} @@ -40,6 +40,8 @@ source=( ${_url_git}/releases/download/${_srctag}/${_srctag}.patch.zst{,.sig} 0001-bes2600-besser-cumulative-series.patch 0002-bes2600-filter-5ghz-scan.patch + 0003-arm64-xor-neon-ffixed-x18-build-fix.patch + 0003-arm64-xor-neon-ffixed-x18-build-fix.patch config # the main kernel config file ) validpgpkeys=( @@ -52,8 +54,10 @@ b2sums=('3d9795083c8938f80f480de0d10bfd9c525640e59d5c7f22983de3f12ee42c84c31be90 '71fe98221e802b315e54b4b10d3e8c8f376695a36bae3541d876e5776a37f3fa33c8f8dfa6e51fcbd6f5396add02e5166634165f2351836a0ea0453c172fe56c' 'SKIP' 'fca0a5badf762d5dbc085261cccc07ddeef96384d2ae0a426fb0412acd7a180e068cabd59f01342b7575d41889afc0f47dfbc9256801ab809f746278e6dab510' - '7efbd3e09f2d37aa1ed185f24775fab76b31036c7eab76f7b0a7950a24b0439c5978afcae80feb248d3e7776fa04e34ffe412a3073cc40677679f77cb18be433' - '19c35c69a4ed40635fb6ad108d2e0ed3d0edc682972255b4a9b719d09e377aa916e533b2e29f4aed256d3a393d77df9e11b661b690acd96edcf61eafe016f55b') + '396acbdcf570eada62533c0b8f505ed18077e8432249bab5b8ac8d1107cabc9489bdb91a5780446237ec4fd9ba5fc57a49dff34c16ddab60dc30513fc535f00f' + '2714e3c0cd8ec978ce9431418f44f578220886fcabb738c9a0c43fc3c043753960b7c47ae96e1780154d8b266a2add6098407de4ffa7aee40d77ce17e8c70df9' + '2714e3c0cd8ec978ce9431418f44f578220886fcabb738c9a0c43fc3c043753960b7c47ae96e1780154d8b266a2add6098407de4ffa7aee40d77ce17e8c70df9' + '656a998ab40cb85ee4c00f087b071a91632a6c091da2c84b0f74236b51d2dea6e9db6886625f80ad81dc249d8494ec47cd79d6dd9ea4f5e44f3cde857f861e10') export KBUILD_BUILD_HOST=archlinux export KBUILD_BUILD_USER=$pkgbase diff --git a/danctnix-besser-pkgbuild/kernel/config b/danctnix-besser-pkgbuild/kernel/config index 6be8a3c87..198a359d1 100644 --- a/danctnix-besser-pkgbuild/kernel/config +++ b/danctnix-besser-pkgbuild/kernel/config @@ -791,7 +791,7 @@ CONFIG_HAVE_STACKPROTECTOR=y CONFIG_STACKPROTECTOR=y CONFIG_STACKPROTECTOR_STRONG=y CONFIG_ARCH_SUPPORTS_SHADOW_CALL_STACK=y -CONFIG_SHADOW_CALL_STACK=y +# CONFIG_SHADOW_CALL_STACK is not set CONFIG_ARCH_SUPPORTS_LTO_CLANG=y CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN=y CONFIG_LTO_NONE=y -- 2.47.3 From f8986a4a183ffaa4ab724b2c007d90abf38c26ff Mon Sep 17 00:00:00 2001 From: "Claude (noether)" Date: Mon, 18 May 2026 16:14:33 +0200 Subject: [PATCH 6/8] danctnix-besser README: refresh for pkgrel=3 + Patch I + 5 GHz win MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a TL;DR table at top with package name, srcversion, source-of- truth pointers, and the SCS caveat. Extends the patch table with Patch I (5 GHz scan filter, closes besser#1) and the arm64 SCS Makefile workaround. Updates the measured-outcome section with the 2026-05-18 5 GHz benchmark (11.32 MB/s sustained internet download on newton ch.48 — 3.6x the 2.4 GHz baseline of 3.12 MB/s on the same source URL). Refreshes the install + verify instructions to pkgrel=3, expected srcversion BEB625FA, and adds the per-band scan probe commands that demonstrate Patch I working. Adds the kernel-agent mirror to the provenance list and surfaces the Phase 5 reviewer's known residual limitation about multi-band iw scan (mac80211 aborts-on-any-band-fail; per-band scans work normally). --- danctnix-besser-pkgbuild/README.md | 110 +++++++++++++++++++---------- 1 file changed, 72 insertions(+), 38 deletions(-) diff --git a/danctnix-besser-pkgbuild/README.md b/danctnix-besser-pkgbuild/README.md index dfdaa0c00..dbf9aa917 100644 --- a/danctnix-besser-pkgbuild/README.md +++ b/danctnix-besser-pkgbuild/README.md @@ -2,44 +2,52 @@ Soft-upstream fork of `linux-pinetab2` (DanctNIX kernel for PineTab2) carrying the **BESser** bes2600 staging-driver patchset. -Drop-in replacement for `linux-pinetab2`. Same kernel version, same config, same modules — only the `drivers/staging/bes2600/` driver differs. +Drop-in replacement for `linux-pinetab2`. Same kernel version, same config (one toggle aside — see SCS caveat below), same modules — only the `drivers/staging/bes2600/` driver differs. + +--- + +## TL;DR + +| | | +|---|---| +| **Current package** | `linux-pinetab2-danctnix-besser-7.0.danctnix1-3-aarch64.pkg.tar.zst` | +| **Module srcversion** | `BEB625FA7443171EA8D55F7` (`bes2600.ko`) | +| **Kernel base** | DanctNIX [`linux-pinetab2`](https://codeberg.org/DanctNIX/linux-pinetab2) tag `v7.0-danctnix1` | +| **What it fixes vs upstream** | +73 % TX throughput, the `wsm_generic_confirm 0x0007` dmesg storm (besser#1 closed), the firmware-PSM-not-honored hang, the multi-function SDIO LMAC-wedge recovery | +| **What it adds today vs pkgrel=1** | **Patch I**: 5 GHz scan filter — `iw scan freq ` works, multi-channel per-band sweep refused at driver boundary to dodge firmware reject cascade. NM `band=a` profiles associate to 5 GHz cleanly. **Sustained 11.32 MB/s** download (2.54 GB factory image) on `newton` 5 GHz ch.48 — **3.6× the 2.4 GHz baseline of 3.12 MB/s** on the same source. | +| **Source-of-truth** | `git.reauktion.de/marfrit/bes2600-dkms` — branch `cleanups` for c-stack+A+B, branch `bes2600/scan-filter-5ghz` for Patch I | +| **This PKGBUILD** | `git.reauktion.de/marfrit/besser` `claude-noether-14` `danctnix-besser-pkgbuild/kernel/` | +| **Kernel-agent mirror** | `git.reauktion.de/marfrit/kernel-agent` `fleet/ohm.yaml` (manifest) + `patches/driver/bes2600/scan-filter-5ghz-danctnix/` | +| **Caveat** | `CONFIG_SHADOW_CALL_STACK=n` (security-hardening regression, workaround for a GCC 15.2.1 + arm_neon.h pragma issue — tracked in [besser#20](https://git.reauktion.de/marfrit/besser/issues/20), restore to `=y` when GCC is fixed) | + +--- ## What's in the patchset -A 16-commit cumulative diff over `v7.0-danctnix1`'s in-tree `drivers/staging/bes2600/`, capturing the patch groups below. +A 17-commit cumulative diff over `v7.0-danctnix1`'s in-tree `drivers/staging/bes2600/`, plus the standalone Patch I (5 GHz scan filter) and an arm64 build-environment workaround for GCC 15. -Individual commits with full rationale + Phase-7 verification logs live on the **`cleanups` branch** of [`marfrit/bes2600-dkms`](https://git.reauktion.de/marfrit/bes2600-dkms/commits/branch/cleanups) — this PKGBUILD ships them squashed (one cumulative diff) for build atomicity. +Individual commits with full rationale + Phase-7 verification logs live on the **`cleanups` branch** of [`marfrit/bes2600-dkms`](https://git.reauktion.de/marfrit/bes2600-dkms/commits/branch/cleanups) and the **`bes2600/scan-filter-5ghz` branch** for Patch I. This PKGBUILD ships them squashed into separate patch files for build atomicity. | group | what it does | |---|---| -| **c-stack (Patches A, B, c5.1–c5.2.1, c6.1, c6.2, c7)** | wifi-stability fixes: decrypt-storm fast-recover, connection-loss bus-reset, scan-defer-on-firmware-reject, PM state resync, firmware-doesn't-honour-PSM self-detect, multi-function SDIO `mmc_hw_reset` rescan | -| **Patch F** | cw1200 mainline backports: hw_scan SKB-lifecycle UAF, init_common destroy_workqueue on error, `atomic_add(1, x) → atomic_inc(x)` cosmetic | -| **Patch C v3** | structural: drop `sdio_rx_work` workqueue relay; IRQ → bh-direct architecture (matches mainline cw1200) | -| **Patch G** | GPL-2.0 §1 attribution restoration: SPDX-License-Identifier on every file, Tarnyagin/ST-Ericsson Copyright restored on cw1200-derived files | -| **Patch D** | `ba_lock` removed; `ba_acc/ba_cnt/ba_acc_rx/ba_cnt_rx/ba_ena` converted to `atomic_t`; per-RX-frame spinlock eliminated | -| **Patch E** | per-RX-frame `ps_state_lock` skipped when c7's `pm_unsupported` latch is on (steady-state on production firmware) | -| **Patch C2** | `ieee80211_rx_irqsafe → ieee80211_rx_ni` at all 6 sites (kernel.org-clean process-context API; tasklet hop removed) | -| **Patch H** | bh.c hygiene cleanup: 76-line + 468-line `#if 0` cw1200-ancestor fossil blocks removed; `__bes2600_irq_enable` stub removed; per-iteration `BUG_ON` → `WARN_ON_ONCE` | +| **c-stack (c5.1–c5.2.1, c6.1, c6.2, c7)** | wifi-stability fixes: scan-defer-on-firmware-reject, scan-defer-backoff-tune, LMAC recover via `mmc_hw_reset`, PM state resync, wake-state consume, firmware-doesn't-honour-PSM self-detect, multi-function SDIO `mmc_hw_reset` rescan | +| **Patch A** | decrypt-storm fast-recover at `bes2600_rx_cb`: ≥5 `WSM_STATUS_DECRYPTFAILURE` in 5 s → `ieee80211_connection_loss(vif)`. Phase-7 confirmed N=2 (2026-05-07), storms recover ~1 s vs 109 s baseline. | +| **Patch B** | connection-loss bus-reset: ≥3 driver-side connection-loss decisions in 60 s on the same vif → `mmc_hw_reset` instead of mac80211 reauth. Installed dormant; never tripped in production yet. | +| **Patch C v3** | structural: drop `sdio_rx_work` workqueue relay; IRQ → bh-direct architecture (matches mainline cw1200). +73 % sustained RX. | +| **Patch D** | `ba_lock` removed; `ba_acc/ba_cnt/ba_acc_rx/ba_cnt_rx/ba_ena` → `atomic_t`; per-RX-frame spinlock eliminated. | +| **Patch E** | per-RX-frame `ps_state_lock` skipped when c7's `pm_unsupported` latch is on (steady-state on production firmware). | +| **Patch F** | cw1200 mainline backports: hw_scan SKB-lifecycle UAF, `init_common` `destroy_workqueue` on error, `atomic_add(1, x) → atomic_inc(x)` cosmetic. | +| **Patch G** | GPL-2.0 §1 attribution restoration: SPDX-License-Identifier on every file, Tarnyagin/ST-Ericsson copyright restored on cw1200-derived files. | +| **Patch C2** | `ieee80211_rx_irqsafe → ieee80211_rx_ni` at all 6 sites (kernel.org-clean process-context API; tasklet hop removed). | +| **Patch H** | `bh.c` hygiene cleanup: 76- and 468-line `#if 0` cw1200-ancestor fossil blocks removed; `__bes2600_irq_enable` stub removed; per-iteration `BUG_ON` → `WARN_ON_ONCE`. | +| **Patch I** ([besser#1](https://git.reauktion.de/marfrit/besser/issues/1)) | **5 GHz scan filter.** Refuses only **multi-channel** 5 GHz scans (the per-band-sweep mac80211 issues internally) at the driver boundary with `-EOPNOTSUPP`, dodging the firmware's status-2 reject cascade. Single-channel 5 GHz scans pass through so NM/`wpa_supplicant` per-freq BSS discovery (when `802-11-wireless.band=a`) still finds and associates to 5 GHz APs. Net effect: dmesg storm gone, 5 GHz attachment works, 3.6× sustained throughput on 5 GHz HT40 vs 2.4 GHz HT20. | +| **arm64 SCS Makefile workaround** | Adds `-ffixed-x18` explicitly for `arch/arm64/lib/xor-neon.o` when `CONFIG_SHADOW_CALL_STACK=y`. Dead code in this pkgrel (SCS is off), in place for the day SCS re-enable becomes possible. See [besser#20](https://git.reauktion.de/marfrit/besser/issues/20). | -## Measured outcome (Mobian-flavor verification, expected to carry over) +## Measured outcome -- Phase 7 N=3 stress @ 4 MB/s sender on RK3566/PineTab2: - - Patch B baseline: 1.36 MB/s - - Patch C v3 + F + G + D + E + C2 + H: 2.28 MB/s sustained, **+67% over baseline** -- Race-fix verified under stress (no `wsm_release_tx_buffer` WARN storm under load) -- Module loads + associates cleanly; `pm_unsupported` latch fires on boot as expected -- Build clean with no warnings, srcversion `99052D7…` (Mobian-flavor) / TBD on first danctnix build - -## Provenance - -- Mobian-flavor source-of-truth: (cleanups branch) -- Per-patch breakdown + Phase 7 results: -- Upstream cw1200 mainline (architectural reference): `drivers/net/wireless/st/cw1200/` in linux-rockchip -- Kernel base: tag `v7.0-danctnix1` - -## Why it's "BESser" - -"Besser" = German for "better." Patch series ID across both DKMS (Mobian) and in-tree (Danctnix) trees. Single source-of-truth lives in `marfrit/bes2600-dkms`; this PKGBUILD is the danctnix-flavor consumption surface. +- **Phase 7 (Patch I, 2026-05-18):** Pattern A `wsm_generic_confirm failed for request 0x0007` storm: 14.3/h → **0/h** over 30-min observation. 5 GHz `newton` BSSID `c0:25:06:e6:5b:33` @ 5240 MHz (ch.48), TX bitrate 150 Mbit/s MCS 7 HT40 short-GI. Internet download throughput **11.32 MB/s** (sustained 90.5 Mbit/s, ~60 % of PHY) vs 3.12 MB/s on 2.4 GHz HT20 same source. +- **Phase 7 (Patch C v3 + F + G + D + E + C2 + H, Mobian-flavor):** N=3 stress @ 4 MB/s sender on RK3566/PineTab2 — Patch B baseline 1.36 MB/s → +73 % sustained 2.28 MB/s. Race-fix verified under stress (no `wsm_release_tx_buffer` WARN storm under load). +- Module loads + associates cleanly; `pm_unsupported` latch fires on boot as expected. ## Building @@ -51,12 +59,14 @@ Identical workflow to upstream `linux-pinetab2`. Produces `linux-pinetab2-danctn Build time: ~45–55 min on an 8-core aarch64 host (boltzmann/RPi5-class), most of it the kernel modules phase. +**GCC 15.2.1 note:** This pkgrel ships with `CONFIG_SHADOW_CALL_STACK=n` because GCC 15.2.1's strict pragma validator chokes on `arm_neon.h`'s push/`target("+nothing+aes")`/pop sequences when SCS is on. The `0003-arm64-xor-neon-ffixed-x18-build-fix.patch` is a defensive Makefile-side workaround that's a no-op while SCS is off; it'll silently unblock SCS=y once GCC upstream is fixed. See [besser#20](https://git.reauktion.de/marfrit/besser/issues/20) for the re-enable plan. + ## Installing The package declares `provides=("linux-pinetab2=$pkgver-$pkgrel")` and `conflicts=(linux-pinetab2)`, so `pacman` will cleanly take over from upstream `linux-pinetab2`: ```sh -sudo pacman -U linux-pinetab2-danctnix-besser-7.0.danctnix1-1-aarch64.pkg.tar.zst +sudo pacman -U linux-pinetab2-danctnix-besser-7.0.danctnix1-3-aarch64.pkg.tar.zst ``` That removes the upstream `linux-pinetab2` package (if installed) and registers the BESser-flavored kernel under the same provides slot. Headers package is optional; install it if you build out-of-tree modules. @@ -92,10 +102,19 @@ lsmod | grep -i bes2600 # expected: bes2600 (loaded), bes2600_btuart (loaded if Bluetooth in use) cat /sys/module/bes2600/srcversion -# expected: a srcversion distinct from the upstream linux-pinetab2 module +# expected: BEB625FA7443171EA8D55F7 for pkgrel=3 ``` -`dmesg | grep bes2600` should show clean firmware load, no SDIO TX panic, no `wsm_release_tx_buffer` WARN storm under load. +`dmesg | grep bes2600` should show clean firmware load, no SDIO TX panic, no `wsm_release_tx_buffer` WARN storm under load, no `wsm_generic_confirm failed for request 0x0007` storm. + +For the 5 GHz fix specifically: +```sh +sudo iw dev wlan0 scan freq 5180 +# expected: completes, no "Operation not supported" + +sudo iw dev wlan0 scan freq 5180 5200 5220 5240 +# expected: "Operation not supported (-95)" — multi-channel 5 GHz refused +``` ## Rolling back @@ -108,28 +127,43 @@ sudo systemctl reboot That returns you to whatever kernel `boot.scr` was pointing at before the install (typically upstream `linux-pinetab2` or the previous `linux-pinetab2-danctnix-besser`). The package itself can be removed with `sudo pacman -R linux-pinetab2-danctnix-besser` and the original `linux-pinetab2` re-installed via `sudo pacman -S linux-pinetab2`. +## Provenance + +- Mobian-flavor source-of-truth: (`cleanups` branch for c-stack + Patches A/B, `bes2600/scan-filter-5ghz` for Patch I) +- Per-patch breakdown, Phase 0–7 logs, follow-up issues: +- Upstream cw1200 mainline (architectural reference): `drivers/net/wireless/st/cw1200/` in linux-rockchip +- Kernel base: tag `v7.0-danctnix1` +- Kernel-agent mirror of the patch tree + per-host manifest: + +## Why it's "BESser" + +"Besser" = German for "better." Patch series ID across both DKMS (Mobian) and in-tree (Danctnix) trees. Single source-of-truth lives in `marfrit/bes2600-dkms`; this PKGBUILD is the danctnix-flavor consumption surface. + ## Soft-upstream intent Submitting this PKGBUILD to DanctNIX for review. If accepted as a replacement for `linux-pinetab2` (or sidegrade), the BESser patchset ships to all PineTab2 users via the regular danctnix package update channel. The bes2600 driver gets: -- ~2× sustained RX throughput +- ~2× sustained RX throughput on 2.4 GHz +- ~3.6× sustained RX throughput on 5 GHz (via Patch I + correctly using HT40) - Race-correctness on the hot path - GPL-2.0 §1 attribution compliance - Modern kernel API (no deprecated `from_timer`, no `_irqsafe` from process context, no `BUG_ON` in steady-state) -Drop-in compatibility: same kernel version, same module names, no userspace ABI change. +Drop-in compatibility: same kernel version, same module names, no userspace ABI change. SCS off is the one config caveat, tracked in [besser#20](https://git.reauktion.de/marfrit/besser/issues/20). ## Maintenance plan -- New danctnix kernel release → rebase BESser patch onto the new tag, regenerate cumulative diff, bump pkgver -- New BESser patch on Mobian DKMS → re-overlay + re-flavor + regenerate cumulative diff -- Both flavors continue to be maintained in lockstep via `marfrit/bes2600-dkms` source-of-truth +- New danctnix kernel release → rebase BESser patches onto the new tag, regenerate cumulative diff, bump pkgver. +- New BESser patch on Mobian DKMS → re-overlay + re-flavor + regenerate cumulative diff. +- Both flavors continue to be maintained in lockstep via `marfrit/bes2600-dkms` source-of-truth. +- GCC 15 SCS issue → periodically re-test build with `CONFIG_SHADOW_CALL_STACK=y` against current Arch ARM GCC. When the build succeeds, flip the config and re-deploy. ## Known gaps -- Single cumulative diff (squashed 16 commits) for now. Per-patch series can be regenerated if danctnix maintainers prefer. +- Cumulative diff (squashed) for the c-stack + Patches A/B; Patch I as a separate `0002-` file. Per-patch series can be regenerated if danctnix maintainers prefer. - Bluetooth-side `bes2600_btuart` is independent and untouched by this patchset. - `bes2600_switch_bt` orchestration removed (Mobian-only entry point; not used in danctnix tree). +- Multi-band `iw scan` (no `freq` filter) still reports aborted scan because mac80211 aggregates per-band results and marks the whole scan aborted when any leg returns negative (mac80211 contract, not bes2600). Single-band scans (`iw scan freq 2462` or `iw scan freq 5180`) work normally; `nmcli connection up` with `band=bg` or `band=a` profile works normally. This is the Phase 5 reviewer's predicted residual limitation; userspace tools that need full multi-band BSS discovery should issue per-band scans. ## Author -- 2.47.3 From a1f18a5256606796a6e9ee1d1035334ab8eb526c Mon Sep 17 00:00:00 2001 From: "Claude (noether)" Date: Mon, 18 May 2026 16:56:52 +0200 Subject: [PATCH 7/8] README + danctnix-besser-pkgbuild/README: point at kernel-agent pkgrel=4 flow - Top-level README: add kernel-agent + marfrit-packages repos to the Repos table; mark this hand-managed pkgbuild dir as historical. - danctnix-besser-pkgbuild/README: add a "MOVED" banner pointing at marfrit/marfrit-packages/arch/linux-pinetab2-danctnix-besser/ as the canonical PKGBUILD home from pkgrel=4 onwards. Refresh the TL;DR table (pkgrel=4, new cumulative b2sum bd42cd39..., new "Patch manifest" row). Add a pkgrel history table. Update Building section with the kernel-agent flow (and keep the hand-managed flow as DEPRECATED for reference). Update Installing + Verifying examples to pkgrel=4. Update Maintenance plan. Refs: kernel-agent#28, marfrit-packages#28, kernel-agent#29 (per-series reconstruction follow-up). --- README.md | 3 ++ danctnix-besser-pkgbuild/README.md | 71 +++++++++++++++++++++++++----- 2 files changed, 63 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 044ba9e9b..8ce950ab8 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,9 @@ CW1200-ancestry markers in current source: same author Dmitry Tarnyagin, |------|------| | **This umbrella** | `git.reauktion.de/marfrit/besser` — patches/, scripts/, fw-analysis/, notes/ | | **Mobian DKMS fork** (PR target) | `git.reauktion.de/marfrit/bes2600-dkms` — branches per patch; upstream = `salsa.debian.org/Mobian-team/devices/bes2600-dkms` | +| **DanctNIX kernel package** (ohm) | `git.reauktion.de/marfrit/marfrit-packages/arch/linux-pinetab2-danctnix-besser/` — kernel-agent-driven PKGBUILD, pkgrel=4+ | +| **kernel-agent manifest + patches** | `git.reauktion.de/marfrit/kernel-agent` — `fleet/ohm.yaml` lists the per-patch series, `bin/ka-promote ohm` emits the cumulative the PKGBUILD consumes | +| **Historical hand-managed PKGBUILD** | `git.reauktion.de/marfrit/besser/danctnix-besser-pkgbuild/` — pkgrel≤3, deprecated; see directory README | ## Patch series diff --git a/danctnix-besser-pkgbuild/README.md b/danctnix-besser-pkgbuild/README.md index dbf9aa917..645a98431 100644 --- a/danctnix-besser-pkgbuild/README.md +++ b/danctnix-besser-pkgbuild/README.md @@ -6,20 +6,45 @@ Drop-in replacement for `linux-pinetab2`. Same kernel version, same config (one --- +> ## ⚠️ PKGBUILD MOVED +> +> Starting with **pkgrel=4** (2026-05-18), the canonical PKGBUILD lives at +> **`git.reauktion.de/marfrit/marfrit-packages/arch/linux-pinetab2-danctnix-besser/`** +> and is driven by [kernel-agent](https://git.reauktion.de/marfrit/kernel-agent)'s +> `ka-promote ohm` cumulative-patch flow against `fleet/ohm.yaml`. +> +> This directory remains for historical reference (pkgrel=1..3 hand-managed +> flow + per-patch design notes that haven't been ported to the new home yet). +> +> **Use the new location** for builds going forward. See +> [kernel-agent PR #28](https://git.reauktion.de/marfrit/kernel-agent/pulls/28) +> and [marfrit-packages PR #28](https://git.reauktion.de/marfrit/marfrit-packages/pulls/28) +> for the migration. + +--- + ## TL;DR | | | |---|---| -| **Current package** | `linux-pinetab2-danctnix-besser-7.0.danctnix1-3-aarch64.pkg.tar.zst` | -| **Module srcversion** | `BEB625FA7443171EA8D55F7` (`bes2600.ko`) | +| **Current package** | `linux-pinetab2-danctnix-besser-7.0.danctnix1-4-aarch64.pkg.tar.zst` (built via [kernel-agent](https://git.reauktion.de/marfrit/kernel-agent)) | +| **PKGBUILD home** | `git.reauktion.de/marfrit/marfrit-packages/arch/linux-pinetab2-danctnix-besser/` *(new — pkgrel=4 onwards)* | +| **Patch manifest** | `git.reauktion.de/marfrit/kernel-agent` `fleet/ohm.yaml` | +| **Cumulative b2sum** | `bd42cd39106298879eeb…` (pkgrel=4, `ka-promote ohm` output, 157 458 B) | +| **Module srcversion** | `BEB625FA7443171EA8D55F7` (`bes2600.ko`) — pkgrel=4 byte-identical to pkgrel=3 source | | **Kernel base** | DanctNIX [`linux-pinetab2`](https://codeberg.org/DanctNIX/linux-pinetab2) tag `v7.0-danctnix1` | | **What it fixes vs upstream** | +73 % TX throughput, the `wsm_generic_confirm 0x0007` dmesg storm (besser#1 closed), the firmware-PSM-not-honored hang, the multi-function SDIO LMAC-wedge recovery | | **What it adds today vs pkgrel=1** | **Patch I**: 5 GHz scan filter — `iw scan freq ` works, multi-channel per-band sweep refused at driver boundary to dodge firmware reject cascade. NM `band=a` profiles associate to 5 GHz cleanly. **Sustained 11.32 MB/s** download (2.54 GB factory image) on `newton` 5 GHz ch.48 — **3.6× the 2.4 GHz baseline of 3.12 MB/s** on the same source. | -| **Source-of-truth** | `git.reauktion.de/marfrit/bes2600-dkms` — branch `cleanups` for c-stack+A+B, branch `bes2600/scan-filter-5ghz` for Patch I | -| **This PKGBUILD** | `git.reauktion.de/marfrit/besser` `claude-noether-14` `danctnix-besser-pkgbuild/kernel/` | -| **Kernel-agent mirror** | `git.reauktion.de/marfrit/kernel-agent` `fleet/ohm.yaml` (manifest) + `patches/driver/bes2600/scan-filter-5ghz-danctnix/` | +| **Source-of-truth (driver)** | `git.reauktion.de/marfrit/bes2600-dkms` — branch `cleanups` for c-stack+A+B, branch `bes2600/scan-filter-5ghz` for Patch I | | **Caveat** | `CONFIG_SHADOW_CALL_STACK=n` (security-hardening regression, workaround for a GCC 15.2.1 + arm_neon.h pragma issue — tracked in [besser#20](https://git.reauktion.de/marfrit/besser/issues/20), restore to `=y` when GCC is fixed) | +## pkgrel history + +| pkgrel | Date | Flow | Notes | +|---|---|---|---| +| 1–3 | 2026-05-08…05-18 | hand-managed, this dir | c-stack + Patches A/B/C/D/E/F/G/H + Patch I + SCS Makefile workaround | +| **4** | **2026-05-18** | **kernel-agent (`ka-promote ohm`)** | byte-identical source to pkgrel=3 (verified by 148 149 + 7 735 + 1 574 = 157 458 cumulative arithmetic); fixes pkgrel=3 PKGBUILD's duplicated `0003-...patch` source-array bug | + --- ## What's in the patchset @@ -49,13 +74,35 @@ Individual commits with full rationale + Phase-7 verification logs live on the * - **Phase 7 (Patch C v3 + F + G + D + E + C2 + H, Mobian-flavor):** N=3 stress @ 4 MB/s sender on RK3566/PineTab2 — Patch B baseline 1.36 MB/s → +73 % sustained 2.28 MB/s. Race-fix verified under stress (no `wsm_release_tx_buffer` WARN storm under load). - Module loads + associates cleanly; `pm_unsupported` latch fires on boot as expected. -## Building +## Building (pkgrel=4+, kernel-agent flow) + +Builds run out of the new home: ```sh +cd ~/src/marfrit-packages/arch/linux-pinetab2-danctnix-besser makepkg -s ``` -Identical workflow to upstream `linux-pinetab2`. Produces `linux-pinetab2-danctnix-besser--aarch64.pkg.tar.zst` plus a matching `-headers` package. Build host can be aarch64 native (recommended — no cross-toolchain setup) or x86 with an aarch64 cross-compiler. +To refresh the cumulative patch from a new kernel-agent manifest state: + +```sh +cd ~/src/kernel-agent +./bin/ka-promote ohm +cp build/ohm/v7.0-danctnix1/cumulative.patch \ + ~/src/marfrit-packages/arch/linux-pinetab2-danctnix-besser/0001-bes2600-besser-kernel-agent-cumulative.patch +cp build/ohm/v7.0-danctnix1/manifest.lock \ + ~/src/marfrit-packages/arch/linux-pinetab2-danctnix-besser/manifest.lock +b2sum 0001-bes2600-besser-kernel-agent-cumulative.patch # update PKGBUILD b2sums and pkgrel +``` + +## Building (pkgrel ≤ 3, hand-managed flow — DEPRECATED) + +```sh +cd ~/src/besser/marfrit-besser/danctnix-besser-pkgbuild/kernel +makepkg -s +``` + +Produces `linux-pinetab2-danctnix-besser--aarch64.pkg.tar.zst` plus a matching `-headers` package. Build host can be aarch64 native (recommended — no cross-toolchain setup) or x86 with an aarch64 cross-compiler. Build time: ~45–55 min on an 8-core aarch64 host (boltzmann/RPi5-class), most of it the kernel modules phase. @@ -66,7 +113,7 @@ Build time: ~45–55 min on an 8-core aarch64 host (boltzmann/RPi5-class), most The package declares `provides=("linux-pinetab2=$pkgver-$pkgrel")` and `conflicts=(linux-pinetab2)`, so `pacman` will cleanly take over from upstream `linux-pinetab2`: ```sh -sudo pacman -U linux-pinetab2-danctnix-besser-7.0.danctnix1-3-aarch64.pkg.tar.zst +sudo pacman -U linux-pinetab2-danctnix-besser-7.0.danctnix1-4-aarch64.pkg.tar.zst ``` That removes the upstream `linux-pinetab2` package (if installed) and registers the BESser-flavored kernel under the same provides slot. Headers package is optional; install it if you build out-of-tree modules. @@ -102,7 +149,7 @@ lsmod | grep -i bes2600 # expected: bes2600 (loaded), bes2600_btuart (loaded if Bluetooth in use) cat /sys/module/bes2600/srcversion -# expected: BEB625FA7443171EA8D55F7 for pkgrel=3 +# expected: BEB625FA7443171EA8D55F7 for pkgrel=3 (and pkgrel=4 — byte-identical source) ``` `dmesg | grep bes2600` should show clean firmware load, no SDIO TX panic, no `wsm_release_tx_buffer` WARN storm under load, no `wsm_generic_confirm failed for request 0x0007` storm. @@ -153,8 +200,10 @@ Drop-in compatibility: same kernel version, same module names, no userspace ABI ## Maintenance plan -- New danctnix kernel release → rebase BESser patches onto the new tag, regenerate cumulative diff, bump pkgver. -- New BESser patch on Mobian DKMS → re-overlay + re-flavor + regenerate cumulative diff. +**Effective pkgrel=4+:** the per-host manifest in `marfrit/kernel-agent` (`fleet/ohm.yaml`) is the per-patch authority. `ka-promote ohm` produces the cumulative; the PKGBUILD in `marfrit/marfrit-packages` consumes it. Updates flow: + +- New danctnix kernel release → bump `baseline.ref` in `fleet/ohm.yaml`, re-promote, bump pkgver in marfrit-packages PKGBUILD. +- New BESser patch → add a new series-dir in `kernel-agent/patches/driver/bes2600/`, add to `fleet/ohm.yaml` `includes:`, re-promote, refresh cumulative + b2sum in marfrit-packages PKGBUILD, bump pkgrel. - Both flavors continue to be maintained in lockstep via `marfrit/bes2600-dkms` source-of-truth. - GCC 15 SCS issue → periodically re-test build with `CONFIG_SHADOW_CALL_STACK=y` against current Arch ARM GCC. When the build succeeds, flip the config and re-deploy. -- 2.47.3 From b08ab7aa6288d008390d0647b740521a44b82de0 Mon Sep 17 00:00:00 2001 From: "Claude (noether)" Date: Mon, 18 May 2026 18:01:59 +0200 Subject: [PATCH 8/8] danctnix-besser-pkgbuild/README: bump TL;DR to pkgrel=5 (bundles besser#18 fix) pkgrel=5 = pkgrel=4 + besser#18 lockdep fix. Cumulative b2sum 0eb091ddaba4a8f1c3c2a78... (162 704 B, 4 patches). pkgrel=4 kept in the history table as a migration-only fallback. --- danctnix-besser-pkgbuild/README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/danctnix-besser-pkgbuild/README.md b/danctnix-besser-pkgbuild/README.md index 645a98431..0b4d80d37 100644 --- a/danctnix-besser-pkgbuild/README.md +++ b/danctnix-besser-pkgbuild/README.md @@ -27,11 +27,11 @@ Drop-in replacement for `linux-pinetab2`. Same kernel version, same config (one | | | |---|---| -| **Current package** | `linux-pinetab2-danctnix-besser-7.0.danctnix1-4-aarch64.pkg.tar.zst` (built via [kernel-agent](https://git.reauktion.de/marfrit/kernel-agent)) | +| **Current package** | `linux-pinetab2-danctnix-besser-7.0.danctnix1-5-aarch64.pkg.tar.zst` (built via [kernel-agent](https://git.reauktion.de/marfrit/kernel-agent)) | | **PKGBUILD home** | `git.reauktion.de/marfrit/marfrit-packages/arch/linux-pinetab2-danctnix-besser/` *(new — pkgrel=4 onwards)* | | **Patch manifest** | `git.reauktion.de/marfrit/kernel-agent` `fleet/ohm.yaml` | -| **Cumulative b2sum** | `bd42cd39106298879eeb…` (pkgrel=4, `ka-promote ohm` output, 157 458 B) | -| **Module srcversion** | `BEB625FA7443171EA8D55F7` (`bes2600.ko`) — pkgrel=4 byte-identical to pkgrel=3 source | +| **Cumulative b2sum** | `0eb091ddaba4a8f1c3c2a78…` (pkgrel=5, `ka-promote ohm` output, 162 704 B, 4 patches) | +| **Module srcversion** | `BEB625FA7443171EA8D55F7` for pkgrel=4 (byte-identical to pkgrel=3 source). pkgrel=5 srcversion differs because the besser#18 fix is bundled (TBD pending build verification). | | **Kernel base** | DanctNIX [`linux-pinetab2`](https://codeberg.org/DanctNIX/linux-pinetab2) tag `v7.0-danctnix1` | | **What it fixes vs upstream** | +73 % TX throughput, the `wsm_generic_confirm 0x0007` dmesg storm (besser#1 closed), the firmware-PSM-not-honored hang, the multi-function SDIO LMAC-wedge recovery | | **What it adds today vs pkgrel=1** | **Patch I**: 5 GHz scan filter — `iw scan freq ` works, multi-channel per-band sweep refused at driver boundary to dodge firmware reject cascade. NM `band=a` profiles associate to 5 GHz cleanly. **Sustained 11.32 MB/s** download (2.54 GB factory image) on `newton` 5 GHz ch.48 — **3.6× the 2.4 GHz baseline of 3.12 MB/s** on the same source. | @@ -43,7 +43,8 @@ Drop-in replacement for `linux-pinetab2`. Same kernel version, same config (one | pkgrel | Date | Flow | Notes | |---|---|---|---| | 1–3 | 2026-05-08…05-18 | hand-managed, this dir | c-stack + Patches A/B/C/D/E/F/G/H + Patch I + SCS Makefile workaround | -| **4** | **2026-05-18** | **kernel-agent (`ka-promote ohm`)** | byte-identical source to pkgrel=3 (verified by 148 149 + 7 735 + 1 574 = 157 458 cumulative arithmetic); fixes pkgrel=3 PKGBUILD's duplicated `0003-...patch` source-array bug | +| 4 | 2026-05-18 | kernel-agent (`ka-promote ohm`) | migration-only release: byte-identical source to pkgrel=3 (148 149 + 7 735 + 1 562 = 157 446 cumulative arithmetic); fixes pkgrel=3 PKGBUILD's duplicated `0003-...patch` source-array bug. Available as fallback. | +| **5** | **2026-05-18** | **kernel-agent (`ka-promote ohm`)** | adds [besser#18](https://git.reauktion.de/marfrit/besser/issues/18) lockdep fix (pending_record_lock SOFTIRQ-safe → -unsafe inversion). 4-patch cumulative, 162 704 B, b2sum `0eb091ddaba4…`. Closes besser#18 + besser#1. | --- @@ -113,7 +114,7 @@ Build time: ~45–55 min on an 8-core aarch64 host (boltzmann/RPi5-class), most The package declares `provides=("linux-pinetab2=$pkgver-$pkgrel")` and `conflicts=(linux-pinetab2)`, so `pacman` will cleanly take over from upstream `linux-pinetab2`: ```sh -sudo pacman -U linux-pinetab2-danctnix-besser-7.0.danctnix1-4-aarch64.pkg.tar.zst +sudo pacman -U linux-pinetab2-danctnix-besser-7.0.danctnix1-5-aarch64.pkg.tar.zst ``` That removes the upstream `linux-pinetab2` package (if installed) and registers the BESser-flavored kernel under the same provides slot. Headers package is optional; install it if you build out-of-tree modules. -- 2.47.3