Skip to contentSkip to conversation

Bluetooth: hci_ldisc: Use speed set by btattach as oper_speed

PATCH Applied Frédéric Danis 2 participants 2 messages Aug 20, 2024 – Aug 21, 2024 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Bluetooth: hci_ldisc: Use speed set by btattach as oper_speed

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.

---
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(+)
drivers/bluetooth/hci_ldisc.c +3 -0
index d307c41a5470..395d66e32a2e 100644
@@ -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);
 
Signature · 1 line
2.34.1
#1 lore raw
This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 8 lines · 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!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html