Skip to contentSkip to conversation

Bluetooth: Replace dependency on SERIAL_DEV_BUS by selection

PATCH In review Andy Shevchenko 2 participants 4 messages Dec 28, 2017 – Dec 29, 2017 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Bluetooth: Replace dependency on SERIAL_DEV_BUS by selection

The change restores build behaviour for old configurations when user didn't know and thus didn't select SERIAL_DEV_BUS explicitly for given HCI modules, such as hci_bcm.

---
v2: get rid of recursive dependencies

 drivers/bluetooth/Kconfig | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/bluetooth/Kconfig +5 -10
index 60e1c7d6986d..ea3d114d19e5 100644
@@ -66,7 +66,6 @@ config BT_HCIBTSDIO
 
 config BT_HCIUART
 	tristate "HCI UART driver"
-	depends on SERIAL_DEV_BUS || !SERIAL_DEV_BUS
 	depends on TTY
 	help
 	  Bluetooth HCI UART driver.
@@ -78,11 +77,6 @@ config BT_HCIUART
 	  Say Y here to compile support for Bluetooth UART devices into the
 	  kernel or say M to compile it as module (hci_uart).
 
-config BT_HCIUART_SERDEV
-	bool
-	depends on SERIAL_DEV_BUS && BT_HCIUART
-	default y
-
 config BT_HCIUART_H4
 	bool "UART (H4) protocol support"
 	depends on BT_HCIUART
@@ -96,8 +90,8 @@ config BT_HCIUART_H4
 config BT_HCIUART_NOKIA
 	tristate "UART Nokia H4+ protocol support"
 	depends on BT_HCIUART
-	depends on BT_HCIUART_SERDEV
 	depends on PM
+	select SERIAL_DEV_BUS
 	select BT_HCIUART_H4
 	select BT_BCM
 	help
@@ -134,7 +128,8 @@ config BT_HCIUART_ATH3K
 
 config BT_HCIUART_LL
 	bool "HCILL protocol support"
-	depends on BT_HCIUART_SERDEV
+	depends on BT_HCIUART
+	select SERIAL_DEV_BUS
 	help
 	  HCILL (HCI Low Level) is a serial protocol for communication
 	  between Bluetooth device and host. This protocol is required for
@@ -169,8 +164,8 @@ config BT_HCIUART_INTEL
 config BT_HCIUART_BCM
 	bool "Broadcom protocol support"
 	depends on BT_HCIUART
-	depends on BT_HCIUART_SERDEV
-	depends on (!ACPI || SERIAL_DEV_CTRL_TTYPORT)
+	select SERIAL_DEV_CTRL_TTYPORT if !ACPI
+	select SERIAL_DEV_BUS
 	select BT_HCIUART_H4
 	select BT_BCM
 	help
Signature · 1 line
2.15.1
#1 lore raw
Quoted 4 lines · Andy Shevchenko

The change restores build behaviour for old configurations when user didn't know and thus didn't select SERIAL_DEV_BUS explicitly for given HCI modules, such as hci_bcm.

+Cc: Arnd, Rob.

Quoted 64 lines

---
v2: get rid of recursive dependencies

 drivers/bluetooth/Kconfig | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/bluetooth/Kconfig +0 -1
index 60e1c7d6986d..ea3d114d19e5 100644
@@ -66,7 +66,6 @@ config BT_HCIBTSDIO
 
 config BT_HCIUART
 	tristate "HCI UART driver"
-	depends on SERIAL_DEV_BUS || !SERIAL_DEV_BUS
 	depends on TTY
 	help
 	  Bluetooth HCI UART driver.
@@ -78,11 +77,6 @@ config BT_HCIUART
 	  Say Y here to compile support for Bluetooth UART devices

into the

drivers/bluetooth/Kconfig +3 -7
 	  kernel or say M to compile it as module (hci_uart).
 
-config BT_HCIUART_SERDEV
-	bool
-	depends on SERIAL_DEV_BUS && BT_HCIUART
-	default y
-
 config BT_HCIUART_H4
 	bool "UART (H4) protocol support"
 	depends on BT_HCIUART
@@ -96,8 +90,8 @@ config BT_HCIUART_H4
 config BT_HCIUART_NOKIA
 	tristate "UART Nokia H4+ protocol support"
 	depends on BT_HCIUART
-	depends on BT_HCIUART_SERDEV
 	depends on PM
+	select SERIAL_DEV_BUS
 	select BT_HCIUART_H4
 	select BT_BCM
 	help
@@ -134,7 +128,8 @@ config BT_HCIUART_ATH3K
 
 config BT_HCIUART_LL
 	bool "HCILL protocol support"
-	depends on BT_HCIUART_SERDEV
+	depends on BT_HCIUART
+	select SERIAL_DEV_BUS
 	help
 	  HCILL (HCI Low Level) is a serial protocol for

communication
between Bluetooth device and host. This protocol is
required for

drivers/bluetooth/Kconfig +2 -2
@@ -169,8 +164,8 @@ config BT_HCIUART_INTEL
 config BT_HCIUART_BCM
 	bool "Broadcom protocol support"
 	depends on BT_HCIUART
-	depends on BT_HCIUART_SERDEV
-	depends on (!ACPI || SERIAL_DEV_CTRL_TTYPORT)
+	select SERIAL_DEV_CTRL_TTYPORT if !ACPI
+	select SERIAL_DEV_BUS
 	select BT_HCIUART_H4
 	select BT_BCM
 	help
Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#2 lore raw
Quoted 7 lines · Andy Shevchenko
Quoted 5 lines · Andy Shevchenko

The change restores build behaviour for old configurations when user didn't know and thus didn't select SERIAL_DEV_BUS explicitly for given
HCI modules, such as hci_bcm.

Quoted 6 lines

+Cc: Arnd, Rob.

Review

Quoted 2 lines
(quoted diff) +2 -0
+	select SERIAL_DEV_CTRL_TTYPORT if ACPI
+	select SERIAL_DEV_BUS

It wouldn't work if BT_HCIUART=m (due to first line in above excerpt).

So, for now I'm lack of ideas.

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#3 lore raw
In reply to Andy Shevchenko

Hi Andy,

This was discussed at length before and resulted in Johan Hovold's patch 'Bluetooth: avoid silent hci_bcm ACPI PM regression' (commit 4294625e029028854596865be401b9c5c1f906ef).

I did some additional analysis at the time in attempting to force BT_HCIUART_BCM to select SERIAL_DEV_CTRL_TTYPORT in drivers/bluetooth/Kconfig but a warning of unmet dependencies was encountered:

warning: (BT_HCIUART_BCM) selects SERIAL_DEV_CTRL_TTYPORT which has unmet direct dependencies (TTY && SERIAL_DEV_BUS=y)

and the resultant .config was also incorrect in that it now had the additional entry of CONFIG_SERIAL_DEV_CTRL_TTYPORT=y

The only way I could correctly set the runtime dependencies was by modifying drivers/tty/serdev/Kconfig and:

changing SERIAL_DEV_BUS from being tristate to bool changing SERIAL_DEV_CTRL_TTYPORT depends on SERIAL_DEV_BUS !=m to SERIAL_DEV_CTRL_TTYPORT depends on SERIAL_DEV_BUS"

as a 'make' would prompt for the correct value for CONFIG_SERIAL_DEV_BUS.

However this can be addressed by distro owners updating their configs and changing
CONFIG_SERIAL_DEV_BUS=m
to
CONFIG_SERIAL_DEV_BUS=y
and adding
CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
CONFIG_BT_HCIUART_BCM=y

FYI I'm still waiting for Canonical to do this for Ubuntu and I've recently raised a bug report (Bug #1739939) requesting the change.

Regards,
Ian

Cc Johan Hovold
Quoted 80 lines · Andy Shevchenko
Quoted 4 lines · Andy Shevchenko

The change restores build behaviour for old configurations when user didn't know and thus didn't select SERIAL_DEV_BUS explicitly for given HCI modules, such as hci_bcm.

+Cc: Arnd, Rob.

Quoted 54 lines

---
v2: get rid of recursive dependencies

 drivers/bluetooth/Kconfig | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/bluetooth/Kconfig +0 -1
index 60e1c7d6986d..ea3d114d19e5 100644
@@ -66,7 +66,6 @@ config BT_HCIBTSDIO
 
 config BT_HCIUART
      tristate "HCI UART driver"
-     depends on SERIAL_DEV_BUS || !SERIAL_DEV_BUS
      depends on TTY
      help
        Bluetooth HCI UART driver.
@@ -78,11 +77,6 @@ config BT_HCIUART
        Say Y here to compile support for Bluetooth UART devices

into the
kernel or say M to compile it as module (hci_uart).

drivers/bluetooth/Kconfig +3 -7
-config BT_HCIUART_SERDEV
-     bool
-     depends on SERIAL_DEV_BUS && BT_HCIUART
-     default y
-
 config BT_HCIUART_H4
      bool "UART (H4) protocol support"
      depends on BT_HCIUART
@@ -96,8 +90,8 @@ config BT_HCIUART_H4
 config BT_HCIUART_NOKIA
      tristate "UART Nokia H4+ protocol support"
      depends on BT_HCIUART
-     depends on BT_HCIUART_SERDEV
      depends on PM
+     select SERIAL_DEV_BUS
      select BT_HCIUART_H4
      select BT_BCM
      help
@@ -134,7 +128,8 @@ config BT_HCIUART_ATH3K
 
 config BT_HCIUART_LL
      bool "HCILL protocol support"
-     depends on BT_HCIUART_SERDEV
+     depends on BT_HCIUART
+     select SERIAL_DEV_BUS
      help
        HCILL (HCI Low Level) is a serial protocol for

communication
between Bluetooth device and host. This protocol is
required for

drivers/bluetooth/Kconfig config BT_HCIUART_INTEL · line 171

Quoted 10 lines
drivers/bluetooth/Kconfig +2 -2
@@ -169,8 +164,8 @@ config BT_HCIUART_INTEL
 config BT_HCIUART_BCM
      bool "Broadcom protocol support"
      depends on BT_HCIUART
-     depends on BT_HCIUART_SERDEV
-     depends on (!ACPI || SERIAL_DEV_CTRL_TTYPORT)
+     select SERIAL_DEV_CTRL_TTYPORT if !ACPI
+     select SERIAL_DEV_BUS
      select BT_HCIUART_H4
      select BT_BCM
      help

--
Andy Shevchenko <[email protected]>
Intel Finland Oy
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html