Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btmtk: remove redundant memory barrier with helper
@ 2026-10-21 14:51 Arnaud Bonnet
  2026-10-21 17:58 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Arnaud Bonnet @ 2026-10-21 14:51 UTC (permalink / raw)
  To: marcel, luiz.dentz, matthias.bgg, angelogioacchino.delregno
  Cc: linux-bluetooth, linux-arm-kernel, linux-mediatek, jkoolstra,
	skhan, Arnaud Bonnet

The test_and_clear_bit() call works as a full memory barrier, thus it is
not required to emit a barrier using smp_mb__after_atomic() before
wake_up_bit().

Replace the whole sequence with test_and_clear_wake_up_bit(), which was
introduced later in commit 52d633def56c ("sched: Add
test_and_clear_wake_up_bit() and atomic_dec_and_wake_up()") as a wrapper
for the correct sequence.

Signed-off-by: Arnaud Bonnet <abo@medichon.fr>
---
Tested by building and manually checking generated assembly on x86, arm64
and riscv64.

 drivers/bluetooth/btmtk.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c
index 75483d8230e1..a620e24b6c17 100644
--- a/drivers/bluetooth/btmtk.c
+++ b/drivers/bluetooth/btmtk.c
@@ -607,13 +607,7 @@ static void btmtk_usb_wmt_recv(struct urb *urb)
 			return;
 		}
 
-		if (test_and_clear_bit(BTMTK_TX_WAIT_VND_EVT,
-				       &data->flags)) {
-			/* Barrier to sync with other CPUs */
-			smp_mb__after_atomic();
-			wake_up_bit(&data->flags,
-				    BTMTK_TX_WAIT_VND_EVT);
-		}
+		test_and_clear_wake_up_bit(BTMTK_TX_WAIT_VND_EVT, &data->flags);
 		kfree(urb->setup_packet);
 		return;
 	} else if (urb->status == -ENOENT) {
-- 
2.53.0


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

* RE: Bluetooth: btmtk: remove redundant memory barrier with helper
  2026-10-21 14:51 [PATCH] Bluetooth: btmtk: remove redundant memory barrier with helper Arnaud Bonnet
@ 2026-10-21 17:58 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2026-10-21 17:58 UTC (permalink / raw)
  To: linux-bluetooth, abo

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

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1190579/

---Test result---

Test Summary:
CheckPatch                    PASS      0.53 seconds
VerifyFixes                   PASS      0.11 seconds
VerifySignedoff               PASS      0.11 seconds
GitLint                       PASS      0.27 seconds
SubjectPrefix                 PASS      0.10 seconds
BuildKernel                   PASS      19.92 seconds
CheckAllWarning               PASS      23.68 seconds
CheckSparse                   PASS      24.93 seconds
BuildKernel32                 PASS      21.16 seconds
CheckKernelLLVM               PASS      21.15 seconds
TestRunnerSetup               PASS      469.61 seconds
IncrementalBuild              PASS      19.97 seconds



https://github.com/bluez/bluetooth-next/pull/974

---
Regards,
Linux Bluetooth


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

end of thread, other threads:[~2026-10-21 17:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-21 14:51 [PATCH] Bluetooth: btmtk: remove redundant memory barrier with helper Arnaud Bonnet
2026-10-21 17:58 ` bluez.test.bot

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