<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/Documentation/ABI/testing/sysfs-devices-consumer, branch linux-6.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2021-01-21T19:12:40Z</updated>
<entry>
<title>driver core: Fix device link device name collision</title>
<updated>2021-01-21T19:12:40Z</updated>
<author>
<name>Saravana Kannan</name>
<email>saravanak@google.com</email>
</author>
<published>2021-01-10T17:54:07Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e020ff611ba9be54e959e6b548038f8a020da1c9'/>
<id>urn:sha1:e020ff611ba9be54e959e6b548038f8a020da1c9</id>
<content type='text'>
The device link device's name was of the form:
&lt;supplier-dev-name&gt;--&lt;consumer-dev-name&gt;

This can cause name collision as reported here [1] as device names are
not globally unique. Since device names have to be unique within the
bus/class, add the bus/class name as a prefix to the device names used to
construct the device link device name.

So the devuce link device's name will be of the form:
&lt;supplier-bus-name&gt;:&lt;supplier-dev-name&gt;--&lt;consumer-bus-name&gt;:&lt;consumer-dev-name&gt;

[1] - https://lore.kernel.org/lkml/20201229033440.32142-1-michael@walle.cc/

Fixes: 287905e68dd2 ("driver core: Expose device link details in sysfs")
Cc: stable@vger.kernel.org
Reported-by: Michael Walle &lt;michael@walle.cc&gt;
Tested-by: Michael Walle &lt;michael@walle.cc&gt;
Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Link: https://lore.kernel.org/r/20210110175408.1465657-1-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: Expose device link details in sysfs</title>
<updated>2020-07-10T13:24:56Z</updated>
<author>
<name>Saravana Kannan</name>
<email>saravanak@google.com</email>
</author>
<published>2020-05-21T19:17:58Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=287905e68dd29873bcb7986a8290cd1e4cfde600'/>
<id>urn:sha1:287905e68dd29873bcb7986a8290cd1e4cfde600</id>
<content type='text'>
It's helpful to be able to look at device link details from sysfs. So,
expose it in sysfs.

Say device-A is supplier of device-B. These are the additional files
this patch would create:

/sys/class/devlink/device-A:device-B/
	auto_remove_on
	consumer/ -&gt; .../device-B/
	runtime_pm
	status
	supplier/ -&gt; .../device-A/
	sync_state_only

/sys/devices/.../device-A/
	consumer:device-B/ -&gt; /sys/class/devlink/device-A:device-B/

/sys/devices/.../device-B/
	supplier:device-A/ -&gt; /sys/class/devlink/device-A:device-B/

That way:
To get a list of all the device link in the system:
ls /sys/class/devlink/

To get the consumer names and links of a device:
ls -d /sys/devices/.../device-X/consumer:*

To get the supplier names and links of a device:
ls -d /sys/devices/.../device-X/supplier:*

Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Link: https://lore.kernel.org/r/20200521191800.136035-2-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
