Re: are device names part of sysfs ABI? (was Re: devicename part of LEDs under ethernet MAC / PHY)

From: Greg Kroah-Hartman
Date: Mon Oct 04 2021 - 02:37:48 EST


On Sun, Oct 03, 2021 at 10:53:38PM +0200, Marek Behún wrote:
> Hello Greg,
>
> could you give your opinion on this discussion?

What discussion? Top posting ruins that :(

> Are device names (as returned by dev_name() function) also part of
> sysfs ABI? Should these names be stable across reboots / kernel
> upgrades?

Stable in what exact way?

Numbering of devices (where a dynamic value is part of a name, like the
"42" in "usb42"), is never guaranteed to be stable, but the non-number
part of the name (like "usb" is in "usb42") is stable, as that is what
you have properly documented in the Documentation/ABI/ files defining
the bus and class devices, right?

The very reason we export all of this information to userspace is so
that userspace can figure it all out in ways it wants to, if it wants
to, and no naming scheme that has to be static and deterministic is
forced into the kernel, where it does NOT belong.

That is 1/2 of the reason why we created the whole "unified
device/driver model" in the kernel in the first place all those years
ago.

Does that help? I can't figure out what the "problem" is here...

thanks,

greg k-h