All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Jisheng Zhang <jszhang@kernel.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] usb: gadget: Add a prefix to log messages
Date: Tue, 27 Jan 2026 15:22:50 +0100	[thread overview]
Message-ID: <2026012744-disfigure-plural-5699@gregkh> (raw)
In-Reply-To: <04929f5f-8760-45f1-999a-c48e8dea6876@rowland.harvard.edu>

On Fri, Jan 23, 2026 at 11:18:29AM -0500, Alan Stern wrote:
> On Fri, Jan 23, 2026 at 03:52:11PM +0100, Greg Kroah-Hartman wrote:
> > On Fri, Jan 23, 2026 at 10:22:18PM +0800, Jisheng Zhang wrote:
> > > I met some log as below:
> > > [  581.262476] read descriptors
> > > [  581.265558] bcdVersion must be 0x0100, stored in Little Endian order...
> > > 
> > > To be honest, if I'm not familiar with the usb gadget framework, I dunno
> > > which component is complaining. Add a prefix to log messages, so the
> > > above messages will be look as below:
> > > 
> > > [  581.262476] usb_f_fs: read descriptors
> > > [  581.265558] usb_f_fs: bcdVersion must be 0x0100, stored in Little Endian order...
> > > 
> > > Then solve similar issues for f_mass_storage and f_tcm.
> > 
> > These should all be using the dev_info() and like calls, not pr_*(), and
> > if that happens, then you will get the correct prefix.  Can you make
> > that change instead?
> 
> Unfortunately, the composite gadget driver doesn't create sub-devices of 
> the gadget for the various function drivers to bind to.  The only device 
> available is the gadget itself, and its driver's name is just 
> "composite".  Therefore dev_info() and others will not show the 
> particular function driver, which is what Jisheng wants to see.
> 
> Also, some of the calls affected by these changes occur at module 
> initialization time, before anything has been bound.  They don't yet 
> have any device to refer to.

For things that happen before a device, sure, pr_() is ok (but really
should be quiet unless it's for debugging stuff.)  The other ones should
have or get a device pointer eventually.  Using dev_info() AND the
function driver name is the best way forward here, that way you know
exactly what device it is referring to.

thanks,

greg k-h

      reply	other threads:[~2026-01-27 14:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-23 14:22 [PATCH 0/3] usb: gadget: Add a prefix to log messages Jisheng Zhang
2026-01-23 14:22 ` [PATCH 1/3] usb: gadget: f_fs: " Jisheng Zhang
2026-01-23 14:22 ` [PATCH 2/3] usb: gadget: f_mass_storage: " Jisheng Zhang
2026-01-23 16:00   ` Alan Stern
2026-01-23 14:22 ` [PATCH 3/3] usb: gadget: f_tcm: " Jisheng Zhang
2026-01-23 14:52 ` [PATCH 0/3] usb: gadget: " Greg Kroah-Hartman
2026-01-23 16:18   ` Alan Stern
2026-01-27 14:22     ` Greg Kroah-Hartman [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=2026012744-disfigure-plural-5699@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=jszhang@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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.