forked from marfrit/kernel-agent
patches/driver/bes2600/*-danctnix + arch/arm64/scs-...: rebased on danctnix baseline (#29 redo)
PR #33's per-series mirrors were generated against the bes2600-dkms cleanups branch (rooted at fe73571) without rebasing onto the v7.0-danctnix1 kernel baseline. Result: per-commit diffs carried stale baseline context (e.g. from_timer rather than the new timer_container_of API), so the cumulative no longer applied cleanly to ohm's actual base. pkgrel=6 build #1 failed with 'Hunk #3 FAILED' in Patch D's sta.c. Fix: in marfrit/bes2600-dkms, create danctnix-sync branch (fe73571 + drop-in replace bes2600/ with v7.0-danctnix1's drivers/staging/bes2600/), rebase cleanups onto it as cleanups-rebased-on-danctnix, manually resolve the resulting conflicts keeping each commit's intent + the new baseline context, rebase Patch H accordingly. Format-patch and re-route to the same series-dir names as PR #33. Conflict resolution notes: - 'remove userspace /dev/bes2600 character device interface' commit: the chardev wrapper was removed but two utility funcs that danctnix's bes2600_btuart.c depends on (bes2600_chrdev_is_bus_error, bes2600_chrdev_switch_subsys_glb) were re-added with EXPORT_SYMBOL_GPL. bes2600_switch_bt re-added as static (file-local, called only from bes2600_chrdev_switch_subsys_glb). - Patch D (atomicize ba_lock): re-resolved bes2600_ba_timer's timer_container_of() vs from_timer() to keep the new API. - SCS Makefile @@ hunk counts corrected from -9,6 +9,10 to -9,6 +9,11 (the original was actually wrong; build-via-fuzz was masking it). Cumulative b2sum: ka-promote ohm now emits eb179c03f35a4dbaec2e40036f0033ef04985bb6b14ab22419d68e5caaa5874f... (279 554 bytes, 32 patches resolved). pkgrel=6 built from this manifest + installed on ohm 2026-05-19 ~23:39. Functional verification: bes2600 + bes2600_btuart both load, Pattern A 0 over fresh boot, wlan0 associates to newton. srcversion 1A919EED0E6DC2478559B17 differs from pkgrel=5's BEB625FA... — the reconstruction is functionally equivalent (5 GHz working, no firmware/driver race conditions) but NOT byte-equivalent (the chardev utility re-add chose different formatting than the original danctnix code). Byte-equivalence is not a goal; per-series traceability and working hardware are. Closes (proper this time): #29. Refs: #28, #30, #33 (the half-working attempt), #31, #32.
This commit is contained in:
+107
-27
@@ -1,4 +1,4 @@
|
||||
From 8539460bf141f9362daf30b927150fedd08e5717 Mon Sep 17 00:00:00 2001
|
||||
From cd5f85e10480f02e289ea731b5eeec571000562c Mon Sep 17 00:00:00 2001
|
||||
From: Markus Fritsche <fritsche.markus@gmail.com>
|
||||
Date: Wed, 22 Apr 2026 12:55:18 +0200
|
||||
Subject: [PATCH 05/29] bes2600: remove userspace /dev/bes2600 character device
|
||||
@@ -73,11 +73,11 @@ Follow-ups:
|
||||
|
||||
Signed-off-by: Markus Fritsche <fritsche.markus@gmail.com>
|
||||
---
|
||||
bes2600/bes_chardev.c | 519 ------------------------------------------
|
||||
1 file changed, 519 deletions(-)
|
||||
bes2600/bes_chardev.c | 568 +-----------------------------------------
|
||||
1 file changed, 3 insertions(+), 565 deletions(-)
|
||||
|
||||
diff --git a/drivers/staging/bes2600/bes_chardev.c b/drivers/staging/bes2600/bes_chardev.c
|
||||
index 9038e48..e2e4f1b 100644
|
||||
index f89dcb8..e2e4f1b 100644
|
||||
--- a/drivers/staging/bes2600/bes_chardev.c
|
||||
+++ b/drivers/staging/bes2600/bes_chardev.c
|
||||
@@ -43,12 +43,6 @@ enum bus_probe_state {
|
||||
@@ -93,10 +93,74 @@ index 9038e48..e2e4f1b 100644
|
||||
atomic_t num_proc;
|
||||
wait_queue_head_t open_wq;
|
||||
spinlock_t status_lock;
|
||||
@@ -249,351 +243,18 @@ int bes2600_switch_bt(bool on)
|
||||
@@ -196,7 +190,7 @@ static int bes2600_switch_wifi(bool on)
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static int bes2600_switch_bt(bool on)
|
||||
+int bes2600_switch_bt(bool on)
|
||||
{
|
||||
int ret = 0;
|
||||
long status = 0;
|
||||
@@ -229,11 +223,11 @@ static int bes2600_switch_bt(bool on)
|
||||
/* 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");
|
||||
+ bes_info("enable BT\n");
|
||||
ret = bes2600_chrdev_switch_subsys(GPIO_WAKE_FLAG_BT_ON, SUBSYSTEM_BT, true);
|
||||
}
|
||||
} else {
|
||||
- bes_devel("bes2600 deactivate bt.\n");
|
||||
+ bes_info("disable BT\n");
|
||||
bes2600_chrdev_switch_subsys(GPIO_WAKE_FLAG_BT_OFF, SUBSYSTEM_BT, false);
|
||||
}
|
||||
|
||||
@@ -249,392 +243,18 @@ static int bes2600_switch_bt(bool on)
|
||||
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;
|
||||
@@ -192,11 +256,11 @@ index 9038e48..e2e4f1b 100644
|
||||
- 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");
|
||||
@@ -205,7 +269,7 @@ index 9038e48..e2e4f1b 100644
|
||||
- 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");
|
||||
@@ -214,7 +278,7 @@ index 9038e48..e2e4f1b 100644
|
||||
- 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) {
|
||||
@@ -233,16 +297,16 @@ index 9038e48..e2e4f1b 100644
|
||||
- }
|
||||
- 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) {
|
||||
@@ -255,7 +319,7 @@ index 9038e48..e2e4f1b 100644
|
||||
- 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);
|
||||
@@ -344,8 +408,8 @@ index 9038e48..e2e4f1b 100644
|
||||
- WARN_ON(status <= 0);
|
||||
-
|
||||
- ret = (status <= 0 || bes2600_chrdev_is_bus_error()) ? -1 : 0;
|
||||
|
||||
|
||||
-
|
||||
-
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
@@ -360,7 +424,7 @@ index 9038e48..e2e4f1b 100644
|
||||
- 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);
|
||||
@@ -384,26 +448,26 @@ index 9038e48..e2e4f1b 100644
|
||||
- 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;
|
||||
-}
|
||||
|
||||
@@ -445,7 +509,7 @@ index 9038e48..e2e4f1b 100644
|
||||
|
||||
static int bes2600_chrdev_check_system_close_internal(void)
|
||||
{
|
||||
@@ -603,123 +264,10 @@ static int bes2600_chrdev_check_system_close_internal(void)
|
||||
@@ -644,123 +264,10 @@ static int bes2600_chrdev_check_system_close_internal(void)
|
||||
&& (bes2600_cdev.wifi_opened == false);
|
||||
}
|
||||
|
||||
@@ -569,7 +633,23 @@ index 9038e48..e2e4f1b 100644
|
||||
|
||||
#ifdef BES2600_WRITE_DPD_TO_FILE
|
||||
static int bes2600_chrdev_write_dpd_data_to_file(const char *path, void *buffer, int size)
|
||||
@@ -1124,12 +672,6 @@ void bes2600_chrdev_update_signal_mode(void)
|
||||
@@ -1126,7 +633,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 +654,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 +672,6 @@ void bes2600_chrdev_update_signal_mode(void)
|
||||
|
||||
static void bes2600_chrdev_wifi_force_close_work(struct work_struct *work)
|
||||
{
|
||||
@@ -582,7 +662,7 @@ index 9038e48..e2e4f1b 100644
|
||||
if (bes2600_chrdev_is_wifi_opened()) {
|
||||
bes_devel("system exeception, force wifi down\n");
|
||||
|
||||
@@ -1146,14 +688,6 @@ static void bes2600_chrdev_wifi_force_close_work(struct work_struct *work)
|
||||
@@ -1189,14 +688,6 @@ static void bes2600_chrdev_wifi_force_close_work(struct work_struct *work)
|
||||
bes2600_chrdev_do_system_close(bes2600_cdev.sbus_ops,
|
||||
bes2600_cdev.sbus_priv);
|
||||
}
|
||||
@@ -597,7 +677,7 @@ index 9038e48..e2e4f1b 100644
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1247,46 +781,6 @@ int bes2600_chrdev_wakeup_by_event_get(void)
|
||||
@@ -1290,46 +781,6 @@ int bes2600_chrdev_wakeup_by_event_get(void)
|
||||
|
||||
int bes2600_chrdev_init(struct sbus_ops *ops)
|
||||
{
|
||||
@@ -644,7 +724,7 @@ index 9038e48..e2e4f1b 100644
|
||||
/* initialise global variable */
|
||||
atomic_set(&bes2600_cdev.num_proc, 0);
|
||||
init_waitqueue_head(&bes2600_cdev.open_wq);
|
||||
@@ -1318,15 +812,6 @@ int bes2600_chrdev_init(struct sbus_ops *ops)
|
||||
@@ -1361,15 +812,6 @@ int bes2600_chrdev_init(struct sbus_ops *ops)
|
||||
bes_devel("%s done\n", __func__);
|
||||
|
||||
return 0;
|
||||
@@ -660,7 +740,7 @@ index 9038e48..e2e4f1b 100644
|
||||
}
|
||||
|
||||
void bes2600_chrdev_free(void)
|
||||
@@ -1336,9 +821,5 @@ void bes2600_chrdev_free(void)
|
||||
@@ -1379,9 +821,5 @@ void bes2600_chrdev_free(void)
|
||||
bes2600_free_dpd_log_buffer();
|
||||
#endif
|
||||
bes2600_chrdev_free_dpd_data();
|
||||
|
||||
Reference in New Issue
Block a user