From: Johan Hovold <johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Marcel Holtmann <marcel-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org>
Cc: "Johan Hovold" <johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"Sebastian Reichel"
<sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>,
"Frédéric Danis"
<frederic.danis.oss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
loic.poulain-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org,
hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/2] ACPI / scan: Fix enumeration for special UART devices
Date: Tue, 10 Oct 2017 09:08:47 +0200 [thread overview]
Message-ID: <20171010070847.GH4269@localhost> (raw)
In-Reply-To: <E19C0643-85AA-4E80-BCDC-0C01EC0F88C2-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org>
On Mon, Oct 09, 2017 at 08:09:19PM +0200, Marcel Holtmann wrote:
> Hi Johan,
>
> >>>>>> UART devices is expected to be enumerated by SerDev subsystem.
> >>>>>>
> >>>>>> During ACPI scan, serial devices behind SPI, I2C or UART buses are not
> >>>>>> enumerated, allowing them to be enumerated by their respective parents.
> >>>>>>
> >>>>>> Rename *spi_i2c_slave* to *serial_bus_slave* as this will be used for serial
> >>>>>> devices on serial buses (SPI, I2C or UART).
> >>>>>>
> >>>>>> On Macs an empty ResourceTemplate is returned for uart slaves.
> >>>>>> Instead the device properties "baud", "parity", "dataBits", "stopBits" are
> >>>>>> provided. Add a check for "baud" in acpi_is_serial_bus_slave().
> >>>>>>
> >>>>>> Signed-off-by: Frédéric Danis <frederic.danis.oss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> >>>>>
> >>>>> So just to reiterate what I just mentioned in a comment to one of Hans's
> >>>>> hci_bcm patches:
> >>>>>
> >>>>> This one would silently break PM for such devices on any system which
> >>>>> does not have serdev enabled (as the corresponding platform devices
> >>>>> would no longer be registered). And with serdev enabled, hciattach
> >>>>> (btattach) would start failing as the tty device would no longer be
> >>>>> registered (but I assume everyone is aware of that, and fine with it, by
> >>>>> now).
> >>>>>
> >>>>> Perhaps the hci_bcm driver should start depending on
> >>>>> SERIAL_DEV_CTRL_TTYPORT when ACPI is enabled?
> >>>>
> >>>> ACPI and DT both need SERIAL_DEV_CTRL_TTYPORT to work properly,
> >>>> since SERIAL_DEV_CTRL_TTYPORT is the only controller implemented
> >>>> for serdev. If any other controller is implemented that one could
> >>>> also be used.
> >>>
> >>> Not for hci_bcm, right? This particular driver specifically depends on
> >>> SERIAL_DEV_CTRL_TTYPORT for the ACPI devices and not just any (future)
> >>> serdev controller (or currently working systems soon breaks silently).
> >>>
> >>> I don't think the same is true for the DT case where we do not already
> >>> have child nodes defined in firmware (and in fact, this driver did not
> >>> really support DT before serdev).
> >>
> >> The serdev ACPI support has been added to the core and not to
> >> the ttyport and the hci_bcm driver only uses functions from the
> >> core. As far as I can see the ACPI part would also work fine with
> >> a different serdev controller.
> >
> > Indeed, but you need SERIAL_DEV_CTRL_TTYPORT to avoid silently breaking
> > current ACPI setups which breaks when this patch is applied (as these
> > devices all hang off of common serial ports managed by serial core).
> >
> >> Of course DT and ACPI currently require SERIAL_DEV_CTRL_TTYPORT,
> >> since it's the only serdev controller implementation. Also it
> >> covers most use cases. When SERIAL_DEV_BUS is selected it's
> >> very likely, that you also want SERIAL_DEV_CTRL_TTYPORT.
> >
> >>>> I wonder if we should just hide SERIAL_DEV_CTRL_TTYPORT and enable
> >>>> it together with SERDEV. I suspect that we won't see any other
> >>>> controller (it would be a UART device, that is not registered as
> >>>> tty device) in the next few years and the extra option seems to
> >>>> confuse people.
> >>>
> >>> I agree that it is somewhat confusing. But now that we have both,
> >>> perhaps simply having SERIAL_DEV_CTRL_TTYPORT default to "y" when
> >>> SERIAL_DEV_BUS is selected could be a compromise. The Kconfig entry
> >>> might need to be amended as well (e.g. if only to mention that you
> >>> need to select a controller as well).
> >>
> >> I think we should at least add a default "y" if SERIAL_DEV_BUS.
> >
> > I'm preparing a patch.
>
> yes, please prepare a patch since the discussion spans multiple email
> threads now. Lets get this back on track and find a patch that we are
> all happy with.
I submitted a patch amending the serdev Kconfig entries and making
SERIAL_DEV_CTRL_TTYPORT default to Y when serdev support has been
chosen.
While that hopefully reduces the confusion regarding the Kconfig options
somewhat, it's not really a fix for the potential silent hci_bcm
regression that could result from this patch.
[ The problem being that hci-attach would still succeed, but PM would be
broken, when SERIAL_DEV_CTRL_TTYPORT is not set. ]
I mentioned that making HCI_BCM depend on SERIAL_DEV_CTRL_TTYPORT might
be used to avoid this situation, although it is on some level is
conceptually wrong to describe runtime dependencies in Kconfig (cf.
having a USB device driver, depend on a particular host controller
rather than just USB support).
I'll write something like that up in a patch for Bluetooth and you can
decide if you want to apply it to remedy this particular situation,
though.
Johan
WARNING: multiple messages have this Message-ID (diff)
From: Johan Hovold <johan@kernel.org>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: "Johan Hovold" <johan@kernel.org>,
"Sebastian Reichel" <sebastian.reichel@collabora.co.uk>,
"Frédéric Danis" <frederic.danis.oss@gmail.com>,
robh@kernel.org, loic.poulain@gmail.com, lukas@wunner.de,
hdegoede@redhat.com, linux-bluetooth@vger.kernel.org,
linux-serial@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [PATCH 2/2] ACPI / scan: Fix enumeration for special UART devices
Date: Tue, 10 Oct 2017 09:08:47 +0200 [thread overview]
Message-ID: <20171010070847.GH4269@localhost> (raw)
In-Reply-To: <E19C0643-85AA-4E80-BCDC-0C01EC0F88C2@holtmann.org>
On Mon, Oct 09, 2017 at 08:09:19PM +0200, Marcel Holtmann wrote:
> Hi Johan,
>
> >>>>>> UART devices is expected to be enumerated by SerDev subsystem.
> >>>>>>
> >>>>>> During ACPI scan, serial devices behind SPI, I2C or UART buses are not
> >>>>>> enumerated, allowing them to be enumerated by their respective parents.
> >>>>>>
> >>>>>> Rename *spi_i2c_slave* to *serial_bus_slave* as this will be used for serial
> >>>>>> devices on serial buses (SPI, I2C or UART).
> >>>>>>
> >>>>>> On Macs an empty ResourceTemplate is returned for uart slaves.
> >>>>>> Instead the device properties "baud", "parity", "dataBits", "stopBits" are
> >>>>>> provided. Add a check for "baud" in acpi_is_serial_bus_slave().
> >>>>>>
> >>>>>> Signed-off-by: Frédéric Danis <frederic.danis.oss@gmail.com>
> >>>>>
> >>>>> So just to reiterate what I just mentioned in a comment to one of Hans's
> >>>>> hci_bcm patches:
> >>>>>
> >>>>> This one would silently break PM for such devices on any system which
> >>>>> does not have serdev enabled (as the corresponding platform devices
> >>>>> would no longer be registered). And with serdev enabled, hciattach
> >>>>> (btattach) would start failing as the tty device would no longer be
> >>>>> registered (but I assume everyone is aware of that, and fine with it, by
> >>>>> now).
> >>>>>
> >>>>> Perhaps the hci_bcm driver should start depending on
> >>>>> SERIAL_DEV_CTRL_TTYPORT when ACPI is enabled?
> >>>>
> >>>> ACPI and DT both need SERIAL_DEV_CTRL_TTYPORT to work properly,
> >>>> since SERIAL_DEV_CTRL_TTYPORT is the only controller implemented
> >>>> for serdev. If any other controller is implemented that one could
> >>>> also be used.
> >>>
> >>> Not for hci_bcm, right? This particular driver specifically depends on
> >>> SERIAL_DEV_CTRL_TTYPORT for the ACPI devices and not just any (future)
> >>> serdev controller (or currently working systems soon breaks silently).
> >>>
> >>> I don't think the same is true for the DT case where we do not already
> >>> have child nodes defined in firmware (and in fact, this driver did not
> >>> really support DT before serdev).
> >>
> >> The serdev ACPI support has been added to the core and not to
> >> the ttyport and the hci_bcm driver only uses functions from the
> >> core. As far as I can see the ACPI part would also work fine with
> >> a different serdev controller.
> >
> > Indeed, but you need SERIAL_DEV_CTRL_TTYPORT to avoid silently breaking
> > current ACPI setups which breaks when this patch is applied (as these
> > devices all hang off of common serial ports managed by serial core).
> >
> >> Of course DT and ACPI currently require SERIAL_DEV_CTRL_TTYPORT,
> >> since it's the only serdev controller implementation. Also it
> >> covers most use cases. When SERIAL_DEV_BUS is selected it's
> >> very likely, that you also want SERIAL_DEV_CTRL_TTYPORT.
> >
> >>>> I wonder if we should just hide SERIAL_DEV_CTRL_TTYPORT and enable
> >>>> it together with SERDEV. I suspect that we won't see any other
> >>>> controller (it would be a UART device, that is not registered as
> >>>> tty device) in the next few years and the extra option seems to
> >>>> confuse people.
> >>>
> >>> I agree that it is somewhat confusing. But now that we have both,
> >>> perhaps simply having SERIAL_DEV_CTRL_TTYPORT default to "y" when
> >>> SERIAL_DEV_BUS is selected could be a compromise. The Kconfig entry
> >>> might need to be amended as well (e.g. if only to mention that you
> >>> need to select a controller as well).
> >>
> >> I think we should at least add a default "y" if SERIAL_DEV_BUS.
> >
> > I'm preparing a patch.
>
> yes, please prepare a patch since the discussion spans multiple email
> threads now. Lets get this back on track and find a patch that we are
> all happy with.
I submitted a patch amending the serdev Kconfig entries and making
SERIAL_DEV_CTRL_TTYPORT default to Y when serdev support has been
chosen.
While that hopefully reduces the confusion regarding the Kconfig options
somewhat, it's not really a fix for the potential silent hci_bcm
regression that could result from this patch.
[ The problem being that hci-attach would still succeed, but PM would be
broken, when SERIAL_DEV_CTRL_TTYPORT is not set. ]
I mentioned that making HCI_BCM depend on SERIAL_DEV_CTRL_TTYPORT might
be used to avoid this situation, although it is on some level is
conceptually wrong to describe runtime dependencies in Kconfig (cf.
having a USB device driver, depend on a particular host controller
rather than just USB support).
I'll write something like that up in a patch for Bluetooth and you can
decide if you want to apply it to remedy this particular situation,
though.
Johan
next prev parent reply other threads:[~2017-10-10 7:08 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-04 8:51 [PATCH 0/2] ACPI serdev support Frédéric Danis
[not found] ` <1507107090-15992-1-git-send-email-frederic.danis.oss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-04 8:51 ` [PATCH 1/2] serdev: Add ACPI support Frédéric Danis
2017-10-04 8:51 ` Frédéric Danis
2017-10-06 12:33 ` Rob Herring
2017-10-06 12:33 ` Rob Herring
[not found] ` <CAL_JsqKDzR9-ptE=SbL0LuQvTKDNT-GZ8buOvffJDyWz6fHfSA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-06 18:32 ` Marcel Holtmann
2017-10-06 18:32 ` Marcel Holtmann
2017-10-07 0:03 ` Rafael J. Wysocki
2017-10-07 0:03 ` Rafael J. Wysocki
[not found] ` <CAJZ5v0gLhnisMn9o00ndnB6fjHt5V7KCy_57UScF=ZfZVF=dxA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-07 0:31 ` Marcel Holtmann
2017-10-07 0:31 ` Marcel Holtmann
[not found] ` <E5446B94-9914-44B5-A734-050F7457746D-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org>
2017-10-07 6:42 ` Greg Kroah-Hartman
2017-10-07 6:42 ` Greg Kroah-Hartman
[not found] ` <1507107090-15992-2-git-send-email-frederic.danis.oss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-07 6:42 ` Greg KH
2017-10-07 6:42 ` Greg KH
2017-10-07 11:35 ` Sebastian Reichel
2017-10-07 11:35 ` Sebastian Reichel
2017-10-07 15:12 ` Johan Hovold
2017-10-10 8:10 ` Marcel Holtmann
2017-10-10 8:15 ` Johan Hovold
2017-10-10 8:22 ` Marcel Holtmann
2017-10-10 16:36 ` Johan Hovold
2017-10-10 23:13 ` Ian W MORRISON
2017-10-10 23:13 ` Ian W MORRISON
2017-10-10 0:27 ` [PATCH 0/2] ACPI serdev support Rafael J. Wysocki
2017-10-10 0:27 ` Rafael J. Wysocki
2017-10-04 8:51 ` [PATCH 2/2] ACPI / scan: Fix enumeration for special UART devices Frédéric Danis
2017-10-07 11:36 ` Sebastian Reichel
[not found] ` <1507107090-15992-3-git-send-email-frederic.danis.oss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-07 15:19 ` Johan Hovold
2017-10-07 15:19 ` Johan Hovold
2017-10-07 22:53 ` Sebastian Reichel
2017-10-08 8:51 ` Marcel Holtmann
2017-10-08 8:51 ` Marcel Holtmann
2017-10-09 8:59 ` Sebastian Reichel
2017-10-09 7:35 ` Johan Hovold
2017-10-09 8:55 ` Sebastian Reichel
2017-10-09 9:08 ` Johan Hovold
2017-10-09 18:09 ` Marcel Holtmann
2017-10-09 18:09 ` Marcel Holtmann
[not found] ` <E19C0643-85AA-4E80-BCDC-0C01EC0F88C2-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org>
2017-10-10 7:08 ` Johan Hovold [this message]
2017-10-10 7:08 ` Johan Hovold
2017-10-05 15:21 ` [PATCH 0/2] ACPI serdev support Marcel Holtmann
2017-10-06 7:33 ` Ian W MORRISON
[not found] ` <25008d7b-db06-49ad-033f-63c0b72d9c34-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-06 8:16 ` Frédéric Danis
2017-10-06 8:16 ` Frédéric Danis
2017-10-06 14:47 ` Ian W MORRISON
2017-10-06 17:36 ` Frédéric Danis
2017-10-07 6:16 ` Ian W MORRISON
2017-10-07 15:14 ` Johan Hovold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171010070847.GH4269@localhost \
--to=johan-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=frederic.danis.oss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=loic.poulain-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org \
--cc=marcel-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org \
--cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.