[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8cb5f20f-f9da-4d26-af2d-f63771990fd3@lunn.ch>
Date: Wed, 13 Dec 2023 11:06:42 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Christian Marangi <ansuelsmth@...il.com>
Cc: Pavel Machek <pavel@....cz>, Lee Jones <lee@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Daniel Golle <daniel@...rotopia.org>,
Li Zetao <lizetao1@...wei.com>, linux-leds@...r.kernel.org,
linux-kernel@...r.kernel.org,
Marek BehĂșn <kabel@...nel.org>
Subject: Re: [PATCH] leds: trigger: netdev: display only supported link speed
attribute
On Sat, Dec 09, 2023 at 04:07:24PM +0100, Christian Marangi wrote:
> With the addition of more link speed mode to the netdev trigger, it was
> pointed out that there may be a problem with bloating the attribute list
> with modes that won't ever be supported by the trigger as the attached
> device name doesn't support them.
>
> To clear and address this problem, change the logic where these
> additional trigger modes are added.
>
> Since the netdev trigger REQUIRE a device name to be set, attach to the
> device name change function additional logic to parse the supported link
> speed modes using ethtool APIs and add only the supported link speed
> modes attribute.
>
> This only apply to the link speed modes and every other mode is still
> provided by default.
Deleting the file and then re-creating it is not so nice when handling
user space. Have you tried this while holding the file open?
Please take a look at the is_visible() method of a sysfs group. If it
returns 0, the file is simply not visible in sysfs, but it still
exists. It is not a problem if a process holds it open when it becomes
invisible.
Andrew
---
pw-bot: cr
Powered by blists - more mailing lists