From: Michael Ellerman <mpe@ellerman.id.au>
To: Lidong Zhong <lidong.zhong@suse.com>, linuxppc-dev@lists.ozlabs.org
Cc: lidong.zhong@suse.com
Subject: Re: [PATCH] powerpc/pseries: remove returning ENODEV when uevent is triggered
Date: Tue, 09 Apr 2024 18:46:00 +1000 [thread overview]
Message-ID: <877ch6c4af.fsf@mail.lhotse> (raw)
In-Reply-To: <20240323084737.12986-1-lidong.zhong@suse.com>
Hi Lidong,
Thanks for the patch.
I'm not an expert on udev etc. so apologies if any of these questions
are stupid.
Lidong Zhong <lidong.zhong@suse.com> writes:
> We have noticed the following nuisance messages during boot
>
> [ 7.120610][ T1060] vio vio: uevent: failed to send synthetic uevent
> [ 7.122281][ T1060] vio 4000: uevent: failed to send synthetic uevent
> [ 7.122304][ T1060] vio 4001: uevent: failed to send synthetic uevent
> [ 7.122324][ T1060] vio 4002: uevent: failed to send synthetic uevent
> [ 7.122345][ T1060] vio 4004: uevent: failed to send synthetic uevent
>
> It's caused by either vio_register_device_node() failed to set dev->of_node or
> the missing "compatible" property. Try return as much information as possible
> instead of a failure.
Does udev etc. cope with that? Can we just change the content of the
MODALIAS value like that?
With this patch we'll start emitting uevents for devices we previously
didn't. I guess that's OK because nothing is expecting them?
Can you include a log of udev showing the event firing and that nothing
breaks.
On my system here I see nothing matches the devices except for libvpd,
which seems to match lots of things.
> diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c
> index 90ff85c879bf..62961715ca24 100644
> --- a/arch/powerpc/platforms/pseries/vio.c
> +++ b/arch/powerpc/platforms/pseries/vio.c
> @@ -1593,12 +1593,13 @@ static int vio_hotplug(const struct device *dev, struct kobj_uevent_env *env)
>
> dn = dev->of_node;
> if (!dn)
> - return -ENODEV;
> + goto out;
> cp = of_get_property(dn, "compatible", NULL);
> if (!cp)
> - return -ENODEV;
> -
> - add_uevent_var(env, "MODALIAS=vio:T%sS%s", vio_dev->type, cp);
> + add_uevent_var(env, "MODALIAS=vio:T%s", vio_dev->type);
If it's OK to skip the compatible property then we don't need the
of_node at all, and we could always emit this, even when of_node is not
available.
> + else
> + add_uevent_var(env, "MODALIAS=vio:T%sS%s", vio_dev->type, cp);
> +out:
> return 0;
> }
I think we also should update the vio modalias_show() to follow the same
logic, otherwise the uevent MODALIAS value and the modalias file won't
match which is confusing.
Preferably vio_hotplug() and modalias_show() would just call a common
helper.
cheers
next prev parent reply other threads:[~2024-04-09 8:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-23 8:47 [PATCH] powerpc/pseries: remove returning ENODEV when uevent is triggered Lidong Zhong
2024-04-09 1:02 ` Lidong Zhong
2024-04-09 8:46 ` Michael Ellerman [this message]
2024-04-10 1:25 ` Lidong Zhong
2024-04-11 1:43 ` Lidong Zhong
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=877ch6c4af.fsf@mail.lhotse \
--to=mpe@ellerman.id.au \
--cc=lidong.zhong@suse.com \
--cc=linuxppc-dev@lists.ozlabs.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;
as well as URLs for NNTP newsgroup(s).