public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] usb: gadget: Add a prefix to log messages
@ 2026-01-23 14:22 Jisheng Zhang
  2026-01-23 14:22 ` [PATCH 1/3] usb: gadget: f_fs: " Jisheng Zhang
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Jisheng Zhang @ 2026-01-23 14:22 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel

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.

Jisheng Zhang (3):
  usb: gadget: f_fs: Add a prefix to log messages
  usb: gadget: f_mass_storage: Add a prefix to log messages
  usb: gadget: f_tcm: Add a prefix to log messages

 drivers/usb/gadget/function/f_fs.c           | 2 ++
 drivers/usb/gadget/function/f_mass_storage.c | 2 ++
 drivers/usb/gadget/function/f_tcm.c          | 3 +++
 3 files changed, 7 insertions(+)

-- 
2.51.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] usb: gadget: f_fs: Add a prefix to log messages
  2026-01-23 14:22 [PATCH 0/3] usb: gadget: Add a prefix to log messages Jisheng Zhang
@ 2026-01-23 14:22 ` Jisheng Zhang
  2026-01-23 14:22 ` [PATCH 2/3] usb: gadget: f_mass_storage: " Jisheng Zhang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Jisheng Zhang @ 2026-01-23 14:22 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel

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 look like:

[  581.262476] usb_f_fs: read descriptors
[  581.265558] usb_f_fs: bcdVersion must be 0x0100, stored in Little Endian order...

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/usb/gadget/function/f_fs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index 05c6750702b6..97c7f0052327 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -14,6 +14,8 @@
 /* #define DEBUG */
 /* #define VERBOSE_DEBUG */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/blkdev.h>
 #include <linux/dma-buf.h>
 #include <linux/dma-fence.h>
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] usb: gadget: f_mass_storage: Add a prefix to log messages
  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 ` 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
  3 siblings, 1 reply; 8+ messages in thread
From: Jisheng Zhang @ 2026-01-23 14:22 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel

Similar as last patch, add a prefix to log messages so that users can
convienently know where's the msg from.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/usb/gadget/function/f_mass_storage.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c
index 94d478b6bcd3..d7ae076705c4 100644
--- a/drivers/usb/gadget/function/f_mass_storage.c
+++ b/drivers/usb/gadget/function/f_mass_storage.c
@@ -168,6 +168,8 @@
 /* #define VERBOSE_DEBUG */
 /* #define DUMP_MSGS */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/blkdev.h>
 #include <linux/completion.h>
 #include <linux/dcache.h>
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] usb: gadget: f_tcm: Add a prefix to log messages
  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 14:22 ` Jisheng Zhang
  2026-01-23 14:52 ` [PATCH 0/3] usb: gadget: " Greg Kroah-Hartman
  3 siblings, 0 replies; 8+ messages in thread
From: Jisheng Zhang @ 2026-01-23 14:22 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel

Similar as last patch, add a prefix to log messages so that users can
convienently know where's the msg from.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/usb/gadget/function/f_tcm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c
index 6e8804f04baa..760f5a02e6af 100644
--- a/drivers/usb/gadget/function/f_tcm.c
+++ b/drivers/usb/gadget/function/f_tcm.c
@@ -6,6 +6,9 @@
  *
  * Author: Sebastian Andrzej Siewior <bigeasy at linutronix dot de>
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/types.h>
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/3] usb: gadget: Add a prefix to log messages
  2026-01-23 14:22 [PATCH 0/3] usb: gadget: Add a prefix to log messages Jisheng Zhang
                   ` (2 preceding siblings ...)
  2026-01-23 14:22 ` [PATCH 3/3] usb: gadget: f_tcm: " Jisheng Zhang
@ 2026-01-23 14:52 ` Greg Kroah-Hartman
  2026-01-23 16:18   ` Alan Stern
  3 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2026-01-23 14:52 UTC (permalink / raw)
  To: Jisheng Zhang; +Cc: linux-usb, linux-kernel

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?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] usb: gadget: f_mass_storage: Add a prefix to log messages
  2026-01-23 14:22 ` [PATCH 2/3] usb: gadget: f_mass_storage: " Jisheng Zhang
@ 2026-01-23 16:00   ` Alan Stern
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Stern @ 2026-01-23 16:00 UTC (permalink / raw)
  To: Jisheng Zhang; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel

On Fri, Jan 23, 2026 at 10:22:20PM +0800, Jisheng Zhang wrote:
> Similar as last patch,

This is not a good thing to put in a patch description.  Once the patch 
has been merged into the kernel source, nobody will know what the "last 
patch" was -- it refers to something in a mailing list, not something 
available to people reading a changelog in Git.

Alan Stern

>  add a prefix to log messages so that users can
> convienently know where's the msg from.
> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
>  drivers/usb/gadget/function/f_mass_storage.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c
> index 94d478b6bcd3..d7ae076705c4 100644
> --- a/drivers/usb/gadget/function/f_mass_storage.c
> +++ b/drivers/usb/gadget/function/f_mass_storage.c
> @@ -168,6 +168,8 @@
>  /* #define VERBOSE_DEBUG */
>  /* #define DUMP_MSGS */
>  
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
>  #include <linux/blkdev.h>
>  #include <linux/completion.h>
>  #include <linux/dcache.h>
> -- 
> 2.51.0
> 
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/3] usb: gadget: Add a prefix to log messages
  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
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Stern @ 2026-01-23 16:18 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Jisheng Zhang, linux-usb, linux-kernel

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.

Alan Stern

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/3] usb: gadget: Add a prefix to log messages
  2026-01-23 16:18   ` Alan Stern
@ 2026-01-27 14:22     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2026-01-27 14:22 UTC (permalink / raw)
  To: Alan Stern; +Cc: Jisheng Zhang, linux-usb, linux-kernel

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-01-27 14:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox