All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: Marek Vasut <marex@nabladev.com>, u-boot@lists.denx.de
Cc: Marek Vasut <marex@nabladev.com>,
	Lukasz Majewski <lukma@nabladev.com>,
	Mattijs Korpershoek <mkorpershoek@kernel.org>,
	Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH] cmd: ums: Set Device Descriptor iSerial based on serial# env variable
Date: Mon, 15 Jun 2026 09:18:20 +0200	[thread overview]
Message-ID: <875x3ki85f.fsf@kernel.org> (raw)
In-Reply-To: <20260613025510.134239-1-marex@nabladev.com>

Hi Marek,

Thank you for the patch.

On Sat, Jun 13, 2026 at 04:54, Marek Vasut <marex@nabladev.com> wrote:

> The DFU code currently sets the content of "serial#" environment
> variable into Device Descriptor iSerial field. This is useful when
> there are multiple devices connected to the same host PC and they
> have to be told apart. Replicate the same behavior in the UMS code.
>
> Example without serial# set, which is the original behavior:
> "
> u-boot=> ums 0 mmc 1
> UMS: LUN 0, dev mmc 1, hwpart 0, sector 0x0, count 0x1d5a000
>
> $ dmesg -w
> ...
> usb 5-2.3.7: New USB device found, idVendor=0525, idProduct=a4a5, bcdDevice=7e.a7
> usb 5-2.3.7: New USB device strings: Mfr=1, Product=2, SerialNumber=0
> usb 5-2.3.7: Product: USB download gadget
> usb 5-2.3.7: Manufacturer: Vendor
>                             <------------------------------- NOT HERE
> usb-storage 5-2.3.7:1.0: USB Mass Storage device detected
> ...
>
> $ lsusb -vd 0525:a4a5
>
> Bus 005 Device 051: ID 0525:a4a5 Netchip Technology, Inc. Linux-USB File-backed Storage Gadget
> Negotiated speed: High Speed (480Mbps)
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               2.00
>   bDeviceClass            0 [unknown]
>   bDeviceSubClass         0 [unknown]
>   bDeviceProtocol         0
>   bMaxPacketSize0        64
>   idVendor           0x0525 Netchip Technology, Inc.
>   idProduct          0xa4a5 Linux-USB File-backed Storage Gadget
>   bcdDevice           7e.a7
>   iManufacturer           1 Vendor
>   iProduct                2 USB download gadget
>   iSerial                 0 <------------------------------- NOT HERE
> ...
> "
>
> Example with serial# set to 1234abcd, which is the optional new behavior:
> "
> u-boot=> setenv serial# 1234abcd <------------------------------ HERE
> u-boot=> ums 0 mmc 1
> UMS: LUN 0, dev mmc 1, hwpart 0, sector 0x0, count 0x1d5a000
>
> $ dmesg -w
> ...
> usb 5-2.3.7: New USB device found, idVendor=0525, idProduct=a4a5, bcdDevice=7e.a7
> usb 5-2.3.7: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> usb 5-2.3.7: Product: USB download gadget
> usb 5-2.3.7: Manufacturer: Vendor
> usb 5-2.3.7: SerialNumber: 1234abcd <--------------------------- HERE
> usb-storage 5-2.3.7:1.0: USB Mass Storage device detected
> ...
>
> $ lsusb -vd 0525:a4a5
>
> Bus 005 Device 052: ID 0525:a4a5 Netchip Technology, Inc. Linux-USB File-backed Storage Gadget
> Negotiated speed: High Speed (480Mbps)
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               2.00
>   bDeviceClass            0 [unknown]
>   bDeviceSubClass         0 [unknown]
>   bDeviceProtocol         0
>   bMaxPacketSize0        64
>   idVendor           0x0525 Netchip Technology, Inc.
>   idProduct          0xa4a5 Linux-USB File-backed Storage Gadget
>   bcdDevice           7e.a7
>   iManufacturer           1 Vendor
>   iProduct                2 USB download gadget
>   iSerial                 3 1234abcd <-------------------------- HERE
> ...
> "
>
> Signed-off-by: Marek Vasut <marex@nabladev.com>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>

> ---

      parent reply	other threads:[~2026-06-15  7:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-13  2:54 [PATCH] cmd: ums: Set Device Descriptor iSerial based on serial# env variable Marek Vasut
2026-06-14 10:15 ` Łukasz Majewski
2026-06-15  7:18 ` Mattijs Korpershoek [this message]

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=875x3ki85f.fsf@kernel.org \
    --to=mkorpershoek@kernel.org \
    --cc=lukma@nabladev.com \
    --cc=marex@nabladev.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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.