diff mbox series

[v2] powerpc/pseries: remove returning ENODEV when uevent is triggered

Message ID 20240411020450.12725-1-lidong.zhong@suse.com (mailing list archive)
State New
Headers show
Series [v2] powerpc/pseries: remove returning ENODEV when uevent is triggered | expand

Checks

Context Check Description
snowpatch_ozlabs/github-powerpc_selftests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_ppctests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_clang success Successfully ran 6 jobs.
snowpatch_ozlabs/github-powerpc_kernel_qemu success Successfully ran 23 jobs.
snowpatch_ozlabs/github-powerpc_sparse success Successfully ran 4 jobs.

Commit Message

Lidong Zhong April 11, 2024, 2:04 a.m. UTC
We noticed the following nuisance messages during boot process

[    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: failedto send synthetic uevent
[    7.122345][ T1060] vio 4004: uevent: failed to send synthetic uevent

It's caused by either vio_register_device_node() fails to set dev->of_node
or the missing "compatible" property. To keep align with the definition of
modalias in modalias_show(), we remove the return of ENODEV in such cases.
The failure messages can also be suppressed with this change.

v2: keep align the definition of modalias with modalias_show()
Signed-off-by: Lidong Zhong <lidong.zhong@suse.com>
---
 arch/powerpc/platforms/pseries/vio.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Lidong Zhong April 25, 2024, 12:47 a.m. UTC | #1
Hi Michael,

Could you share your opinion about this new patch please?

On Thu, Apr 11, 2024 at 10:04 AM Lidong Zhong <lidong.zhong@suse.com> wrote:

> We noticed the following nuisance messages during boot process
>
> [    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: failedto send synthetic uevent
> [    7.122345][ T1060] vio 4004: uevent: failed to send synthetic uevent
>
> It's caused by either vio_register_device_node() fails to set dev->of_node
> or the missing "compatible" property. To keep align with the definition of
> modalias in modalias_show(), we remove the return of ENODEV in such cases.
> The failure messages can also be suppressed with this change.
>
> v2: keep align the definition of modalias with modalias_show()
> Signed-off-by: Lidong Zhong <lidong.zhong@suse.com>
> ---
>  arch/powerpc/platforms/pseries/vio.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/vio.c
> b/arch/powerpc/platforms/pseries/vio.c
> index 90ff85c879bf..b2babfdbc40b 100644
> --- a/arch/powerpc/platforms/pseries/vio.c
> +++ b/arch/powerpc/platforms/pseries/vio.c
> @@ -1592,13 +1592,9 @@ static int vio_hotplug(const struct device *dev,
> struct kobj_uevent_env *env)
>         const char *cp;
>
>         dn = dev->of_node;
> -       if (!dn)
> -               return -ENODEV;
> -       cp = of_get_property(dn, "compatible", NULL);
> -       if (!cp)
> -               return -ENODEV;
> +       if (dn && (cp = of_get_property(dn, "compatible", NULL)))
> +               add_uevent_var(env, "MODALIAS=vio:T%sS%s", vio_dev->type,
> cp);
>
> -       add_uevent_var(env, "MODALIAS=vio:T%sS%s", vio_dev->type, cp);
>         return 0;
>  }
>
> --
> 2.35.3
>
>
diff mbox series

Patch

diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c
index 90ff85c879bf..b2babfdbc40b 100644
--- a/arch/powerpc/platforms/pseries/vio.c
+++ b/arch/powerpc/platforms/pseries/vio.c
@@ -1592,13 +1592,9 @@  static int vio_hotplug(const struct device *dev, struct kobj_uevent_env *env)
 	const char *cp;
 
 	dn = dev->of_node;
-	if (!dn)
-		return -ENODEV;
-	cp = of_get_property(dn, "compatible", NULL);
-	if (!cp)
-		return -ENODEV;
+	if (dn && (cp = of_get_property(dn, "compatible", NULL)))
+		add_uevent_var(env, "MODALIAS=vio:T%sS%s", vio_dev->type, cp);
 
-	add_uevent_var(env, "MODALIAS=vio:T%sS%s", vio_dev->type, cp);
 	return 0;
 }