linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ath-next] wifi: ath12k: fix GCC_GCC_PCIE_HOT_RST definition for WCN7850
@ 2025-05-23  2:23 Baochen Qiang
  2025-05-23 13:48 ` Parth Panchoil
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Baochen Qiang @ 2025-05-23  2:23 UTC (permalink / raw)
  To: Jeff Johnson, Pradeep Kumar Chitrapu, Wen Gong,
	Vasanthakumar Thiagarajan, Bhagavathi Perumal S, P Praneesh
  Cc: Sriram R, linux-wireless, ath12k, linux-kernel, Parth Panchoil,
	Baochen Qiang

GCC_GCC_PCIE_HOT_RST is wrongly defined for WCN7850, causing kernel crash
on some specific platforms.

Since this register is divergent for WCN7850 and QCN9274, move it to
register table to allow different definitions. Then correct the register
address for WCN7850 to fix this issue.

Note IPQ5332 is not affected as it is not PCIe based device.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Reported-by: Parth Panchoil <parth105105@gmail.com>
Closes: https://lore.kernel.org/all/86899b2235a59c9134603beebe08f2bb0b244ea0.camel@gmail.com
Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
---
---
 drivers/net/wireless/ath/ath12k/hw.c  | 6 ++++++
 drivers/net/wireless/ath/ath12k/hw.h  | 2 ++
 drivers/net/wireless/ath/ath12k/pci.c | 6 +++---
 drivers/net/wireless/ath/ath12k/pci.h | 4 +++-
 4 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/hw.c b/drivers/net/wireless/ath/ath12k/hw.c
index 7e2cf0fb2085ab014fc14a5c81074802674b154e..8254dc10b53bbfb54a44c7ff2f705c72461d1031 100644
--- a/drivers/net/wireless/ath/ath12k/hw.c
+++ b/drivers/net/wireless/ath/ath12k/hw.c
@@ -951,6 +951,8 @@ static const struct ath12k_hw_regs qcn9274_v1_regs = {
 	.hal_umac_ce0_dest_reg_base = 0x01b81000,
 	.hal_umac_ce1_src_reg_base = 0x01b82000,
 	.hal_umac_ce1_dest_reg_base = 0x01b83000,
+
+	.gcc_gcc_pcie_hot_rst = 0x1e38338,
 };
 
 static const struct ath12k_hw_regs qcn9274_v2_regs = {
@@ -1042,6 +1044,8 @@ static const struct ath12k_hw_regs qcn9274_v2_regs = {
 	.hal_umac_ce0_dest_reg_base = 0x01b81000,
 	.hal_umac_ce1_src_reg_base = 0x01b82000,
 	.hal_umac_ce1_dest_reg_base = 0x01b83000,
+
+	.gcc_gcc_pcie_hot_rst = 0x1e38338,
 };
 
 static const struct ath12k_hw_regs ipq5332_regs = {
@@ -1215,6 +1219,8 @@ static const struct ath12k_hw_regs wcn7850_regs = {
 	.hal_umac_ce0_dest_reg_base = 0x01b81000,
 	.hal_umac_ce1_src_reg_base = 0x01b82000,
 	.hal_umac_ce1_dest_reg_base = 0x01b83000,
+
+	.gcc_gcc_pcie_hot_rst = 0x1e40304,
 };
 
 static const struct ath12k_hw_hal_params ath12k_hw_hal_params_qcn9274 = {
diff --git a/drivers/net/wireless/ath/ath12k/hw.h b/drivers/net/wireless/ath/ath12k/hw.h
index 0fbc17649df463334aa0ebb3da407115985335ca..0a75bc5abfa2410ab3c7b6ce038f4d5f6445ecf9 100644
--- a/drivers/net/wireless/ath/ath12k/hw.h
+++ b/drivers/net/wireless/ath/ath12k/hw.h
@@ -375,6 +375,8 @@ struct ath12k_hw_regs {
 	u32 hal_reo_cmd_ring_base;
 
 	u32 hal_reo_status_ring_base;
+
+	u32 gcc_gcc_pcie_hot_rst;
 };
 
 static inline const char *ath12k_bd_ie_type_str(enum ath12k_bd_ie_type type)
diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c
index 489d546390fcdab8f615cc9184006a958d9f140a..1f3cfd9b89fdcfd84731ec90c9c678b0c477a2af 100644
--- a/drivers/net/wireless/ath/ath12k/pci.c
+++ b/drivers/net/wireless/ath/ath12k/pci.c
@@ -292,10 +292,10 @@ static void ath12k_pci_enable_ltssm(struct ath12k_base *ab)
 
 	ath12k_dbg(ab, ATH12K_DBG_PCI, "pci ltssm 0x%x\n", val);
 
-	val = ath12k_pci_read32(ab, GCC_GCC_PCIE_HOT_RST);
+	val = ath12k_pci_read32(ab, GCC_GCC_PCIE_HOT_RST(ab));
 	val |= GCC_GCC_PCIE_HOT_RST_VAL;
-	ath12k_pci_write32(ab, GCC_GCC_PCIE_HOT_RST, val);
-	val = ath12k_pci_read32(ab, GCC_GCC_PCIE_HOT_RST);
+	ath12k_pci_write32(ab, GCC_GCC_PCIE_HOT_RST(ab), val);
+	val = ath12k_pci_read32(ab, GCC_GCC_PCIE_HOT_RST(ab));
 
 	ath12k_dbg(ab, ATH12K_DBG_PCI, "pci pcie_hot_rst 0x%x\n", val);
 
diff --git a/drivers/net/wireless/ath/ath12k/pci.h b/drivers/net/wireless/ath/ath12k/pci.h
index 0b4c459d6d8eabb0773162e6bb3ca666c0a8f15a..d1ec8aad7f6c3b6f5cbdf8ce57a4106733686521 100644
--- a/drivers/net/wireless/ath/ath12k/pci.h
+++ b/drivers/net/wireless/ath/ath12k/pci.h
@@ -28,7 +28,9 @@
 #define PCIE_PCIE_PARF_LTSSM			0x1e081b0
 #define PARM_LTSSM_VALUE			0x111
 
-#define GCC_GCC_PCIE_HOT_RST			0x1e38338
+#define GCC_GCC_PCIE_HOT_RST(ab) \
+	((ab)->hw_params->regs->gcc_gcc_pcie_hot_rst)
+
 #define GCC_GCC_PCIE_HOT_RST_VAL		0x10
 
 #define PCIE_PCIE_INT_ALL_CLEAR			0x1e08228

---
base-commit: 3d933084a072fd5fb5da54c06a017abc0412c86f
change-id: 20250506-ath12k-wrong-global-reset-addr-b75ddc6e7850

Best regards,
-- 
Baochen Qiang <quic_bqiang@quicinc.com>


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

* Re: [PATCH ath-next] wifi: ath12k: fix GCC_GCC_PCIE_HOT_RST definition for WCN7850
  2025-05-23  2:23 [PATCH ath-next] wifi: ath12k: fix GCC_GCC_PCIE_HOT_RST definition for WCN7850 Baochen Qiang
@ 2025-05-23 13:48 ` Parth Panchoil
  2025-06-05  5:28 ` Vasanthakumar Thiagarajan
  2025-06-07 14:44 ` Jeff Johnson
  2 siblings, 0 replies; 4+ messages in thread
From: Parth Panchoil @ 2025-05-23 13:48 UTC (permalink / raw)
  To: Baochen Qiang, Jeff Johnson, Pradeep Kumar Chitrapu, Wen Gong,
	Vasanthakumar Thiagarajan, Bhagavathi Perumal S, P Praneesh
  Cc: Sriram R, linux-wireless, ath12k, linux-kernel, Francesco Dolcini

Thanks Baochen for the patch. 

This patch fixes a bug in older kernels, so it should be backported.
Minor correction needed on the reported tag.
Tested on TI AM69 SK board with SX-PCEBE (WCN7850) Wi-Fi module and did
not observe the reported crash anymore.

Cc: stable@vger.kernel.org
Reported-by: Parth Pancholi <parth.pancholi@toradex.com>
Tested-by: Parth Pancholi <parth.pancholi@toradex.com>

Regards,
Parth P

> GCC_GCC_PCIE_HOT_RST is wrongly defined for WCN7850, causing kernel
> crash
> on some specific platforms.
> 
> Since this register is divergent for WCN7850 and QCN9274, move it to
> register table to allow different definitions. Then correct the
> register
> address for WCN7850 to fix this issue.
> 
> Note IPQ5332 is not affected as it is not PCIe based device.
> 
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-
> QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
> 
> Reported-by: Parth Panchoil <parth105105@gmail.com>
> Closes:
> https://lore.kernel.org/all/86899b2235a59c9134603beebe08f2bb0b244ea0.camel@gmail.com
> Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7
> devices")
> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
> ---
> ---
>  drivers/net/wireless/ath/ath12k/hw.c  | 6 ++++++
>  drivers/net/wireless/ath/ath12k/hw.h  | 2 ++
>  drivers/net/wireless/ath/ath12k/pci.c | 6 +++---
>  drivers/net/wireless/ath/ath12k/pci.h | 4 +++-
>  4 files changed, 14 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath12k/hw.c
> b/drivers/net/wireless/ath/ath12k/hw.c
> index
> 7e2cf0fb2085ab014fc14a5c81074802674b154e..8254dc10b53bbfb54a44c7ff2f7
> 05c72461d1031 100644
> --- a/drivers/net/wireless/ath/ath12k/hw.c
> +++ b/drivers/net/wireless/ath/ath12k/hw.c
> @@ -951,6 +951,8 @@ static const struct ath12k_hw_regs
> qcn9274_v1_regs = {
>         .hal_umac_ce0_dest_reg_base = 0x01b81000,
>         .hal_umac_ce1_src_reg_base = 0x01b82000,
>         .hal_umac_ce1_dest_reg_base = 0x01b83000,
> +
> +       .gcc_gcc_pcie_hot_rst = 0x1e38338,
>  };
>  
>  static const struct ath12k_hw_regs qcn9274_v2_regs = {
> @@ -1042,6 +1044,8 @@ static const struct ath12k_hw_regs
> qcn9274_v2_regs = {
>         .hal_umac_ce0_dest_reg_base = 0x01b81000,
>         .hal_umac_ce1_src_reg_base = 0x01b82000,
>         .hal_umac_ce1_dest_reg_base = 0x01b83000,
> +
> +       .gcc_gcc_pcie_hot_rst = 0x1e38338,
>  };
>  
>  static const struct ath12k_hw_regs ipq5332_regs = {
> @@ -1215,6 +1219,8 @@ static const struct ath12k_hw_regs wcn7850_regs
> = {
>         .hal_umac_ce0_dest_reg_base = 0x01b81000,
>         .hal_umac_ce1_src_reg_base = 0x01b82000,
>         .hal_umac_ce1_dest_reg_base = 0x01b83000,
> +
> +       .gcc_gcc_pcie_hot_rst = 0x1e40304,
>  };
>  
>  static const struct ath12k_hw_hal_params
> ath12k_hw_hal_params_qcn9274 = {
> diff --git a/drivers/net/wireless/ath/ath12k/hw.h
> b/drivers/net/wireless/ath/ath12k/hw.h
> index
> 0fbc17649df463334aa0ebb3da407115985335ca..0a75bc5abfa2410ab3c7b6ce038
> f4d5f6445ecf9 100644
> --- a/drivers/net/wireless/ath/ath12k/hw.h
> +++ b/drivers/net/wireless/ath/ath12k/hw.h
> @@ -375,6 +375,8 @@ struct ath12k_hw_regs {
>         u32 hal_reo_cmd_ring_base;
>  
>         u32 hal_reo_status_ring_base;
> +
> +       u32 gcc_gcc_pcie_hot_rst;
>  };
>  
>  static inline const char *ath12k_bd_ie_type_str(enum
> ath12k_bd_ie_type type)
> diff --git a/drivers/net/wireless/ath/ath12k/pci.c
> b/drivers/net/wireless/ath/ath12k/pci.c
> index
> 489d546390fcdab8f615cc9184006a958d9f140a..1f3cfd9b89fdcfd84731ec90c9c
> 678b0c477a2af 100644
> --- a/drivers/net/wireless/ath/ath12k/pci.c
> +++ b/drivers/net/wireless/ath/ath12k/pci.c
> @@ -292,10 +292,10 @@ static void ath12k_pci_enable_ltssm(struct
> ath12k_base *ab)
>  
>         ath12k_dbg(ab, ATH12K_DBG_PCI, "pci ltssm 0x%x\n", val);
>  
> -       val = ath12k_pci_read32(ab, GCC_GCC_PCIE_HOT_RST);
> +       val = ath12k_pci_read32(ab, GCC_GCC_PCIE_HOT_RST(ab));
>         val |= GCC_GCC_PCIE_HOT_RST_VAL;
> -       ath12k_pci_write32(ab, GCC_GCC_PCIE_HOT_RST, val);
> -       val = ath12k_pci_read32(ab, GCC_GCC_PCIE_HOT_RST);
> +       ath12k_pci_write32(ab, GCC_GCC_PCIE_HOT_RST(ab), val);
> +       val = ath12k_pci_read32(ab, GCC_GCC_PCIE_HOT_RST(ab));
>  
>         ath12k_dbg(ab, ATH12K_DBG_PCI, "pci pcie_hot_rst 0x%x\n",
> val);
>  
> diff --git a/drivers/net/wireless/ath/ath12k/pci.h
> b/drivers/net/wireless/ath/ath12k/pci.h
> index
> 0b4c459d6d8eabb0773162e6bb3ca666c0a8f15a..d1ec8aad7f6c3b6f5cbdf8ce57a
> 4106733686521 100644
> --- a/drivers/net/wireless/ath/ath12k/pci.h
> +++ b/drivers/net/wireless/ath/ath12k/pci.h
> @@ -28,7 +28,9 @@
>  #define PCIE_PCIE_PARF_LTSSM                   0x1e081b0
>  #define PARM_LTSSM_VALUE                       0x111
>  
> -#define GCC_GCC_PCIE_HOT_RST                   0x1e38338
> +#define GCC_GCC_PCIE_HOT_RST(ab) \
> +       ((ab)->hw_params->regs->gcc_gcc_pcie_hot_rst)
> +
>  #define GCC_GCC_PCIE_HOT_RST_VAL               0x10
>  
>  #define PCIE_PCIE_INT_ALL_CLEAR                        0x1e08228
> 
> ---
> base-commit: 3d933084a072fd5fb5da54c06a017abc0412c86f
> change-id: 20250506-ath12k-wrong-global-reset-addr-b75ddc6e7850
> 
> Best regards,


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

* Re: [PATCH ath-next] wifi: ath12k: fix GCC_GCC_PCIE_HOT_RST definition for WCN7850
  2025-05-23  2:23 [PATCH ath-next] wifi: ath12k: fix GCC_GCC_PCIE_HOT_RST definition for WCN7850 Baochen Qiang
  2025-05-23 13:48 ` Parth Panchoil
@ 2025-06-05  5:28 ` Vasanthakumar Thiagarajan
  2025-06-07 14:44 ` Jeff Johnson
  2 siblings, 0 replies; 4+ messages in thread
From: Vasanthakumar Thiagarajan @ 2025-06-05  5:28 UTC (permalink / raw)
  To: Baochen Qiang, Jeff Johnson, Pradeep Kumar Chitrapu, Wen Gong,
	Bhagavathi Perumal S, P Praneesh
  Cc: Sriram R, linux-wireless, ath12k, linux-kernel, Parth Panchoil



On 5/23/2025 7:53 AM, Baochen Qiang wrote:
> GCC_GCC_PCIE_HOT_RST is wrongly defined for WCN7850, causing kernel crash
> on some specific platforms.
> 
> Since this register is divergent for WCN7850 and QCN9274, move it to
> register table to allow different definitions. Then correct the register
> address for WCN7850 to fix this issue.
> 
> Note IPQ5332 is not affected as it is not PCIe based device.
> 
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
> 
> Reported-by: Parth Panchoil <parth105105@gmail.com>
> Closes: https://lore.kernel.org/all/86899b2235a59c9134603beebe08f2bb0b244ea0.camel@gmail.com
> Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>

Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>

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

* Re: [PATCH ath-next] wifi: ath12k: fix GCC_GCC_PCIE_HOT_RST definition for WCN7850
  2025-05-23  2:23 [PATCH ath-next] wifi: ath12k: fix GCC_GCC_PCIE_HOT_RST definition for WCN7850 Baochen Qiang
  2025-05-23 13:48 ` Parth Panchoil
  2025-06-05  5:28 ` Vasanthakumar Thiagarajan
@ 2025-06-07 14:44 ` Jeff Johnson
  2 siblings, 0 replies; 4+ messages in thread
From: Jeff Johnson @ 2025-06-07 14:44 UTC (permalink / raw)
  To: Jeff Johnson, Pradeep Kumar Chitrapu, Wen Gong,
	Vasanthakumar Thiagarajan, Bhagavathi Perumal S, P Praneesh,
	Baochen Qiang
  Cc: Sriram R, linux-wireless, ath12k, linux-kernel, Parth Panchoil


On Fri, 23 May 2025 10:23:05 +0800, Baochen Qiang wrote:
> GCC_GCC_PCIE_HOT_RST is wrongly defined for WCN7850, causing kernel crash
> on some specific platforms.
> 
> Since this register is divergent for WCN7850 and QCN9274, move it to
> register table to allow different definitions. Then correct the register
> address for WCN7850 to fix this issue.
> 
> [...]

Applied, thanks!

[1/1] wifi: ath12k: fix GCC_GCC_PCIE_HOT_RST definition for WCN7850
      commit: 7588a893cde5385ad308400ff167d29a29913b3a

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


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

end of thread, other threads:[~2025-06-07 14:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-23  2:23 [PATCH ath-next] wifi: ath12k: fix GCC_GCC_PCIE_HOT_RST definition for WCN7850 Baochen Qiang
2025-05-23 13:48 ` Parth Panchoil
2025-06-05  5:28 ` Vasanthakumar Thiagarajan
2025-06-07 14: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;
as well as URLs for NNTP newsgroup(s).