From: Greg KH <gregkh@linuxfoundation.org>
To: Johnson Tsai <wenjie.tsai@realtek.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
Ping-Ke Shih <pkshih@realtek.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"driver-core@lists.linux.dev" <driver-core@lists.linux.dev>,
"sabae@valvesoftware.com" <sabae@valvesoftware.com>,
Charles Lohr <charlesl@valvesoftware.com>
Subject: Re: [RFC rtw-next 1/2] wifi: rtw89: usb: add hw_info sysfs attribute
Date: Wed, 20 May 2026 13:36:04 +0200 [thread overview]
Message-ID: <2026052025-daringly-prolonged-5b2a@gregkh> (raw)
In-Reply-To: <b8640de28c5e4a94a3c2bbc3a101c1fa@realtek.com>
On Wed, May 20, 2026 at 09:41:46AM +0000, Johnson Tsai wrote:
>
>
> On Tuesday, May 19, 2026 20:23, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Tue, May 19, 2026 at 02:11:32PM +0200, Johannes Berg wrote:
> > > Hi,
> > >
> > > > > Example usage from user-space:
> > > > > $ cat /sys/bus/usb/devices/2-3.1.2:1.0/hw_info
> > > > > SN: 36 42 00 01 23
> > > > > UUID: aa ec 2b 7c 0a 55 47 27 8d e0 b3 0f eb cc bb aa
> > >
> > > Sysfs has a "one value per file" rule (soft rule according to the
> > > docs, but harder in practice, I believe), so seems if anything that
> > > should be two files. Maybe a UUID should also be formatted as such
> > > with %pU or similar.
> >
> > That should be 2 separate sysfs files please.
> >
> > And yes, use %pU.
>
> The v2 patch will use separate `sn` and `uuid` attributes, with `uuid`
> formatted via `%pU`. We also removed the spaces in `sn` to provide a clean
> string.
>
> Example usage from user-space:
> $ cat /sys/bus/usb/devices/2-3.1.2:1.0/sn
> 3642000123
> $ cat /sys/bus/usb/devices/2-3.1.2:1.0/uuid
> aaec2b7c-0a55-4727-8de0-b30febccbbaa
Wait, no, you are putting attributes in the USB interface device, which
is NOT the device your driver is creating. Don't do that, it makes for
massive confusion.
> > And be careful about exposing serial numbers to userspace, some systems
> > don't like normal users to read them so be sure to get the permissions correct.
> > We had to add some USB code for ALLOW_SERIAL_NUMBER to make it so that
> > systems can handle this if they want to.
> >
> > And shouldn't this just be the USB serial number to start with? Why is there a
> > different string here? We already have a sysfs file for this value.
>
> Regarding the serial number and permission design, these are requirements
> from Valve, so we have CC'd them here to provide the background.
>
> Hi Elliot and Charles, could you please help explain the requirements and use case here?
The USB serial number is already exported in sysfs, why export it again
under a different filename? That's ripe for total confusion :(
Also, where does this random UUID come from? That's not part of the USB
spec, is it? Why is it not just a USB string attribute like the spec
says to use for stuff like this?
thanks,
greg k-h
next prev parent reply other threads:[~2026-05-20 11:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 7:24 [RFC rtw-next 1/2] wifi: rtw89: usb: add hw_info sysfs attribute Ping-Ke Shih
2026-05-19 7:24 ` [RFC rtw-next 2/2] wifi: rtw89: usb: add sysfs write example Ping-Ke Shih
2026-05-19 7:37 ` [RFC rtw-next 1/2] wifi: rtw89: usb: add hw_info sysfs attribute Ping-Ke Shih
2026-05-19 12:11 ` Johannes Berg
2026-05-19 12:22 ` Greg KH
2026-05-20 9:41 ` Johnson Tsai
2026-05-20 11:36 ` Greg KH [this message]
2026-05-20 19:32 ` [External Mail] " Elliot Saba
2026-05-21 10:57 ` Greg KH
2026-05-21 13:06 ` Johnson Tsai
2026-05-21 13:11 ` Greg KH
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=2026052025-daringly-prolonged-5b2a@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=charlesl@valvesoftware.com \
--cc=driver-core@lists.linux.dev \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=pkshih@realtek.com \
--cc=sabae@valvesoftware.com \
--cc=wenjie.tsai@realtek.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.