mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] wifi: ath11k: Flush the posted write after writing to PCIE_SOC_GLOBAL_RESET
@ 2026-06-23 14:16 Manivannan Sadhasivam
  2026-06-23 14:16 ` [PATCH 2/2] wifi: ath12k: " Manivannan Sadhasivam
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Manivannan Sadhasivam @ 2026-06-23 14:16 UTC (permalink / raw)
  To: jjohnson
  Cc: linux-wireless, ath12k, ath11k, linux-kernel, mani,
	Manivannan Sadhasivam, Alex Williamson

ath11k_pci_soc_global_reset() tries to reset the device by writing to the
PCIE_SOC_GLOBAL_RESET register. But it doesn't do a read-back to ensure
that the write gets flushed to the device before the delay.

This may lead to the delay on the host to be insufficient, if the posted
write doesn't reach the device before the delay.

So add a read-back after writing to the PCIE_SOC_GLOBAL_RESET register and
before the delay.

Compile tested only.

Fixes: f3c603d412b3 ("ath11k: reset MHI during power down and power up")
Reported-by: Alex Williamson <alex@shazbot.org>
Closes: https://lore.kernel.org/linux-pci/20260622160822.09350246@shazbot.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
---
 drivers/net/wireless/ath/ath11k/pci.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/ath/ath11k/pci.c
index 35bb9e7a63a2..a163168f3617 100644
--- a/drivers/net/wireless/ath/ath11k/pci.c
+++ b/drivers/net/wireless/ath/ath11k/pci.c
@@ -199,6 +199,8 @@ static void ath11k_pci_soc_global_reset(struct ath11k_base *ab)
 	val |= PCIE_SOC_GLOBAL_RESET_V;
 
 	ath11k_pcic_write32(ab, PCIE_SOC_GLOBAL_RESET, val);
+	/* Flush the posted write to the device */
+	ath11k_pcic_read32(ab, PCIE_SOC_GLOBAL_RESET);
 
 	/* TODO: exact time to sleep is uncertain */
 	delay = 10;
@@ -208,6 +210,8 @@ static void ath11k_pci_soc_global_reset(struct ath11k_base *ab)
 	val &= ~PCIE_SOC_GLOBAL_RESET_V;
 
 	ath11k_pcic_write32(ab, PCIE_SOC_GLOBAL_RESET, val);
+	/* Flush the posted write to the device */
+	ath11k_pcic_read32(ab, PCIE_SOC_GLOBAL_RESET);
 
 	mdelay(delay);
 
-- 
2.43.0


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

* [PATCH 2/2] wifi: ath12k: Flush the posted write after writing to PCIE_SOC_GLOBAL_RESET
  2026-06-23 14:16 [PATCH 1/2] wifi: ath11k: Flush the posted write after writing to PCIE_SOC_GLOBAL_RESET Manivannan Sadhasivam
@ 2026-06-23 14:16 ` Manivannan Sadhasivam
  2026-06-30  9:43   ` Raj Kumar Bhagat
                     ` (2 more replies)
  2026-06-30  9:45 ` [PATCH 1/2] wifi: ath11k: " Raj Kumar Bhagat
                   ` (2 subsequent siblings)
  3 siblings, 3 replies; 8+ messages in thread
From: Manivannan Sadhasivam @ 2026-06-23 14:16 UTC (permalink / raw)
  To: jjohnson
  Cc: linux-wireless, ath12k, ath11k, linux-kernel, mani,
	Manivannan Sadhasivam, Alex Williamson

ath12k_pci_soc_global_reset() tries to reset the device by writing to the
PCIE_SOC_GLOBAL_RESET register. But it doesn't do a read-back to ensure
that the write gets flushed to the device before the delay.

This may lead to the delay on the host to be insufficient, if the posted
write doesn't reach the device before the delay.

So add a read-back after writing to the PCIE_SOC_GLOBAL_RESET register and
before the delay.

Compile tested only.

Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Reported-by: Alex Williamson <alex@shazbot.org>
Closes: https://lore.kernel.org/linux-pci/20260622160822.09350246@shazbot.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
---
 drivers/net/wireless/ath/ath12k/pci.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c
index d9a22d6afbb0..fee4129ea405 100644
--- a/drivers/net/wireless/ath/ath12k/pci.c
+++ b/drivers/net/wireless/ath/ath12k/pci.c
@@ -188,6 +188,8 @@ static void ath12k_pci_soc_global_reset(struct ath12k_base *ab)
 	val |= PCIE_SOC_GLOBAL_RESET_V;
 
 	ath12k_pci_write32(ab, PCIE_SOC_GLOBAL_RESET, val);
+	/* Flush the posted write to the device */
+	ath12k_pci_read32(ab, PCIE_SOC_GLOBAL_RESET);
 
 	/* TODO: exact time to sleep is uncertain */
 	delay = 10;
@@ -197,6 +199,8 @@ static void ath12k_pci_soc_global_reset(struct ath12k_base *ab)
 	val &= ~PCIE_SOC_GLOBAL_RESET_V;
 
 	ath12k_pci_write32(ab, PCIE_SOC_GLOBAL_RESET, val);
+	/* Flush the posted write to the device */
+	ath12k_pci_read32(ab, PCIE_SOC_GLOBAL_RESET);
 
 	mdelay(delay);
 
-- 
2.43.0


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

* Re: [PATCH 2/2] wifi: ath12k: Flush the posted write after writing to PCIE_SOC_GLOBAL_RESET
  2026-06-23 14:16 ` [PATCH 2/2] wifi: ath12k: " Manivannan Sadhasivam
@ 2026-06-30  9:43   ` Raj Kumar Bhagat
  2026-06-30  9:54   ` Raj Kumar Bhagat
  2026-07-03  7:03   ` Baochen Qiang
  2 siblings, 0 replies; 8+ messages in thread
From: Raj Kumar Bhagat @ 2026-06-30  9:43 UTC (permalink / raw)
  To: Manivannan Sadhasivam, jjohnson
  Cc: linux-wireless, ath12k, ath11k, linux-kernel, mani, Alex Williamson

On 23-06-2026 19:46, Manivannan Sadhasivam wrote:
> ath12k_pci_soc_global_reset() tries to reset the device by writing to the
> PCIE_SOC_GLOBAL_RESET register. But it doesn't do a read-back to ensure
> that the write gets flushed to the device before the delay.
> 
> This may lead to the delay on the host to be insufficient, if the posted
> write doesn't reach the device before the delay.
> 
> So add a read-back after writing to the PCIE_SOC_GLOBAL_RESET register and
> before the delay.
> 
> Compile tested only.
> 
> Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
> Reported-by: Alex Williamson<alex@shazbot.org>
> Closes:https://lore.kernel.org/linux-pci/20260622160822.09350246@shazbot.org
> Signed-off-by: Manivannan Sadhasivam<manivannan.sadhasivam@oss.qualcomm.com>
> ---
>   drivers/net/wireless/ath/ath12k/pci.c | 4 ++++
>   1 file changed, 4 insertions(+)

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1

Tested-by: Raj Kumar Bhagat <raj.bhagat@oss.qualcomm.com>

Validated with 25+ successful ath12k and ath12k_wifi7 module reload
(rmmod/insmod) cycles on QCN9274.

-- 
Raj Bhagat

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

* Re: [PATCH 1/2] wifi: ath11k: Flush the posted write after writing to PCIE_SOC_GLOBAL_RESET
  2026-06-23 14:16 [PATCH 1/2] wifi: ath11k: Flush the posted write after writing to PCIE_SOC_GLOBAL_RESET Manivannan Sadhasivam
  2026-06-23 14:16 ` [PATCH 2/2] wifi: ath12k: " Manivannan Sadhasivam
@ 2026-06-30  9:45 ` Raj Kumar Bhagat
  2026-07-03  7:03 ` Baochen Qiang
  2026-07-09 14:49 ` Jeff Johnson
  3 siblings, 0 replies; 8+ messages in thread
From: Raj Kumar Bhagat @ 2026-06-30  9:45 UTC (permalink / raw)
  To: Manivannan Sadhasivam, jjohnson
  Cc: linux-wireless, ath12k, ath11k, linux-kernel, mani, Alex Williamson

On 23-06-2026 19:46, Manivannan Sadhasivam wrote:
> ath11k_pci_soc_global_reset() tries to reset the device by writing to the
> PCIE_SOC_GLOBAL_RESET register. But it doesn't do a read-back to ensure
> that the write gets flushed to the device before the delay.
> 
> This may lead to the delay on the host to be insufficient, if the posted
> write doesn't reach the device before the delay.
> 
> So add a read-back after writing to the PCIE_SOC_GLOBAL_RESET register and
> before the delay.
> 
> Compile tested only.
> 
> Fixes: f3c603d412b3 ("ath11k: reset MHI during power down and power up")
> Reported-by: Alex Williamson<alex@shazbot.org>
> Closes:https://lore.kernel.org/linux-pci/20260622160822.09350246@shazbot.org
> Signed-off-by: Manivannan Sadhasivam<manivannan.sadhasivam@oss.qualcomm.com>
> ---
>   drivers/net/wireless/ath/ath11k/pci.c | 4 ++++
>   1 file changed, 4 insertions(+)

Reviewed-by: Raj Kumar Bhagat <raj.bhagat@oss.qualcomm.com>

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

* Re: [PATCH 2/2] wifi: ath12k: Flush the posted write after writing to PCIE_SOC_GLOBAL_RESET
  2026-06-23 14:16 ` [PATCH 2/2] wifi: ath12k: " Manivannan Sadhasivam
  2026-06-30  9:43   ` Raj Kumar Bhagat
@ 2026-06-30  9:54   ` Raj Kumar Bhagat
  2026-07-03  7:03   ` Baochen Qiang
  2 siblings, 0 replies; 8+ messages in thread
From: Raj Kumar Bhagat @ 2026-06-30  9:54 UTC (permalink / raw)
  To: Manivannan Sadhasivam, jjohnson
  Cc: linux-wireless, ath12k, ath11k, linux-kernel, mani, Alex Williamson

On 23-06-2026 19:46, Manivannan Sadhasivam wrote:
> ath12k_pci_soc_global_reset() tries to reset the device by writing to the
> PCIE_SOC_GLOBAL_RESET register. But it doesn't do a read-back to ensure
> that the write gets flushed to the device before the delay.
> 
> This may lead to the delay on the host to be insufficient, if the posted
> write doesn't reach the device before the delay.
> 
> So add a read-back after writing to the PCIE_SOC_GLOBAL_RESET register and
> before the delay.
> 
> Compile tested only.
> 
> Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
> Reported-by: Alex Williamson<alex@shazbot.org>
> Closes:https://lore.kernel.org/linux-pci/20260622160822.09350246@shazbot.org
> Signed-off-by: Manivannan Sadhasivam<manivannan.sadhasivam@oss.qualcomm.com>
> ---
>   drivers/net/wireless/ath/ath12k/pci.c | 4 ++++
>   1 file changed, 4 insertions(+)

Reviewed-by: Raj Kumar Bhagat <raj.bhagat@oss.qualcomm.com>

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

* Re: [PATCH 1/2] wifi: ath11k: Flush the posted write after writing to PCIE_SOC_GLOBAL_RESET
  2026-06-23 14:16 [PATCH 1/2] wifi: ath11k: Flush the posted write after writing to PCIE_SOC_GLOBAL_RESET Manivannan Sadhasivam
  2026-06-23 14:16 ` [PATCH 2/2] wifi: ath12k: " Manivannan Sadhasivam
  2026-06-30  9:45 ` [PATCH 1/2] wifi: ath11k: " Raj Kumar Bhagat
@ 2026-07-03  7:03 ` Baochen Qiang
  2026-07-09 14:49 ` Jeff Johnson
  3 siblings, 0 replies; 8+ messages in thread
From: Baochen Qiang @ 2026-07-03  7:03 UTC (permalink / raw)
  To: Manivannan Sadhasivam, jjohnson
  Cc: linux-wireless, ath12k, ath11k, linux-kernel, mani, Alex Williamson



On 6/23/2026 10:16 PM, Manivannan Sadhasivam wrote:
> ath11k_pci_soc_global_reset() tries to reset the device by writing to the
> PCIE_SOC_GLOBAL_RESET register. But it doesn't do a read-back to ensure
> that the write gets flushed to the device before the delay.
> 
> This may lead to the delay on the host to be insufficient, if the posted
> write doesn't reach the device before the delay.
> 
> So add a read-back after writing to the PCIE_SOC_GLOBAL_RESET register and
> before the delay.
> 
> Compile tested only.
> 
> Fixes: f3c603d412b3 ("ath11k: reset MHI during power down and power up")
> Reported-by: Alex Williamson <alex@shazbot.org>
> Closes: https://lore.kernel.org/linux-pci/20260622160822.09350246@shazbot.org
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>

Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>

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

* Re: [PATCH 2/2] wifi: ath12k: Flush the posted write after writing to PCIE_SOC_GLOBAL_RESET
  2026-06-23 14:16 ` [PATCH 2/2] wifi: ath12k: " Manivannan Sadhasivam
  2026-06-30  9:43   ` Raj Kumar Bhagat
  2026-06-30  9:54   ` Raj Kumar Bhagat
@ 2026-07-03  7:03   ` Baochen Qiang
  2 siblings, 0 replies; 8+ messages in thread
From: Baochen Qiang @ 2026-07-03  7:03 UTC (permalink / raw)
  To: Manivannan Sadhasivam, jjohnson
  Cc: linux-wireless, ath12k, ath11k, linux-kernel, mani, Alex Williamson



On 6/23/2026 10:16 PM, Manivannan Sadhasivam wrote:
> ath12k_pci_soc_global_reset() tries to reset the device by writing to the
> PCIE_SOC_GLOBAL_RESET register. But it doesn't do a read-back to ensure
> that the write gets flushed to the device before the delay.
> 
> This may lead to the delay on the host to be insufficient, if the posted
> write doesn't reach the device before the delay.
> 
> So add a read-back after writing to the PCIE_SOC_GLOBAL_RESET register and
> before the delay.
> 
> Compile tested only.
> 
> Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
> Reported-by: Alex Williamson <alex@shazbot.org>
> Closes: https://lore.kernel.org/linux-pci/20260622160822.09350246@shazbot.org
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>

Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>

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

* Re: [PATCH 1/2] wifi: ath11k: Flush the posted write after writing to PCIE_SOC_GLOBAL_RESET
  2026-06-23 14:16 [PATCH 1/2] wifi: ath11k: Flush the posted write after writing to PCIE_SOC_GLOBAL_RESET Manivannan Sadhasivam
                   ` (2 preceding siblings ...)
  2026-07-03  7:03 ` Baochen Qiang
@ 2026-07-09 14:49 ` Jeff Johnson
  3 siblings, 0 replies; 8+ messages in thread
From: Jeff Johnson @ 2026-07-09 14:49 UTC (permalink / raw)
  To: jjohnson, Manivannan Sadhasivam
  Cc: linux-wireless, ath12k, ath11k, linux-kernel, mani, Alex Williamson


On Tue, 23 Jun 2026 16:16:48 +0200, Manivannan Sadhasivam wrote:
> ath11k_pci_soc_global_reset() tries to reset the device by writing to the
> PCIE_SOC_GLOBAL_RESET register. But it doesn't do a read-back to ensure
> that the write gets flushed to the device before the delay.
> 
> This may lead to the delay on the host to be insufficient, if the posted
> write doesn't reach the device before the delay.
> 
> [...]

Applied, thanks!

[1/2] wifi: ath11k: Flush the posted write after writing to PCIE_SOC_GLOBAL_RESET
      commit: 0fe8010fc5b147607fc19ba010ba469afc95f35f
[2/2] wifi: ath12k: Flush the posted write after writing to PCIE_SOC_GLOBAL_RESET
      commit: 55f3aa06951cac78b0206bde961c8cf11929a27a

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


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

end of thread, other threads:[~2026-07-09 14:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-23 14:16 [PATCH 1/2] wifi: ath11k: Flush the posted write after writing to PCIE_SOC_GLOBAL_RESET Manivannan Sadhasivam
2026-06-23 14:16 ` [PATCH 2/2] wifi: ath12k: " Manivannan Sadhasivam
2026-06-30  9:43   ` Raj Kumar Bhagat
2026-06-30  9:54   ` Raj Kumar Bhagat
2026-07-03  7:03   ` Baochen Qiang
2026-06-30  9:45 ` [PATCH 1/2] wifi: ath11k: " Raj Kumar Bhagat
2026-07-03  7:03 ` Baochen Qiang
2026-07-09 14:49 ` Jeff Johnson

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®