* [PATCH rtw-next v2 1/2] wifi: rtw89: sar: drop lockdep assertion in rtw89_set_sar_from_acpi
@ 2025-06-04 16:13 Fedor Pchelkin
2025-06-04 16:13 ` [PATCH rtw-next v2 2/2] wifi: rtw89: sar: do not assert wiphy lock held until probing is done Fedor Pchelkin
2025-06-10 1:44 ` [PATCH rtw-next v2 1/2] wifi: rtw89: sar: drop lockdep assertion in rtw89_set_sar_from_acpi Ping-Ke Shih
0 siblings, 2 replies; 3+ messages in thread
From: Fedor Pchelkin @ 2025-06-04 16:13 UTC (permalink / raw)
To: Ping-Ke Shih
Cc: Fedor Pchelkin, Zong-Zhe Yang, linux-wireless, linux-kernel, lvc-project
The following assertion is triggered on the rtw89 driver startup. It
looks meaningless to hold wiphy lock on the early init stage so drop the
assertion.
WARNING: CPU: 7 PID: 629 at drivers/net/wireless/realtek/rtw89/sar.c:502 rtw89_set_sar_from_acpi+0x365/0x4d0 [rtw89_core]
CPU: 7 UID: 0 PID: 629 Comm: (udev-worker) Not tainted 6.15.0+ #29 PREEMPT(lazy)
Hardware name: LENOVO 21D0/LNVNB161216, BIOS J6CN50WW 09/27/2024
RIP: 0010:rtw89_set_sar_from_acpi+0x365/0x4d0 [rtw89_core]
Call Trace:
<TASK>
rtw89_sar_init+0x68/0x2c0 [rtw89_core]
rtw89_core_init+0x188e/0x1e50 [rtw89_core]
rtw89_pci_probe+0x530/0xb50 [rtw89_pci]
local_pci_probe+0xd9/0x190
pci_call_probe+0x183/0x540
pci_device_probe+0x171/0x2c0
really_probe+0x1e1/0x890
__driver_probe_device+0x18c/0x390
driver_probe_device+0x4a/0x120
__driver_attach+0x1a0/0x530
bus_for_each_dev+0x10b/0x190
bus_add_driver+0x2eb/0x540
driver_register+0x1a3/0x3a0
do_one_initcall+0xd5/0x450
do_init_module+0x2cc/0x8f0
init_module_from_file+0xe1/0x150
idempotent_init_module+0x226/0x760
__x64_sys_finit_module+0xcd/0x150
do_syscall_64+0x94/0x380
entry_SYSCALL_64_after_hwframe+0x76/0x7e
Found by Linux Verification Center (linuxtesting.org).
Fixes: 88ca3107d2ce ("wifi: rtw89: sar: add skeleton for SAR configuration via ACPI")
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
---
v2: no changes
drivers/net/wireless/realtek/rtw89/sar.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/sar.c b/drivers/net/wireless/realtek/rtw89/sar.c
index 517b66022f18..33a4b5c23fe7 100644
--- a/drivers/net/wireless/realtek/rtw89/sar.c
+++ b/drivers/net/wireless/realtek/rtw89/sar.c
@@ -499,8 +499,6 @@ static void rtw89_set_sar_from_acpi(struct rtw89_dev *rtwdev)
struct rtw89_sar_cfg_acpi *cfg;
int ret;
- lockdep_assert_wiphy(rtwdev->hw->wiphy);
-
cfg = kzalloc(sizeof(*cfg), GFP_KERNEL);
if (!cfg)
return;
--
2.49.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH rtw-next v2 2/2] wifi: rtw89: sar: do not assert wiphy lock held until probing is done
2025-06-04 16:13 [PATCH rtw-next v2 1/2] wifi: rtw89: sar: drop lockdep assertion in rtw89_set_sar_from_acpi Fedor Pchelkin
@ 2025-06-04 16:13 ` Fedor Pchelkin
2025-06-10 1:44 ` [PATCH rtw-next v2 1/2] wifi: rtw89: sar: drop lockdep assertion in rtw89_set_sar_from_acpi Ping-Ke Shih
1 sibling, 0 replies; 3+ messages in thread
From: Fedor Pchelkin @ 2025-06-04 16:13 UTC (permalink / raw)
To: Ping-Ke Shih
Cc: Fedor Pchelkin, Zong-Zhe Yang, linux-wireless, linux-kernel, lvc-project
rtw89_sar_set_src() may be called at driver early init phase when
applying SAR configuration via ACPI. wiphy lock is not held there.
Since the assertion was initially added for rtw89_apply_sar_common() call
path and may be helpful for other places in future changes, keep it but
move it under RTW89_FLAG_PROBE_DONE test.
Found by Linux Verification Center (linuxtesting.org).
Fixes: 88ca3107d2ce ("wifi: rtw89: sar: add skeleton for SAR configuration via ACPI")
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
---
v2: move the assertion under RTW89_FLAG_PROBE_DONE test (Ping-Ke Shih);
add Fixes
drivers/net/wireless/realtek/rtw89/sar.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtw89/sar.c b/drivers/net/wireless/realtek/rtw89/sar.c
index 33a4b5c23fe7..7f568ffb3766 100644
--- a/drivers/net/wireless/realtek/rtw89/sar.c
+++ b/drivers/net/wireless/realtek/rtw89/sar.c
@@ -199,7 +199,8 @@ struct rtw89_sar_handler rtw89_sar_handlers[RTW89_SAR_SOURCE_NR] = {
typeof(_dev) _d = (_dev); \
BUILD_BUG_ON(!rtw89_sar_handlers[_s].descr_sar_source); \
BUILD_BUG_ON(!rtw89_sar_handlers[_s].query_sar_config); \
- lockdep_assert_wiphy(_d->hw->wiphy); \
+ if (test_bit(RTW89_FLAG_PROBE_DONE, _d->flags)) \
+ lockdep_assert_wiphy(_d->hw->wiphy); \
_d->sar._cfg_name = *(_cfg_data); \
_d->sar.src = _s; \
} while (0)
--
2.49.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH rtw-next v2 1/2] wifi: rtw89: sar: drop lockdep assertion in rtw89_set_sar_from_acpi
2025-06-04 16:13 [PATCH rtw-next v2 1/2] wifi: rtw89: sar: drop lockdep assertion in rtw89_set_sar_from_acpi Fedor Pchelkin
2025-06-04 16:13 ` [PATCH rtw-next v2 2/2] wifi: rtw89: sar: do not assert wiphy lock held until probing is done Fedor Pchelkin
@ 2025-06-10 1:44 ` Ping-Ke Shih
1 sibling, 0 replies; 3+ messages in thread
From: Ping-Ke Shih @ 2025-06-10 1:44 UTC (permalink / raw)
To: Fedor Pchelkin, Ping-Ke Shih
Cc: Fedor Pchelkin, Zong-Zhe Yang, linux-wireless, linux-kernel, lvc-project
Fedor Pchelkin <pchelkin@ispras.ru> wrote:
> The following assertion is triggered on the rtw89 driver startup. It
> looks meaningless to hold wiphy lock on the early init stage so drop the
> assertion.
>
> WARNING: CPU: 7 PID: 629 at drivers/net/wireless/realtek/rtw89/sar.c:502 rtw89_set_sar_from_acpi+0x365/0x4d0 [rtw89_core]
> CPU: 7 UID: 0 PID: 629 Comm: (udev-worker) Not tainted 6.15.0+ #29 PREEMPT(lazy)
> Hardware name: LENOVO 21D0/LNVNB161216, BIOS J6CN50WW 09/27/2024
> RIP: 0010:rtw89_set_sar_from_acpi+0x365/0x4d0 [rtw89_core]
> Call Trace:
> <TASK>
> rtw89_sar_init+0x68/0x2c0 [rtw89_core]
> rtw89_core_init+0x188e/0x1e50 [rtw89_core]
> rtw89_pci_probe+0x530/0xb50 [rtw89_pci]
> local_pci_probe+0xd9/0x190
> pci_call_probe+0x183/0x540
> pci_device_probe+0x171/0x2c0
> really_probe+0x1e1/0x890
> __driver_probe_device+0x18c/0x390
> driver_probe_device+0x4a/0x120
> __driver_attach+0x1a0/0x530
> bus_for_each_dev+0x10b/0x190
> bus_add_driver+0x2eb/0x540
> driver_register+0x1a3/0x3a0
> do_one_initcall+0xd5/0x450
> do_init_module+0x2cc/0x8f0
> init_module_from_file+0xe1/0x150
> idempotent_init_module+0x226/0x760
> __x64_sys_finit_module+0xcd/0x150
> do_syscall_64+0x94/0x380
> entry_SYSCALL_64_after_hwframe+0x76/0x7e
>
> Found by Linux Verification Center (linuxtesting.org).
>
> Fixes: 88ca3107d2ce ("wifi: rtw89: sar: add skeleton for SAR configuration via ACPI")
> Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
2 patch(es) applied to rtw-next branch of rtw.git, thanks.
6fe21445f7e8 wifi: rtw89: sar: drop lockdep assertion in rtw89_set_sar_from_acpi
dad7aafa5216 wifi: rtw89: sar: do not assert wiphy lock held until probing is done
---
https://github.com/pkshih/rtw.git
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-06-10 1:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-04 16:13 [PATCH rtw-next v2 1/2] wifi: rtw89: sar: drop lockdep assertion in rtw89_set_sar_from_acpi Fedor Pchelkin
2025-06-04 16:13 ` [PATCH rtw-next v2 2/2] wifi: rtw89: sar: do not assert wiphy lock held until probing is done Fedor Pchelkin
2025-06-10 1:44 ` [PATCH rtw-next v2 1/2] wifi: rtw89: sar: drop lockdep assertion in rtw89_set_sar_from_acpi Ping-Ke Shih
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®