mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Probst <markus.probst@posteo.de>
To: Hans de Goede <hansg@kernel.org>, ChunAn Wu <an.wu@canonical.com>,
	 linux-serial@vger.kernel.org,
	platform-driver-x86@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
	 jirislaby@kernel.org, ilpo.jarvinen@linux.intel.com,
	mpearson-lenovo@squebb.ca, 	derekjohn.clark@gmail.com
Subject: Re: [PATCH v2 1/3] serdev: handle devices without an ACPI or device tree node
Date: Wed, 21 Oct 2026 18:14:31 +0000	[thread overview]
Message-ID: <90df4e3068d89c37b4c6813aacae02fcf9fc188a.camel@posteo.de> (raw)
In-Reply-To: <97dd05c2-0a6f-4856-a473-59183a5b3424@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 4343 bytes --]

On Wed, 2026-10-21 at 20:07 +0200, Hans de Goede wrote:
> Hi,
> 
> On 21-Oct-26 17:08, Markus Probst wrote:
> > On Wed, 2026-10-21 at 16:32 +0200, Hans de Goede wrote:
> > > Hi,
> > > 
> > > On 21-Oct-26 11:21, ChunAn Wu wrote:
> > > > Driver-created serdev clients may lack an ACPI companion or device tree
> > > > node.
> > > > 
> > > > Add a creator-supplied name for these clients. Use it as a serial
> > > > modalias fallback and to match a serdev driver of the same name. Keep
> > > > returning -ENODEV for unnamed clients.
> > > > 
> > > > Signed-off-by: ChunAn Wu <an.wu@canonical.com>
> > > 
> > > For v3 of this series please include a cover-letter and explain
> > > why this series is an improvement over the` existing situation.
> > > 
> > > The dell-uart-backlight and lenovo-yoga-tab2-pro-1380-fastcharger
> > > drivers are both pretty special cases and here you are adding
> > > a chunk of code to the serdev-core for those special cases,
> > > so I wonder: why?
> > > 
> > > The current manual attach approach taking in these 2 special
> > > drivers works fine.
> > > 
> > > What does this new approach gain us ?
> > 
> > That was my review comment [1] that resulted in this.
> 
> Thanks, that is useful info and the kinda info I would
> expect in a cover-letter :)
> > From what I can tell from revision 1, ChunAn Wu is trying to fix that
> > accessing uevent and modalias of the device (via sysfs) results in a -
> > ENODEV error.
> 
> I see. Makes me wonder though how that -ENODEV is a problem,
> it is weird. But is it a problem?
> 
> The v1 patch writes the following about this:
> 
> "This makes the modalias sysfs read fail and suppresses the device
> add uevent, even though the device is registered and bound to its driver."
> 
> Ok, but the backlight driver ultimately ends up adding a
> /sys/class/backlight device which I assume does get
> a uevent, or is the problem that one never getting a uevent
> because of its parent not getting one ?
> 
> And the lenovo-yoga-tab2-pro-1380-fastcharger driver does all
> it needs to do fully in kernel and does not even export
> a userspace interface.
I am not sure which issue is solves precisely. Maybe udev doesn't like
it?

ChunAn Wu has to answer that.

Returning -ENODEV on an existing device there is likely not intended.


> 
> > As mentioned in my review:
> > 
> > - "/* TODO: platform modalias */"
> > - "/* TODO: platform matching */"
> > still exist in the serdev codebase (drivers/tty/serdev/core.c) and are
> > unresolved. Resolving those also fixes the issue mentioned above.
> > Therefore I think this would be a better approach.
> 
> With that said given that there are TODO comments for this
> I guess addressing the TODO-s is ok.
> > A cover letter is ofc still needed.
> 
> Ack.
> 
> > > Also if you are going to do this may I suggest looking at doing
> > > some sort of of-compatible matching based on a compatible string
> > > inside a swnode ? I do not know what that would look like but
> > > that is something which seems like it might be generally useful
> > > also outside these 2 special cases.
> > 
> > I haven't used them before, but I don't think of-compatible string
> > matching inside a swnode is done anywhere in the kernel (At least I
> > haven't found a case).
> > 
> > They can be added supplementary if needed.
> 
> The idea was to make this a generic match mechanism / helper
> function busses can call, like the current of and acpi
> match (and modalias) helpers. And then have matching by
> a compatible string instead of by name since matching by name
> only works if there is only 1 instance.
Please take a look at my previous review comment [1].

In this I suggested adding a `id_table` field to `serdev_driver`.
This allows to match multiple instances, including providing different
private datas.

software node is only relevant I think if you already use
`fwnode_property_read_string` inside a driver next to acpi and of, and
also want to handle devices without of or acpi.

Thanks
- Markus Probst

[1]
https://lore.kernel.org/linux-serial/0be5624e3778c3426f88daf2d67376435f474497.camel@posteo.de/

> 
> Anyways this is just an idea and somewhat out of scope for
> this patch-set.
> 
> Regards,
> 
> Hans
> 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 870 bytes --]

      reply	other threads:[~2026-10-21 18:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21  9:21 ChunAn Wu
2026-10-21  9:21 ` [PATCH v2 2/3] platform/x86: dell-uart-backlight: Bind through normal serdev matching ChunAn Wu
2026-10-21  9:21 ` [PATCH v2 3/3] platform/x86: lenovo-yoga-tab2-pro-1380-fastcharger: " ChunAn Wu
2026-10-21 13:39 ` [PATCH v2 1/3] serdev: handle devices without an ACPI or device tree node Markus Probst
2026-10-21 14:32 ` Hans de Goede
2026-10-21 15:08   ` Markus Probst
2026-10-21 18:07     ` Hans de Goede
2026-10-21 18:14       ` Markus Probst [this message]

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=90df4e3068d89c37b4c6813aacae02fcf9fc188a.camel@posteo.de \
    --to=markus.probst@posteo.de \
    --cc=an.wu@canonical.com \
    --cc=derekjohn.clark@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=platform-driver-x86@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®