Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH v4 4/4] Bluetooth: btintel_pcie: clear the GP0 cause with a W1C write
  2026-09-26  8:52 [PATCH v4 1/4] Bluetooth: btintel_pcie: fix stale cache in set_dxstate fallback check Ravindra
@ 2026-09-26  8:53 ` Ravindra
  2026-09-26 14:45   ` Sergey Lebedev
  0 siblings, 1 reply; 5+ messages in thread
From: Ravindra @ 2026-09-26  8:53 UTC (permalink / raw)
  To: linux-bluetooth, lsa.uz, vladimirkondratyev2
  Cc: chethan.tumkur.narayan, kiran.k, Paul Menzel, Ravindra

MSIX_HW_INT_CAUSES is a write-one-to-clear register. Using a
read-modify-write helper writes zero to GP0, leaving the cause uncleared,
and can acknowledge unrelated pending causes through the read value.

Write only the GP0 bit directly, matching the interrupt handler's W1C
acknowledgment convention.

Fixes: 88c6216a52ea ("Bluetooth: btintel_pcie: Suspend/Resume: Controller doorbell interrupt handling")
Signed-off-by: Ravindra <ravindra@intel.com>
---
 drivers/bluetooth/btintel_pcie.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c
index 553fa927cf0a..9fda057ca9a1 100644
--- a/drivers/bluetooth/btintel_pcie.c
+++ b/drivers/bluetooth/btintel_pcie.c
@@ -4217,10 +4217,12 @@ static int btintel_pcie_set_dxstate(struct btintel_pcie_data *data, u32 dxstate)
 				    "Timeout (%u ms) on alive interrupt for D%d entry, retry count %d",
 				    dx_intr_timeout_ms, dxstate, retry);
 
-			/* clear gp0 cause */
-			btintel_pcie_clr_reg_bits(data,
-						  BTINTEL_PCIE_CSR_MSIX_HW_INT_CAUSES,
-						  BTINTEL_PCIE_MSIX_HW_INT_CAUSES_GP0);
+			/* MSIX_HW_INT_CAUSES is W1C. Write only GP0 so other
+			 * pending causes are not acknowledged here.
+			 */
+			btintel_pcie_wr_reg32(data,
+					      BTINTEL_PCIE_CSR_MSIX_HW_INT_CAUSES,
+					      BTINTEL_PCIE_MSIX_HW_INT_CAUSES_GP0);
 		}
 
 		/* gp0_received is set at the top of the handler, before the switch on
-- 
2.43.0


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

* Re: [PATCH v4 4/4] Bluetooth: btintel_pcie: clear the GP0 cause with a W1C write
  2026-09-26  8:53 ` [PATCH v4 4/4] Bluetooth: btintel_pcie: clear the GP0 cause with a W1C write Ravindra
@ 2026-09-26 14:45   ` Sergey Lebedev
  0 siblings, 0 replies; 5+ messages in thread
From: Sergey Lebedev @ 2026-09-26 14:45 UTC (permalink / raw)
  To: Ravindra
  Cc: linux-bluetooth, Vladimir V . Kondratyev, Chethan Tumkur Narayan,
	Kiran K, Paul Menzel

On a Surface Pro 11 (BE201 8086:a876) in s2idle, with the rest of v4,
including cycles that take the timeout path and so this write:

Tested-by: Sergey Lebedev <lsa.uz@pm.me>
Reviewed-by: Sergey Lebedev <lsa.uz@pm.me>


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

* [PATCH v4 4/4] Bluetooth: btintel_pcie: clear the GP0 cause with a W1C write
@ 2026-09-27 15:23 Ravindra
  2026-09-27 22:52 ` [v4,4/4] " bluez.test.bot
  2026-09-29 15:10 ` [PATCH v4 4/4] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 5+ messages in thread
From: Ravindra @ 2026-09-27 15:23 UTC (permalink / raw)
  To: linux-bluetooth, lsa.uz, vladimirkondratyev2
  Cc: chethan.tumkur.narayan, kiran.k, pmenzel, Ravindra

MSIX_HW_INT_CAUSES is a write-one-to-clear register. Using a
read-modify-write helper writes zero to GP0, leaving the cause uncleared,
and can acknowledge unrelated pending causes through the read value.

Write only the GP0 bit directly, matching the interrupt handler's W1C
acknowledgment convention.

Fixes: 88c6216a52ea ("Bluetooth: btintel_pcie: Suspend/Resume: Controller doorbell interrupt handling")
Signed-off-by: Ravindra <ravindra@intel.com>
Tested-by: Sergey Lebedev <lsa.uz@pm.me>
Reviewed-by: Sergey Lebedev <lsa.uz@pm.me>
---
 drivers/bluetooth/btintel_pcie.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c
index 553fa927cf0a..9fda057ca9a1 100644
--- a/drivers/bluetooth/btintel_pcie.c
+++ b/drivers/bluetooth/btintel_pcie.c
@@ -4217,10 +4217,12 @@ static int btintel_pcie_set_dxstate(struct btintel_pcie_data *data, u32 dxstate)
 				    "Timeout (%u ms) on alive interrupt for D%d entry, retry count %d",
 				    dx_intr_timeout_ms, dxstate, retry);
 
-			/* clear gp0 cause */
-			btintel_pcie_clr_reg_bits(data,
-						  BTINTEL_PCIE_CSR_MSIX_HW_INT_CAUSES,
-						  BTINTEL_PCIE_MSIX_HW_INT_CAUSES_GP0);
+			/* MSIX_HW_INT_CAUSES is W1C. Write only GP0 so other
+			 * pending causes are not acknowledged here.
+			 */
+			btintel_pcie_wr_reg32(data,
+					      BTINTEL_PCIE_CSR_MSIX_HW_INT_CAUSES,
+					      BTINTEL_PCIE_MSIX_HW_INT_CAUSES_GP0);
 		}
 
 		/* gp0_received is set at the top of the handler, before the switch on
-- 
2.43.0


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

* RE: [v4,4/4] Bluetooth: btintel_pcie: clear the GP0 cause with a W1C write
  2026-09-27 15:23 [PATCH v4 4/4] Bluetooth: btintel_pcie: clear the GP0 cause with a W1C write Ravindra
@ 2026-09-27 22:52 ` bluez.test.bot
  2026-09-29 15:10 ` [PATCH v4 4/4] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2026-09-27 22:52 UTC (permalink / raw)
  To: linux-bluetooth, ravindra

[-- Attachment #1: Type: text/plain, Size: 863 bytes --]

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----

error: patch failed: drivers/bluetooth/btintel_pcie.c:4217
error: drivers/bluetooth/btintel_pcie.c: patch does not apply
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"

Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth


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

* Re: [PATCH v4 4/4] Bluetooth: btintel_pcie: clear the GP0 cause with a W1C write
  2026-09-27 15:23 [PATCH v4 4/4] Bluetooth: btintel_pcie: clear the GP0 cause with a W1C write Ravindra
  2026-09-27 22:52 ` [v4,4/4] " bluez.test.bot
@ 2026-09-29 15:10 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+bluetooth @ 2026-09-29 15:10 UTC (permalink / raw)
  To: Ravindra
  Cc: linux-bluetooth, lsa.uz, vladimirkondratyev2,
	chethan.tumkur.narayan, kiran.k, pmenzel

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Sun, 27 Sep 2026 20:53:56 +0530 you wrote:
> MSIX_HW_INT_CAUSES is a write-one-to-clear register. Using a
> read-modify-write helper writes zero to GP0, leaving the cause uncleared,
> and can acknowledge unrelated pending causes through the read value.
> 
> Write only the GP0 bit directly, matching the interrupt handler's W1C
> acknowledgment convention.
> 
> [...]

Here is the summary with links:
  - [v4,4/4] Bluetooth: btintel_pcie: clear the GP0 cause with a W1C write
    https://git.kernel.org/bluetooth/bluetooth-next/c/6091d2771395

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2026-09-29 15:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-27 15:23 [PATCH v4 4/4] Bluetooth: btintel_pcie: clear the GP0 cause with a W1C write Ravindra
2026-09-27 22:52 ` [v4,4/4] " bluez.test.bot
2026-09-29 15:10 ` [PATCH v4 4/4] " patchwork-bot+bluetooth
  -- strict thread matches above, loose matches on Subject: below --
2026-09-26  8:52 [PATCH v4 1/4] Bluetooth: btintel_pcie: fix stale cache in set_dxstate fallback check Ravindra
2026-09-26  8:53 ` [PATCH v4 4/4] Bluetooth: btintel_pcie: clear the GP0 cause with a W1C write Ravindra
2026-09-26 14:45   ` Sergey Lebedev

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