linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Add default wakeup callback for HCI UART driver
@ 2022-07-04 10:33 Ying Hsu
  2022-07-04 11:07 ` bluez.test.bot
  2022-07-20 16:20 ` [PATCH] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Ying Hsu @ 2022-07-04 10:33 UTC (permalink / raw)
  To: marcel
  Cc: chromeos-bluetooth-upstreaming, Ying Hsu, Alain Michaud,
	Johan Hedberg, Luiz Augusto von Dentz, linux-bluetooth,
	linux-kernel

Bluetooth HCI devices indicate if they are able to wakeup in the wakeup
callback since 'commit 4539ca67fe8e ("Bluetooth: Rename driver
.prevent_wake to .wakeup")'. This patch adds a default wakeup callback
for Bluetooth HCI UAR devices. It assumes Bluetooth HCI UART devices are
wakeable for backward compatibility. For those who need a customized
behavior, one can override it before calling hci_uart_register_device().

Fixes: 4539ca67fe8e ("Bluetooth: Rename driver .prevent_wake to .wakeup")
Signed-off-by: Ying Hsu <yinghsu@chromium.org>
Reviewed-by: Alain Michaud <alainm@chromium.org>
---
Tested this commit on trogdor (wcn399x) and hayato (RTL8822-UART).
For platforms with QCA UART connectivity, such as trogdor, we revert the
commit c1a74160eaf1 ("Bluetooth: hci_qca: Add device_may_wakeup
support") downstream as qca_wakeup() returns false and breaks wake-on-bt.

 drivers/bluetooth/hci_serdev.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/bluetooth/hci_serdev.c b/drivers/bluetooth/hci_serdev.c
index 4cda890ce647..c0e5f42ec6b7 100644
--- a/drivers/bluetooth/hci_serdev.c
+++ b/drivers/bluetooth/hci_serdev.c
@@ -231,6 +231,15 @@ static int hci_uart_setup(struct hci_dev *hdev)
 	return 0;
 }
 
+/* Check if the device is wakeable */
+static bool hci_uart_wakeup(struct hci_dev *hdev)
+{
+	/* HCI UART devices are assumed to be wakeable by default.
+	 * Implement wakeup callback to override this behavior.
+	 */
+	return true;
+}
+
 /** hci_uart_write_wakeup - transmit buffer wakeup
  * @serdev: serial device
  *
@@ -342,6 +351,8 @@ int hci_uart_register_device(struct hci_uart *hu,
 	hdev->flush = hci_uart_flush;
 	hdev->send  = hci_uart_send_frame;
 	hdev->setup = hci_uart_setup;
+	if (!hdev->wakeup)
+		hdev->wakeup = hci_uart_wakeup;
 	SET_HCIDEV_DEV(hdev, &hu->serdev->dev);
 
 	if (test_bit(HCI_UART_NO_SUSPEND_NOTIFIER, &hu->flags))
-- 
2.37.0.rc0.161.g10f37bed90-goog


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

* RE: Bluetooth: Add default wakeup callback for HCI UART driver
  2022-07-04 10:33 [PATCH] Bluetooth: Add default wakeup callback for HCI UART driver Ying Hsu
@ 2022-07-04 11:07 ` bluez.test.bot
  2022-07-20 16:20 ` [PATCH] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2022-07-04 11:07 UTC (permalink / raw)
  To: linux-bluetooth, yinghsu

[-- Attachment #1: Type: text/plain, Size: 2041 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/project/bluetooth/list/?series=656284

---Test result---

Test Summary:
CheckPatch                    FAIL      1.75 seconds
GitLint                       PASS      0.96 seconds
SubjectPrefix                 PASS      0.80 seconds
BuildKernel                   PASS      31.48 seconds
BuildKernel32                 PASS      26.88 seconds
Incremental Build with patchesPASS      37.68 seconds
TestRunner: Setup             PASS      463.74 seconds
TestRunner: l2cap-tester      PASS      16.58 seconds
TestRunner: bnep-tester       PASS      5.69 seconds
TestRunner: mgmt-tester       PASS      94.94 seconds
TestRunner: rfcomm-tester     PASS      9.05 seconds
TestRunner: sco-tester        PASS      8.93 seconds
TestRunner: smp-tester        PASS      8.91 seconds
TestRunner: userchan-tester   PASS      5.92 seconds

Details
##############################
Test: CheckPatch - FAIL - 1.75 seconds
Run checkpatch.pl script with rule in .checkpatch.conf
Bluetooth: Add default wakeup callback for HCI UART driver\ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit fatal: unsaf ("ace/src' is owned by someone else)")'
#82: 
callback since 'commit 4539ca67fe8e ("Bluetooth: Rename driver
.prevent_wake to .wakeup")'. This patch adds a default wakeup callback

total: 1 errors, 0 warnings, 23 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/12905037.patch has style problems, please review.

NOTE: Ignored message types: UNKNOWN_COMMIT_ID

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.




---
Regards,
Linux Bluetooth


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

* Re: [PATCH] Bluetooth: Add default wakeup callback for HCI UART driver
  2022-07-04 10:33 [PATCH] Bluetooth: Add default wakeup callback for HCI UART driver Ying Hsu
  2022-07-04 11:07 ` bluez.test.bot
@ 2022-07-20 16:20 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2022-07-20 16:20 UTC (permalink / raw)
  To: Ying Hsu
  Cc: marcel, chromeos-bluetooth-upstreaming, alainm, johan.hedberg,
	luiz.dentz, linux-bluetooth, linux-kernel

Hello:

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

On Mon,  4 Jul 2022 18:33:24 +0800 you wrote:
> Bluetooth HCI devices indicate if they are able to wakeup in the wakeup
> callback since 'commit 4539ca67fe8e ("Bluetooth: Rename driver
> .prevent_wake to .wakeup")'. This patch adds a default wakeup callback
> for Bluetooth HCI UAR devices. It assumes Bluetooth HCI UART devices are
> wakeable for backward compatibility. For those who need a customized
> behavior, one can override it before calling hci_uart_register_device().
> 
> [...]

Here is the summary with links:
  - Bluetooth: Add default wakeup callback for HCI UART driver
    https://git.kernel.org/bluetooth/bluetooth-next/c/db52f939ccf8

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] 3+ messages in thread

end of thread, other threads:[~2022-07-20 16:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-04 10:33 [PATCH] Bluetooth: Add default wakeup callback for HCI UART driver Ying Hsu
2022-07-04 11:07 ` bluez.test.bot
2022-07-20 16:20 ` [PATCH] " patchwork-bot+bluetooth

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).