mirror of https://lore.kernel.org/ath12k/
 help / color / mirror / Atom feed
* [PATCH ath-next] Revert "wifi: ath12k: add panic handler"
@ 2026-06-12  3:23 Yingying Tang
  2026-06-29  2:10 ` Baochen Qiang
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Yingying Tang @ 2026-06-12  3:23 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, yintang, yingying.tang

This reverts commit 809055628bce824b7fe18331abb65e44d02b0ecf.

Call trace:
rcu_note_context_switch+0x4c4/0x508 (P)
__schedule+0xbc/0x1204
schedule+0x34/0x110
schedule_timeout+0x84/0x11c
__mhi_device_get_sync+0x164/0x228 [mhi]
mhi_device_get_sync+0x1c/0x3c [mhi]
ath12k_wifi7_pci_bus_wake_up+0x20/0x2c [ath12k_wifi7]
ath12k_pci_read32+0x58/0x350 [ath12k]
ath12k_pci_clear_dbg_registers+0x28/0xb8 [ath12k]
ath12k_pci_panic_handler+0x20/0x44 [ath12k] ath12k_core_panic_handler+0x28/0x3c [ath12k]
notifier_call_chain+0x78/0x1c0
atomic_notifier_call_chain+0x3c/0x5c

ath12k_core_panic_handler() is invoked via atomic_notifier_call_chain(),
which runs inside an RCU read-side critical section. The current code calls
ath12k_pci_sw_reset() synchronously from this context, which eventually
reaches mhi_device_get_sync() and schedule_timeout(), triggering a voluntary
context switch within RCU.

Revert change "wifi: ath12k: add panic handler" to avoid this issue.

Tested-on: WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3

Signed-off-by: Yingying Tang <yingying.tang@oss.qualcomm.com>
---
 drivers/net/wireless/ath/ath12k/core.c | 33 +-------------------------
 drivers/net/wireless/ath/ath12k/core.h |  3 ---
 drivers/net/wireless/ath/ath12k/hif.h  |  9 -------
 drivers/net/wireless/ath/ath12k/pci.c  |  8 -------
 4 files changed, 1 insertion(+), 52 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
index 1a9866061f82..6705a8a73de1 100644
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -1793,29 +1793,6 @@ int ath12k_core_pre_init(struct ath12k_base *ab)
 	return 0;
 }
 
-static int ath12k_core_panic_handler(struct notifier_block *nb,
-				     unsigned long action, void *data)
-{
-	struct ath12k_base *ab = container_of(nb, struct ath12k_base,
-					      panic_nb);
-
-	return ath12k_hif_panic_handler(ab);
-}
-
-static int ath12k_core_panic_notifier_register(struct ath12k_base *ab)
-{
-	ab->panic_nb.notifier_call = ath12k_core_panic_handler;
-
-	return atomic_notifier_chain_register(&panic_notifier_list,
-					      &ab->panic_nb);
-}
-
-static void ath12k_core_panic_notifier_unregister(struct ath12k_base *ab)
-{
-	atomic_notifier_chain_unregister(&panic_notifier_list,
-					 &ab->panic_nb);
-}
-
 static inline
 bool ath12k_core_hw_group_create_ready(struct ath12k_hw_group *ag)
 {
@@ -2212,18 +2189,13 @@ int ath12k_core_init(struct ath12k_base *ab)
 	struct ath12k_hw_group *ag;
 	int ret;
 
-	ret = ath12k_core_panic_notifier_register(ab);
-	if (ret)
-		ath12k_warn(ab, "failed to register panic handler: %d\n", ret);
-
 	mutex_lock(&ath12k_hw_group_mutex);
 
 	ag = ath12k_core_hw_group_assign(ab);
 	if (!ag) {
 		mutex_unlock(&ath12k_hw_group_mutex);
 		ath12k_warn(ab, "unable to get hw group\n");
-		ret = -ENODEV;
-		goto err_unregister_notifier;
+		return -ENODEV;
 	}
 
 	mutex_unlock(&ath12k_hw_group_mutex);
@@ -2248,8 +2220,6 @@ int ath12k_core_init(struct ath12k_base *ab)
 
 err_unassign_hw_group:
 	ath12k_core_hw_group_unassign(ab);
-err_unregister_notifier:
-	ath12k_core_panic_notifier_unregister(ab);
 
 	return ret;
 }
@@ -2258,7 +2228,6 @@ void ath12k_core_deinit(struct ath12k_base *ab)
 {
 	ath12k_core_hw_group_destroy(ab->ag);
 	ath12k_core_hw_group_unassign(ab);
-	ath12k_core_panic_notifier_unregister(ab);
 }
 
 void ath12k_core_free(struct ath12k_base *ab)
diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
index 4edc8f4e0cb5..a81cb3032145 100644
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
@@ -15,7 +15,6 @@
 #include <linux/ctype.h>
 #include <linux/firmware.h>
 #include <linux/of_reserved_mem.h>
-#include <linux/panic_notifier.h>
 #include <linux/average.h>
 #include <linux/of.h>
 #include <linux/rhashtable.h>
@@ -1121,8 +1120,6 @@ struct ath12k_base {
 
 #endif /* CONFIG_ACPI */
 
-	struct notifier_block panic_nb;
-
 	struct ath12k_hw_group *ag;
 	struct ath12k_wsi_info wsi_info;
 	enum ath12k_firmware_mode fw_mode;
diff --git a/drivers/net/wireless/ath/ath12k/hif.h b/drivers/net/wireless/ath/ath12k/hif.h
index e8840fab6061..42bb00c13ef3 100644
--- a/drivers/net/wireless/ath/ath12k/hif.h
+++ b/drivers/net/wireless/ath/ath12k/hif.h
@@ -30,7 +30,6 @@ struct ath12k_hif_ops {
 	void (*ce_irq_enable)(struct ath12k_base *ab);
 	void (*ce_irq_disable)(struct ath12k_base *ab);
 	void (*get_ce_msi_idx)(struct ath12k_base *ab, u32 ce_id, u32 *msi_idx);
-	int (*panic_handler)(struct ath12k_base *ab);
 	void (*coredump_download)(struct ath12k_base *ab);
 };
 
@@ -149,14 +148,6 @@ static inline void ath12k_hif_power_down(struct ath12k_base *ab, bool is_suspend
 	ab->hif.ops->power_down(ab, is_suspend);
 }
 
-static inline int ath12k_hif_panic_handler(struct ath12k_base *ab)
-{
-	if (!ab->hif.ops->panic_handler)
-		return NOTIFY_DONE;
-
-	return ab->hif.ops->panic_handler(ab);
-}
-
 static inline void ath12k_hif_coredump_download(struct ath12k_base *ab)
 {
 	if (ab->hif.ops->coredump_download)
diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c
index 375277ca2b89..65a780e74d01 100644
--- a/drivers/net/wireless/ath/ath12k/pci.c
+++ b/drivers/net/wireless/ath/ath12k/pci.c
@@ -1469,13 +1469,6 @@ void ath12k_pci_power_down(struct ath12k_base *ab, bool is_suspend)
 	ath12k_pci_sw_reset(ab_pci->ab, false);
 }
 
-static int ath12k_pci_panic_handler(struct ath12k_base *ab)
-{
-	ath12k_pci_sw_reset(ab, false);
-
-	return NOTIFY_OK;
-}
-
 static const struct ath12k_hif_ops ath12k_pci_hif_ops = {
 	.start = ath12k_pci_start,
 	.stop = ath12k_pci_stop,
@@ -1493,7 +1486,6 @@ static const struct ath12k_hif_ops ath12k_pci_hif_ops = {
 	.ce_irq_enable = ath12k_pci_hif_ce_irq_enable,
 	.ce_irq_disable = ath12k_pci_hif_ce_irq_disable,
 	.get_ce_msi_idx = ath12k_pci_get_ce_msi_idx,
-	.panic_handler = ath12k_pci_panic_handler,
 #ifdef CONFIG_ATH12K_COREDUMP
 	.coredump_download = ath12k_pci_coredump_download,
 #endif
-- 
base-commit: 54a5b38e4396530e5b2f12b54d3844e860ab6784 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH ath-next] Revert "wifi: ath12k: add panic handler"
  2026-06-12  3:23 [PATCH ath-next] Revert "wifi: ath12k: add panic handler" Yingying Tang
@ 2026-06-29  2:10 ` Baochen Qiang
  2026-10-04  9:34 ` Joonhoe Kim
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Baochen Qiang @ 2026-06-29  2:10 UTC (permalink / raw)
  To: Yingying Tang, ath12k; +Cc: linux-wireless, yintang



On 6/12/2026 11:23 AM, Yingying Tang wrote:
> This reverts commit 809055628bce824b7fe18331abb65e44d02b0ecf.
> 
> Call trace:
> rcu_note_context_switch+0x4c4/0x508 (P)
> __schedule+0xbc/0x1204
> schedule+0x34/0x110
> schedule_timeout+0x84/0x11c
> __mhi_device_get_sync+0x164/0x228 [mhi]
> mhi_device_get_sync+0x1c/0x3c [mhi]
> ath12k_wifi7_pci_bus_wake_up+0x20/0x2c [ath12k_wifi7]
> ath12k_pci_read32+0x58/0x350 [ath12k]
> ath12k_pci_clear_dbg_registers+0x28/0xb8 [ath12k]
> ath12k_pci_panic_handler+0x20/0x44 [ath12k] ath12k_core_panic_handler+0x28/0x3c [ath12k]
> notifier_call_chain+0x78/0x1c0
> atomic_notifier_call_chain+0x3c/0x5c
> 
> ath12k_core_panic_handler() is invoked via atomic_notifier_call_chain(),
> which runs inside an RCU read-side critical section. The current code calls
> ath12k_pci_sw_reset() synchronously from this context, which eventually
> reaches mhi_device_get_sync() and schedule_timeout(), triggering a voluntary
> context switch within RCU.
> 
> Revert change "wifi: ath12k: add panic handler" to avoid this issue.
> 
> Tested-on: WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3

incorrect Tested-on: tag format

> 

Fixes: ?

> Signed-off-by: Yingying Tang <yingying.tang@oss.qualcomm.com>
> ---
>  drivers/net/wireless/ath/ath12k/core.c | 33 +-------------------------
>  drivers/net/wireless/ath/ath12k/core.h |  3 ---
>  drivers/net/wireless/ath/ath12k/hif.h  |  9 -------
>  drivers/net/wireless/ath/ath12k/pci.c  |  8 -------
>  4 files changed, 1 insertion(+), 52 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
> index 1a9866061f82..6705a8a73de1 100644
> --- a/drivers/net/wireless/ath/ath12k/core.c
> +++ b/drivers/net/wireless/ath/ath12k/core.c
> @@ -1793,29 +1793,6 @@ int ath12k_core_pre_init(struct ath12k_base *ab)
>  	return 0;
>  }
>  
> -static int ath12k_core_panic_handler(struct notifier_block *nb,
> -				     unsigned long action, void *data)
> -{
> -	struct ath12k_base *ab = container_of(nb, struct ath12k_base,
> -					      panic_nb);
> -
> -	return ath12k_hif_panic_handler(ab);
> -}
> -
> -static int ath12k_core_panic_notifier_register(struct ath12k_base *ab)
> -{
> -	ab->panic_nb.notifier_call = ath12k_core_panic_handler;
> -
> -	return atomic_notifier_chain_register(&panic_notifier_list,
> -					      &ab->panic_nb);
> -}
> -
> -static void ath12k_core_panic_notifier_unregister(struct ath12k_base *ab)
> -{
> -	atomic_notifier_chain_unregister(&panic_notifier_list,
> -					 &ab->panic_nb);
> -}
> -
>  static inline
>  bool ath12k_core_hw_group_create_ready(struct ath12k_hw_group *ag)
>  {
> @@ -2212,18 +2189,13 @@ int ath12k_core_init(struct ath12k_base *ab)
>  	struct ath12k_hw_group *ag;
>  	int ret;
>  
> -	ret = ath12k_core_panic_notifier_register(ab);
> -	if (ret)
> -		ath12k_warn(ab, "failed to register panic handler: %d\n", ret);
> -
>  	mutex_lock(&ath12k_hw_group_mutex);
>  
>  	ag = ath12k_core_hw_group_assign(ab);
>  	if (!ag) {
>  		mutex_unlock(&ath12k_hw_group_mutex);
>  		ath12k_warn(ab, "unable to get hw group\n");
> -		ret = -ENODEV;
> -		goto err_unregister_notifier;
> +		return -ENODEV;
>  	}
>  
>  	mutex_unlock(&ath12k_hw_group_mutex);
> @@ -2248,8 +2220,6 @@ int ath12k_core_init(struct ath12k_base *ab)
>  
>  err_unassign_hw_group:
>  	ath12k_core_hw_group_unassign(ab);
> -err_unregister_notifier:
> -	ath12k_core_panic_notifier_unregister(ab);
>  
>  	return ret;
>  }
> @@ -2258,7 +2228,6 @@ void ath12k_core_deinit(struct ath12k_base *ab)
>  {
>  	ath12k_core_hw_group_destroy(ab->ag);
>  	ath12k_core_hw_group_unassign(ab);
> -	ath12k_core_panic_notifier_unregister(ab);
>  }
>  
>  void ath12k_core_free(struct ath12k_base *ab)
> diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
> index 4edc8f4e0cb5..a81cb3032145 100644
> --- a/drivers/net/wireless/ath/ath12k/core.h
> +++ b/drivers/net/wireless/ath/ath12k/core.h
> @@ -15,7 +15,6 @@
>  #include <linux/ctype.h>
>  #include <linux/firmware.h>
>  #include <linux/of_reserved_mem.h>
> -#include <linux/panic_notifier.h>
>  #include <linux/average.h>
>  #include <linux/of.h>
>  #include <linux/rhashtable.h>
> @@ -1121,8 +1120,6 @@ struct ath12k_base {
>  
>  #endif /* CONFIG_ACPI */
>  
> -	struct notifier_block panic_nb;
> -
>  	struct ath12k_hw_group *ag;
>  	struct ath12k_wsi_info wsi_info;
>  	enum ath12k_firmware_mode fw_mode;
> diff --git a/drivers/net/wireless/ath/ath12k/hif.h b/drivers/net/wireless/ath/ath12k/hif.h
> index e8840fab6061..42bb00c13ef3 100644
> --- a/drivers/net/wireless/ath/ath12k/hif.h
> +++ b/drivers/net/wireless/ath/ath12k/hif.h
> @@ -30,7 +30,6 @@ struct ath12k_hif_ops {
>  	void (*ce_irq_enable)(struct ath12k_base *ab);
>  	void (*ce_irq_disable)(struct ath12k_base *ab);
>  	void (*get_ce_msi_idx)(struct ath12k_base *ab, u32 ce_id, u32 *msi_idx);
> -	int (*panic_handler)(struct ath12k_base *ab);
>  	void (*coredump_download)(struct ath12k_base *ab);
>  };
>  
> @@ -149,14 +148,6 @@ static inline void ath12k_hif_power_down(struct ath12k_base *ab, bool is_suspend
>  	ab->hif.ops->power_down(ab, is_suspend);
>  }
>  
> -static inline int ath12k_hif_panic_handler(struct ath12k_base *ab)
> -{
> -	if (!ab->hif.ops->panic_handler)
> -		return NOTIFY_DONE;
> -
> -	return ab->hif.ops->panic_handler(ab);
> -}
> -
>  static inline void ath12k_hif_coredump_download(struct ath12k_base *ab)
>  {
>  	if (ab->hif.ops->coredump_download)
> diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c
> index 375277ca2b89..65a780e74d01 100644
> --- a/drivers/net/wireless/ath/ath12k/pci.c
> +++ b/drivers/net/wireless/ath/ath12k/pci.c
> @@ -1469,13 +1469,6 @@ void ath12k_pci_power_down(struct ath12k_base *ab, bool is_suspend)
>  	ath12k_pci_sw_reset(ab_pci->ab, false);
>  }
>  
> -static int ath12k_pci_panic_handler(struct ath12k_base *ab)
> -{
> -	ath12k_pci_sw_reset(ab, false);
> -
> -	return NOTIFY_OK;
> -}
> -
>  static const struct ath12k_hif_ops ath12k_pci_hif_ops = {
>  	.start = ath12k_pci_start,
>  	.stop = ath12k_pci_stop,
> @@ -1493,7 +1486,6 @@ static const struct ath12k_hif_ops ath12k_pci_hif_ops = {
>  	.ce_irq_enable = ath12k_pci_hif_ce_irq_enable,
>  	.ce_irq_disable = ath12k_pci_hif_ce_irq_disable,
>  	.get_ce_msi_idx = ath12k_pci_get_ce_msi_idx,
> -	.panic_handler = ath12k_pci_panic_handler,
>  #ifdef CONFIG_ATH12K_COREDUMP
>  	.coredump_download = ath12k_pci_coredump_download,
>  #endif



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH ath-next] Revert "wifi: ath12k: add panic handler"
  2026-06-12  3:23 [PATCH ath-next] Revert "wifi: ath12k: add panic handler" Yingying Tang
  2026-06-29  2:10 ` Baochen Qiang
@ 2026-10-04  9:34 ` Joonhoe Kim
  2026-10-05 15:04   ` Jeff Johnson
  2026-10-05 18:13 ` Jeff Johnson
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: Joonhoe Kim @ 2026-10-04  9:34 UTC (permalink / raw)
  To: Yingying Tang
  Cc: Joonhoe Kim, ath12k, linux-wireless, yintang, Baochen Qiang,
	Jeff Johnson

On Thu, Jun 11, 2026 at 08:23:32PM -0700, Yingying Tang wrote:
> ath12k_core_panic_handler() is invoked via atomic_notifier_call_chain(),
> which runs inside an RCU read-side critical section.

I hit this on a WCN7860 (hw2.0, PCI) in a Lenovo Legion Tab Y700 Gen 5
(Kaanapali), v7.3-rc4 plus board patches. Here the panic never got past
the notifier:

  SMP: stopping secondary CPUs
  Voluntary context switch within RCU read-side critical section!
   schedule_timeout
   __mhi_device_get_sync
   ath12k_wifi7_pci_bus_wake_up
   ath12k_pci_read32
   ath12k_pci_sw_reset
   ath12k_pci_panic_handler
   atomic_notifier_call_chain
   vpanic

A hung_task panic stayed hung until a forced restart, and a sysrq crash
only ended in a reset after about 50 s.

With the handler removed, a sysrq crash reboots normally, and after the
reboot WCN7860 is enumerated again (PCIe Gen3 x2 link up) and Wi-Fi
works.

Tested-by: Joonhoe Kim <26rote@gmail.com>

On Baochen's question, the handler came in with 809055628bce, so:
Fixes: 809055628bce ("wifi: ath12k: add panic handler")


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH ath-next] Revert "wifi: ath12k: add panic handler"
  2026-10-04  9:34 ` Joonhoe Kim
@ 2026-10-05 15:04   ` Jeff Johnson
  0 siblings, 0 replies; 7+ messages in thread
From: Jeff Johnson @ 2026-10-05 15:04 UTC (permalink / raw)
  To: Joonhoe Kim, Yingying Tang
  Cc: ath12k, linux-wireless, yintang, Baochen Qiang, Jeff Johnson

On 10/4/2026 2:34 AM, Joonhoe Kim wrote:
> On Thu, Jun 11, 2026 at 08:23:32PM -0700, Yingying Tang wrote:
>> ath12k_core_panic_handler() is invoked via atomic_notifier_call_chain(),
>> which runs inside an RCU read-side critical section.
> 
> I hit this on a WCN7860 (hw2.0, PCI) in a Lenovo Legion Tab Y700 Gen 5
> (Kaanapali), v7.3-rc4 plus board patches. Here the panic never got past
> the notifier:
> 
>   SMP: stopping secondary CPUs
>   Voluntary context switch within RCU read-side critical section!
>    schedule_timeout
>    __mhi_device_get_sync
>    ath12k_wifi7_pci_bus_wake_up
>    ath12k_pci_read32
>    ath12k_pci_sw_reset
>    ath12k_pci_panic_handler
>    atomic_notifier_call_chain
>    vpanic
> 
> A hung_task panic stayed hung until a forced restart, and a sysrq crash
> only ended in a reset after about 50 s.
> 
> With the handler removed, a sysrq crash reboots normally, and after the
> reboot WCN7860 is enumerated again (PCIe Gen3 x2 link up) and Wi-Fi
> works.
> 
> Tested-by: Joonhoe Kim <26rote@gmail.com>
> 
> On Baochen's question, the handler came in with 809055628bce, so:
> Fixes: 809055628bce ("wifi: ath12k: add panic handler")

I'll pick this up and make the applicable cleanups.

/jeff


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH ath-next] Revert "wifi: ath12k: add panic handler"
  2026-06-12  3:23 [PATCH ath-next] Revert "wifi: ath12k: add panic handler" Yingying Tang
  2026-06-29  2:10 ` Baochen Qiang
  2026-10-04  9:34 ` Joonhoe Kim
@ 2026-10-05 18:13 ` Jeff Johnson
  2026-10-06 12:02 ` Rameshkumar Sundaram
  2026-10-06 13:44 ` Jeff Johnson
  4 siblings, 0 replies; 7+ messages in thread
From: Jeff Johnson @ 2026-10-05 18:13 UTC (permalink / raw)
  To: Yingying Tang, ath12k; +Cc: linux-wireless, yintang

On 6/11/2026 8:23 PM, Yingying Tang wrote:
> This reverts commit 809055628bce824b7fe18331abb65e44d02b0ecf.
> 
> Call trace:
> rcu_note_context_switch+0x4c4/0x508 (P)
> __schedule+0xbc/0x1204
> schedule+0x34/0x110
> schedule_timeout+0x84/0x11c
> __mhi_device_get_sync+0x164/0x228 [mhi]
> mhi_device_get_sync+0x1c/0x3c [mhi]
> ath12k_wifi7_pci_bus_wake_up+0x20/0x2c [ath12k_wifi7]
> ath12k_pci_read32+0x58/0x350 [ath12k]
> ath12k_pci_clear_dbg_registers+0x28/0xb8 [ath12k]
> ath12k_pci_panic_handler+0x20/0x44 [ath12k] ath12k_core_panic_handler+0x28/0x3c [ath12k]
> notifier_call_chain+0x78/0x1c0
> atomic_notifier_call_chain+0x3c/0x5c
> 
> ath12k_core_panic_handler() is invoked via atomic_notifier_call_chain(),
> which runs inside an RCU read-side critical section. The current code calls
> ath12k_pci_sw_reset() synchronously from this context, which eventually
> reaches mhi_device_get_sync() and schedule_timeout(), triggering a voluntary
> context switch within RCU.
> 
> Revert change "wifi: ath12k: add panic handler" to avoid this issue.
> 
> Tested-on: WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3
> 
> Signed-off-by: Yingying Tang <yingying.tang@oss.qualcomm.com>

I've posted a version to my pending branch that incorporates the tags, fixes
the Tested-on tag, and rearranges the commit text. I plan on promoting to
ath-current early Tuesday morning PDT followed immediately by a pull request
to wireless to hopefully get into v7.3-rc7.

I'll pick up any new tags, including Reviewed-by:, that I get between now and
then.

Please check:
https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git/commit/?h=pending&id=1606f6eeef30f540a6b6ba9ac47b86fa72198228



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH ath-next] Revert "wifi: ath12k: add panic handler"
  2026-06-12  3:23 [PATCH ath-next] Revert "wifi: ath12k: add panic handler" Yingying Tang
                   ` (2 preceding siblings ...)
  2026-10-05 18:13 ` Jeff Johnson
@ 2026-10-06 12:02 ` Rameshkumar Sundaram
  2026-10-06 13:44 ` Jeff Johnson
  4 siblings, 0 replies; 7+ messages in thread
From: Rameshkumar Sundaram @ 2026-10-06 12:02 UTC (permalink / raw)
  To: Yingying Tang, ath12k; +Cc: linux-wireless, yintang

On 6/12/2026 8:53 AM, Yingying Tang wrote:
> This reverts commit 809055628bce824b7fe18331abb65e44d02b0ecf.
> 
> Call trace:
> rcu_note_context_switch+0x4c4/0x508 (P)
> __schedule+0xbc/0x1204
> schedule+0x34/0x110
> schedule_timeout+0x84/0x11c
> __mhi_device_get_sync+0x164/0x228 [mhi]
> mhi_device_get_sync+0x1c/0x3c [mhi]
> ath12k_wifi7_pci_bus_wake_up+0x20/0x2c [ath12k_wifi7]
> ath12k_pci_read32+0x58/0x350 [ath12k]
> ath12k_pci_clear_dbg_registers+0x28/0xb8 [ath12k]
> ath12k_pci_panic_handler+0x20/0x44 [ath12k] ath12k_core_panic_handler+0x28/0x3c [ath12k]
> notifier_call_chain+0x78/0x1c0
> atomic_notifier_call_chain+0x3c/0x5c
> 
> ath12k_core_panic_handler() is invoked via atomic_notifier_call_chain(),
> which runs inside an RCU read-side critical section. The current code calls
> ath12k_pci_sw_reset() synchronously from this context, which eventually
> reaches mhi_device_get_sync() and schedule_timeout(), triggering a voluntary
> context switch within RCU.
> 
> Revert change "wifi: ath12k: add panic handler" to avoid this issue.
> 
> Tested-on: WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3
> 
> Signed-off-by: Yingying Tang <yingying.tang@oss.qualcomm.com>
> ---
>   drivers/net/wireless/ath/ath12k/core.c | 33 +-------------------------
>   drivers/net/wireless/ath/ath12k/core.h |  3 ---
>   drivers/net/wireless/ath/ath12k/hif.h  |  9 -------
>   drivers/net/wireless/ath/ath12k/pci.c  |  8 -------
>   4 files changed, 1 insertion(+), 52 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
> index 1a9866061f82..6705a8a73de1 100644
> --- a/drivers/net/wireless/ath/ath12k/core.c
> +++ b/drivers/net/wireless/ath/ath12k/core.c
> @@ -1793,29 +1793,6 @@ int ath12k_core_pre_init(struct ath12k_base *ab)
>   	return 0;
>   }
>   
> -static int ath12k_core_panic_handler(struct notifier_block *nb,
> -				     unsigned long action, void *data)
> -{
> -	struct ath12k_base *ab = container_of(nb, struct ath12k_base,
> -					      panic_nb);
> -
> -	return ath12k_hif_panic_handler(ab);
> -}
> -
> -static int ath12k_core_panic_notifier_register(struct ath12k_base *ab)
> -{
> -	ab->panic_nb.notifier_call = ath12k_core_panic_handler;
> -
> -	return atomic_notifier_chain_register(&panic_notifier_list,
> -					      &ab->panic_nb);
> -}
> -
> -static void ath12k_core_panic_notifier_unregister(struct ath12k_base *ab)
> -{
> -	atomic_notifier_chain_unregister(&panic_notifier_list,
> -					 &ab->panic_nb);
> -}
> -
>   static inline
>   bool ath12k_core_hw_group_create_ready(struct ath12k_hw_group *ag)
>   {
> @@ -2212,18 +2189,13 @@ int ath12k_core_init(struct ath12k_base *ab)
>   	struct ath12k_hw_group *ag;
>   	int ret;
>   
> -	ret = ath12k_core_panic_notifier_register(ab);
> -	if (ret)
> -		ath12k_warn(ab, "failed to register panic handler: %d\n", ret);
> -
>   	mutex_lock(&ath12k_hw_group_mutex);
>   
>   	ag = ath12k_core_hw_group_assign(ab);
>   	if (!ag) {
>   		mutex_unlock(&ath12k_hw_group_mutex);
>   		ath12k_warn(ab, "unable to get hw group\n");
> -		ret = -ENODEV;
> -		goto err_unregister_notifier;
> +		return -ENODEV;
>   	}
>   
>   	mutex_unlock(&ath12k_hw_group_mutex);
> @@ -2248,8 +2220,6 @@ int ath12k_core_init(struct ath12k_base *ab)
>   
>   err_unassign_hw_group:
>   	ath12k_core_hw_group_unassign(ab);
> -err_unregister_notifier:
> -	ath12k_core_panic_notifier_unregister(ab);
>   
>   	return ret;
>   }
> @@ -2258,7 +2228,6 @@ void ath12k_core_deinit(struct ath12k_base *ab)
>   {
>   	ath12k_core_hw_group_destroy(ab->ag);
>   	ath12k_core_hw_group_unassign(ab);
> -	ath12k_core_panic_notifier_unregister(ab);
>   }
>   
>   void ath12k_core_free(struct ath12k_base *ab)
> diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
> index 4edc8f4e0cb5..a81cb3032145 100644
> --- a/drivers/net/wireless/ath/ath12k/core.h
> +++ b/drivers/net/wireless/ath/ath12k/core.h
> @@ -15,7 +15,6 @@
>   #include <linux/ctype.h>
>   #include <linux/firmware.h>
>   #include <linux/of_reserved_mem.h>
> -#include <linux/panic_notifier.h>
>   #include <linux/average.h>
>   #include <linux/of.h>
>   #include <linux/rhashtable.h>
> @@ -1121,8 +1120,6 @@ struct ath12k_base {
>   
>   #endif /* CONFIG_ACPI */
>   
> -	struct notifier_block panic_nb;
> -
>   	struct ath12k_hw_group *ag;
>   	struct ath12k_wsi_info wsi_info;
>   	enum ath12k_firmware_mode fw_mode;
> diff --git a/drivers/net/wireless/ath/ath12k/hif.h b/drivers/net/wireless/ath/ath12k/hif.h
> index e8840fab6061..42bb00c13ef3 100644
> --- a/drivers/net/wireless/ath/ath12k/hif.h
> +++ b/drivers/net/wireless/ath/ath12k/hif.h
> @@ -30,7 +30,6 @@ struct ath12k_hif_ops {
>   	void (*ce_irq_enable)(struct ath12k_base *ab);
>   	void (*ce_irq_disable)(struct ath12k_base *ab);
>   	void (*get_ce_msi_idx)(struct ath12k_base *ab, u32 ce_id, u32 *msi_idx);
> -	int (*panic_handler)(struct ath12k_base *ab);
>   	void (*coredump_download)(struct ath12k_base *ab);
>   };
>   
> @@ -149,14 +148,6 @@ static inline void ath12k_hif_power_down(struct ath12k_base *ab, bool is_suspend
>   	ab->hif.ops->power_down(ab, is_suspend);
>   }
>   
> -static inline int ath12k_hif_panic_handler(struct ath12k_base *ab)
> -{
> -	if (!ab->hif.ops->panic_handler)
> -		return NOTIFY_DONE;
> -
> -	return ab->hif.ops->panic_handler(ab);
> -}
> -
>   static inline void ath12k_hif_coredump_download(struct ath12k_base *ab)
>   {
>   	if (ab->hif.ops->coredump_download)
> diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c
> index 375277ca2b89..65a780e74d01 100644
> --- a/drivers/net/wireless/ath/ath12k/pci.c
> +++ b/drivers/net/wireless/ath/ath12k/pci.c
> @@ -1469,13 +1469,6 @@ void ath12k_pci_power_down(struct ath12k_base *ab, bool is_suspend)
>   	ath12k_pci_sw_reset(ab_pci->ab, false);
>   }
>   
> -static int ath12k_pci_panic_handler(struct ath12k_base *ab)
> -{
> -	ath12k_pci_sw_reset(ab, false);
> -
> -	return NOTIFY_OK;
> -}
> -
>   static const struct ath12k_hif_ops ath12k_pci_hif_ops = {
>   	.start = ath12k_pci_start,
>   	.stop = ath12k_pci_stop,
> @@ -1493,7 +1486,6 @@ static const struct ath12k_hif_ops ath12k_pci_hif_ops = {
>   	.ce_irq_enable = ath12k_pci_hif_ce_irq_enable,
>   	.ce_irq_disable = ath12k_pci_hif_ce_irq_disable,
>   	.get_ce_msi_idx = ath12k_pci_get_ce_msi_idx,
> -	.panic_handler = ath12k_pci_panic_handler,
>   #ifdef CONFIG_ATH12K_COREDUMP
>   	.coredump_download = ath12k_pci_coredump_download,
>   #endif


the commit in pending looks good

Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH ath-next] Revert "wifi: ath12k: add panic handler"
  2026-06-12  3:23 [PATCH ath-next] Revert "wifi: ath12k: add panic handler" Yingying Tang
                   ` (3 preceding siblings ...)
  2026-10-06 12:02 ` Rameshkumar Sundaram
@ 2026-10-06 13:44 ` Jeff Johnson
  4 siblings, 0 replies; 7+ messages in thread
From: Jeff Johnson @ 2026-10-06 13:44 UTC (permalink / raw)
  To: ath12k, Yingying Tang; +Cc: linux-wireless, yintang


On Thu, 11 Jun 2026 20:23:32 -0700, Yingying Tang wrote:
> This reverts commit 809055628bce824b7fe18331abb65e44d02b0ecf.
> 
> Call trace:
> rcu_note_context_switch+0x4c4/0x508 (P)
> __schedule+0xbc/0x1204
> schedule+0x34/0x110
> schedule_timeout+0x84/0x11c
> __mhi_device_get_sync+0x164/0x228 [mhi]
> mhi_device_get_sync+0x1c/0x3c [mhi]
> ath12k_wifi7_pci_bus_wake_up+0x20/0x2c [ath12k_wifi7]
> ath12k_pci_read32+0x58/0x350 [ath12k]
> ath12k_pci_clear_dbg_registers+0x28/0xb8 [ath12k]
> ath12k_pci_panic_handler+0x20/0x44 [ath12k] ath12k_core_panic_handler+0x28/0x3c [ath12k]
> notifier_call_chain+0x78/0x1c0
> atomic_notifier_call_chain+0x3c/0x5c
> 
> [...]

Applied, thanks!

[1/1] Revert "wifi: ath12k: add panic handler"
      commit: 05165f7b3b9ab6817fe216c24f90755b7c5e15f3

Best regards,
-- 
Jeff Johnson <jeff.johnson@oss.qualcomm.com>



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-10-06 13:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-12  3:23 [PATCH ath-next] Revert "wifi: ath12k: add panic handler" Yingying Tang
2026-06-29  2:10 ` Baochen Qiang
2026-10-04  9:34 ` Joonhoe Kim
2026-10-05 15:04   ` Jeff Johnson
2026-10-05 18:13 ` Jeff Johnson
2026-10-06 12:02 ` Rameshkumar Sundaram
2026-10-06 13:44 ` Jeff Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox