diff mbox series

[v2] Bluetooth: hci_ldisc: Use speed set by btattach as oper_speed

Message ID 20240820141716.288862-1-frederic.danis@collabora.com (mailing list archive)
State Accepted
Commit 96f44a40e702d7685017022dcaee81d3b54ebff2
Headers show
Series [v2] Bluetooth: hci_ldisc: Use speed set by btattach as oper_speed | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/SubjectPrefix success Gitlint PASS
tedd_an/BuildKernel success BuildKernel PASS
tedd_an/CheckAllWarning success CheckAllWarning PASS
tedd_an/CheckSparse success CheckSparse PASS

Commit Message

Frédéric Danis Aug. 20, 2024, 2:17 p.m. UTC
Starting a BCM UART controller not defined as a platform device or
a serdev with "btattach -B /dev/ttyS1 -P bcm -S 3000000" works fine
but the serial port remains at the init_speed, i.e. 115200.

The oper_speed is only set if a device is declared in ACPI, device
tree or as a platform device.

This commit copies the serial port speed fixed by hciattach to the
oper_speed on line discipline opening.

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
---
This has been tested with 5.4 kernel only.
Afaict there's no change in this driver which should be impacted by
this commit in latest kernel.

v1 -> v2: Move speed copy from hci_bcm driver to hci_ldisc to be
          more generic

 drivers/bluetooth/hci_ldisc.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

patchwork-bot+bluetooth@kernel.org Aug. 21, 2024, 2:50 p.m. UTC | #1
Hello:

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

On Tue, 20 Aug 2024 16:17:16 +0200 you wrote:
> Starting a BCM UART controller not defined as a platform device or
> a serdev with "btattach -B /dev/ttyS1 -P bcm -S 3000000" works fine
> but the serial port remains at the init_speed, i.e. 115200.
> 
> The oper_speed is only set if a device is declared in ACPI, device
> tree or as a platform device.
> 
> [...]

Here is the summary with links:
  - [v2] Bluetooth: hci_ldisc: Use speed set by btattach as oper_speed
    https://git.kernel.org/bluetooth/bluetooth-next/c/96f44a40e702

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index d307c41a5470..395d66e32a2e 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -507,6 +507,9 @@  static int hci_uart_tty_open(struct tty_struct *tty)
 	hu->alignment = 1;
 	hu->padding = 0;
 
+	/* Use serial port speed as oper_speed */
+	hu->oper_speed = tty->termios.c_ospeed;
+
 	INIT_WORK(&hu->init_ready, hci_uart_init_work);
 	INIT_WORK(&hu->write_work, hci_uart_write_work);