2017-10-07 06:16:31

by Ian W MORRISON

[permalink] [raw]
Subject: [PATCH] serdev: Update drivers/tty/serdev/Kconfig for ACPI support

The current Kconfig for serdev is not compatible when adding ACPI support as it does not work when built as a module as it requires config SERIAL_DEV_CTRL_TTYPORT to be set. This patch makes serdev compiled into the kernel if selected so that config SERIAL_DEV_CTRL_TTYPORT can be correctly set if requiring ACPI support.
---
drivers/tty/serdev/Kconfig | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serdev/Kconfig b/drivers/tty/serdev/Kconfig
index cdc6b820cf93..a9fb09a9c105 100644
--- a/drivers/tty/serdev/Kconfig
+++ b/drivers/tty/serdev/Kconfig
@@ -2,7 +2,8 @@
# Serial bus device driver configuration
#
menuconfig SERIAL_DEV_BUS
- tristate "Serial device bus"
+ bool "Serial device bus"
+ default y
help
Core support for devices connected via a serial port.

@@ -11,6 +12,6 @@ if SERIAL_DEV_BUS
config SERIAL_DEV_CTRL_TTYPORT
bool "Serial device TTY port controller"
depends on TTY
- depends on SERIAL_DEV_BUS != m
+ default y

endif
--
2.11.0


2017-10-09 07:47:00

by Johan Hovold

[permalink] [raw]
Subject: Re: [PATCH] serdev: Update drivers/tty/serdev/Kconfig for ACPI support

On Sat, Oct 07, 2017 at 09:57:40PM +0200, Marcel Holtmann wrote:
> Hi Johan,
>
> >> The current Kconfig for serdev is not compatible when adding ACPI support as it does not work when built as a module as it requires config SERIAL_DEV_CTRL_TTYPORT to be set. This patch makes serdev compiled into the kernel if selected so that config SERIAL_DEV_CTRL_TTYPORT can be correctly set if requiring ACPI support.
> >> ---
> >> drivers/tty/serdev/Kconfig | 5 +++--
> >> 1 file changed, 3 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/tty/serdev/Kconfig b/drivers/tty/serdev/Kconfig
> >> index cdc6b820cf93..a9fb09a9c105 100644
> >> --- a/drivers/tty/serdev/Kconfig
> >> +++ b/drivers/tty/serdev/Kconfig
> >> @@ -2,7 +2,8 @@
> >> # Serial bus device driver configuration
> >> #
> >> menuconfig SERIAL_DEV_BUS
> >> - tristate "Serial device bus"
> >> + bool "Serial device bus"
> >> + default y
> >
> > I understand why you want this (to prevent hci_bcm from breaking), but we
> > should generally not have new entries default to y.
> >
> >> help
> >> Core support for devices connected via a serial port.
> >>
> >> @@ -11,6 +12,6 @@ if SERIAL_DEV_BUS
> >> config SERIAL_DEV_CTRL_TTYPORT
> >> bool "Serial device TTY port controller"
> >> depends on TTY
> >> - depends on SERIAL_DEV_BUS != m
> >> + default y
> >
> > Same here.
> >
> > It may be better to have BT_HCIUART_BCM depend on (or select?)
> > SERIAL_DEV_CTRL_TTYPORT instead.
>
> if we move SERIAL_DEV_BUS to bool, then I would just have it be
> selected by BT_HCIUART_BCM. Frankly the SERIAL_DEV_BUS option is
> pretty hard to find in the kernel config. And if we depend on TTY, but
> then select SERIAL_DEV_BUS, I think that is a good compromise.

The Bluetooth UART drivers already depend on on SERIAL_DEV_BUS (through
BT_HCIUART_SERDEV). And the problem with BT_HCIUART_BCM is that the
current ACPI devices really need SERIAL_DEV_CTRL_TTYPORT (and not just
serdev core).

And we should probably try to avoid selecting options if we can (to
avoid ending up with unmet dependencies).

Johan

2017-10-08 03:20:33

by Ian W MORRISON

[permalink] [raw]
Subject: Re: [PATCH] serdev: Update drivers/tty/serdev/Kconfig for ACPI support

On 10/8/17 6:57 AM, Marcel Holtmann wrote:
> Hi Johan,
>
>>> The current Kconfig for serdev is not compatible when adding ACPI support as it does not work when built as a module as it requires config SERIAL_DEV_CTRL_TTYPORT to be set. This patch makes serdev compiled into the kernel if selected so that config SERIAL_DEV_CTRL_TTYPORT can be correctly set if requiring ACPI support.
<snip>
>> I understand why you want this (to prevent hci_bcm from breaking), but we
>> should generally not have new entries default to y.
>>
<snip>
>> It may be better to have BT_HCIUART_BCM depend on (or select?)
>> SERIAL_DEV_CTRL_TTYPORT instead.
>
> if we move SERIAL_DEV_BUS to bool, then I would just have it be selected by BT_HCIUART_BCM. Frankly the SERIAL_DEV_BUS option is pretty hard to find in the kernel config. And if we depend on TTY, but then select SERIAL_DEV_BUS, I think that is a good compromise.
>
> Regards
>
> Marcel
>

Hi,

Many thanks for everyone's comments on my earlier patch to Kconfigs for ACPI serdev support.

I've submitted a revised patch set which addresses the points raised by making BT_HCIUART_BCM dependent on SERIAL_DEV_CTRL_TTYPORT which in turn is dependent on SERIAL_DEV_BUS and ensures that if SERIAL_DEV_BUS is selected is the code is build it.

Please can you review and let me know if any further changes are required?

Regards,
Ian

2017-10-07 19:57:40

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] serdev: Update drivers/tty/serdev/Kconfig for ACPI support

Hi Johan,

>> The current Kconfig for serdev is not compatible when adding ACPI support as it does not work when built as a module as it requires config SERIAL_DEV_CTRL_TTYPORT to be set. This patch makes serdev compiled into the kernel if selected so that config SERIAL_DEV_CTRL_TTYPORT can be correctly set if requiring ACPI support.
>> ---
>> drivers/tty/serdev/Kconfig | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/tty/serdev/Kconfig b/drivers/tty/serdev/Kconfig
>> index cdc6b820cf93..a9fb09a9c105 100644
>> --- a/drivers/tty/serdev/Kconfig
>> +++ b/drivers/tty/serdev/Kconfig
>> @@ -2,7 +2,8 @@
>> # Serial bus device driver configuration
>> #
>> menuconfig SERIAL_DEV_BUS
>> - tristate "Serial device bus"
>> + bool "Serial device bus"
>> + default y
>
> I understand why you want this (to prevent hci_bcm from breaking), but we
> should generally not have new entries default to y.
>
>> help
>> Core support for devices connected via a serial port.
>>
>> @@ -11,6 +12,6 @@ if SERIAL_DEV_BUS
>> config SERIAL_DEV_CTRL_TTYPORT
>> bool "Serial device TTY port controller"
>> depends on TTY
>> - depends on SERIAL_DEV_BUS != m
>> + default y
>
> Same here.
>
> It may be better to have BT_HCIUART_BCM depend on (or select?)
> SERIAL_DEV_CTRL_TTYPORT instead.

if we move SERIAL_DEV_BUS to bool, then I would just have it be selected by BT_HCIUART_BCM. Frankly the SERIAL_DEV_BUS option is pretty hard to find in the kernel config. And if we depend on TTY, but then select SERIAL_DEV_BUS, I think that is a good compromise.

Regards

Marcel


2017-10-07 15:24:14

by Johan Hovold

[permalink] [raw]
Subject: Re: [PATCH] serdev: Update drivers/tty/serdev/Kconfig for ACPI support

On Sat, Oct 07, 2017 at 05:16:31PM +1100, Ian W MORRISON wrote:
> The current Kconfig for serdev is not compatible when adding ACPI support as it does not work when built as a module as it requires config SERIAL_DEV_CTRL_TTYPORT to be set. This patch makes serdev compiled into the kernel if selected so that config SERIAL_DEV_CTRL_TTYPORT can be correctly set if requiring ACPI support.
> ---
> drivers/tty/serdev/Kconfig | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serdev/Kconfig b/drivers/tty/serdev/Kconfig
> index cdc6b820cf93..a9fb09a9c105 100644
> --- a/drivers/tty/serdev/Kconfig
> +++ b/drivers/tty/serdev/Kconfig
> @@ -2,7 +2,8 @@
> # Serial bus device driver configuration
> #
> menuconfig SERIAL_DEV_BUS
> - tristate "Serial device bus"
> + bool "Serial device bus"
> + default y

I understand why you want this (to prevent hci_bcm from breaking), but we
should generally not have new entries default to y.

> help
> Core support for devices connected via a serial port.
>
> @@ -11,6 +12,6 @@ if SERIAL_DEV_BUS
> config SERIAL_DEV_CTRL_TTYPORT
> bool "Serial device TTY port controller"
> depends on TTY
> - depends on SERIAL_DEV_BUS != m
> + default y

Same here.

It may be better to have BT_HCIUART_BCM depend on (or select?)
SERIAL_DEV_CTRL_TTYPORT instead.

Johan

2017-10-07 12:06:44

by Ian W MORRISON

[permalink] [raw]
Subject: Re: [PATCH] serdev: Update drivers/tty/serdev/Kconfig for ACPI support

On 7 October 2017 at 17:42, Marcel Holtmann <[email protected]> wrote:
> Hi Ian,
>
>> The current Kconfig for serdev is not compatible when adding ACPI suppor=
t as it does not work when built as a module as it requires config SERIAL_D=
EV_CTRL_TTYPORT to be set. This patch makes serdev compiled into the kernel=
if selected so that config SERIAL_DEV_CTRL_TTYPORT can be correctly set if=
requiring ACPI support.
>> ---
>> drivers/tty/serdev/Kconfig | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/tty/serdev/Kconfig b/drivers/tty/serdev/Kconfig
>> index cdc6b820cf93..a9fb09a9c105 100644
>> --- a/drivers/tty/serdev/Kconfig
>> +++ b/drivers/tty/serdev/Kconfig
>> @@ -2,7 +2,8 @@
>> # Serial bus device driver configuration
>> #
>> menuconfig SERIAL_DEV_BUS
>> - tristate "Serial device bus"
>> + bool "Serial device bus"
>> + default y
>> help
>> Core support for devices connected via a serial port.
>>
>> @@ -11,6 +12,6 @@ if SERIAL_DEV_BUS
>> config SERIAL_DEV_CTRL_TTYPORT
>> bool "Serial device TTY port controller"
>> depends on TTY
>> - depends on SERIAL_DEV_BUS !=3D m
>> + default y
>
> actually we made hci_nokia.c be buildable as separate module. We might ne=
ed to do the same for hci_bcm.c to avoid forcing SERIAL_DEV_BUS into a bool=
. Or you need to explain the reason behind this change a bit better.
>
> Regards
>
> Marcel
>

Hi Marcel,

For serdev to support for devices connected via a serial port such as
a tty (for example an ACPI enumerated BT driver) its code hooks into
TTY code meaning serdev can no longer be compiled as a module for this
functionality to work. With CONFIG_SERIAL_DEV_BUS originally being
defined as a tristate a provision was made when compiling serdev as a
module to return ENODEV when trying to register a tty port. This
provision still exists with CONFIG_SERIAL_DEV_BUS defined as a bool
because CONFIG_SERIAL_DEV_CTRL_TTYPORT actually controls this.

My patch also aligns CONFIG_SERIAL_DEV_BUS (serdev) which provides
"Core serial port support" to CONFIG_SERIAL_NONSTANDARD or
"Non-standard serial port support" as this seems logical comparison.
CONFIG_SERIAL_NONSTANDARD is a bool similar to how I've made
CONFIG_SERIAL_DEV_BUS a bool.

Whilst it may be preferable to make hci_bcm.c buildable as separate
module like hci_nokia.c I don't relate the 'modularity' of bluetooth
drivers with the 'modularity' of a serial device bus as I see the
latter more similar to PCI support or ACPI support.

Because of the link and/or cross-over between serial port support and
tty support I believe serdev should be built-in rather than
modularized if and when it is required.

If this better explains the reason for the patch I can resubmit with
an updated changelog together with a signoff which I accidentally
during editing.

Regards,
Ian

2017-10-07 06:42:41

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] serdev: Update drivers/tty/serdev/Kconfig for ACPI support

Hi Ian,

> The current Kconfig for serdev is not compatible when adding ACPI support as it does not work when built as a module as it requires config SERIAL_DEV_CTRL_TTYPORT to be set. This patch makes serdev compiled into the kernel if selected so that config SERIAL_DEV_CTRL_TTYPORT can be correctly set if requiring ACPI support.
> ---
> drivers/tty/serdev/Kconfig | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serdev/Kconfig b/drivers/tty/serdev/Kconfig
> index cdc6b820cf93..a9fb09a9c105 100644
> --- a/drivers/tty/serdev/Kconfig
> +++ b/drivers/tty/serdev/Kconfig
> @@ -2,7 +2,8 @@
> # Serial bus device driver configuration
> #
> menuconfig SERIAL_DEV_BUS
> - tristate "Serial device bus"
> + bool "Serial device bus"
> + default y
> help
> Core support for devices connected via a serial port.
>
> @@ -11,6 +12,6 @@ if SERIAL_DEV_BUS
> config SERIAL_DEV_CTRL_TTYPORT
> bool "Serial device TTY port controller"
> depends on TTY
> - depends on SERIAL_DEV_BUS != m
> + default y

actually we made hci_nokia.c be buildable as separate module. We might need to do the same for hci_bcm.c to avoid forcing SERIAL_DEV_BUS into a bool. Or you need to explain the reason behind this change a bit better.

Regards

Marcel


2017-10-07 06:41:14

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] serdev: Update drivers/tty/serdev/Kconfig for ACPI support

On Sat, Oct 07, 2017 at 05:16:31PM +1100, Ian W MORRISON wrote:
> The current Kconfig for serdev is not compatible when adding ACPI support as it does not work when built as a module as it requires config SERIAL_DEV_CTRL_TTYPORT to be set. This patch makes serdev compiled into the kernel if selected so that config SERIAL_DEV_CTRL_TTYPORT can be correctly set if requiring ACPI support.
> ---
> drivers/tty/serdev/Kconfig | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serdev/Kconfig b/drivers/tty/serdev/Kconfig
> index cdc6b820cf93..a9fb09a9c105 100644
> --- a/drivers/tty/serdev/Kconfig
> +++ b/drivers/tty/serdev/Kconfig
> @@ -2,7 +2,8 @@
> # Serial bus device driver configuration
> #
> menuconfig SERIAL_DEV_BUS
> - tristate "Serial device bus"
> + bool "Serial device bus"
> + default y
> help
> Core support for devices connected via a serial port.
>
> @@ -11,6 +12,6 @@ if SERIAL_DEV_BUS
> config SERIAL_DEV_CTRL_TTYPORT
> bool "Serial device TTY port controller"
> depends on TTY
> - depends on SERIAL_DEV_BUS != m
> + default y
>
> endif
> --
> 2.11.0


Hi,

This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- Your patch contains warnings and/or errors noticed by the
scripts/checkpatch.pl tool.

- Your patch does not have a Signed-off-by: line. Please read the
kernel file, Documentation/SubmittingPatches and resend it after
adding that line. Note, the line needs to be in the body of the
email, before the patch, not at the bottom of the patch or in the
email signature.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot