Re: [PATCH] usb: core: lower log level when device is not able to deal with string

2017-11-07 Thread Alan Stern
On Tue, 7 Nov 2017, Greg KH wrote:

> On Tue, Nov 07, 2017 at 03:58:29AM -0500, Kai-Heng Feng wrote:
> > USB devices should work just fine when they don't support language id.
> 
> They still work, but it's a "broken" device, and it should be fixed (I
> thought it was part of the spec, but I can't find it right now...)

The spec says that string descriptors are optional (section 9.6.7).  
But it also says that if a device doesn't support string descriptors 
then all references to strings within the other descriptors must be set 
to zero.  And if the string index values are then the kernel won't call 
usb_get_langid(), so the error message won't appear.

For devices that _do_ support string descriptors, the spec says:

String index zero for all languages returns a string
descriptor that contains an array of two-byte LANGID codes
supported by the device.

So a device that has string descriptors but doesn't support language 
IDs is noncompliant with the spec.

> > Lower the log level so user won't panic in the future.
> 
> No one is panicing :)
> 
> > BugLink: https://bugs.launchpad.net/bugs/1729618
> 
> This change would not have stopped that bug report from happening,
> right?
> 
> That being said, we do have the larger issue of "is this something that
> a user can do something about", or "is this a code/device error that
> prevents it from working" and the like, with our kernel log messages.
> But that's a much larger conversation to have...

This particular device error causes the kernel to avoid getting any 
string descriptors from the device at all.  But I think it is unlikely 
to mean that the device doesn't work, or will only work in a degraded 
mode.

Changing the log level from dev_err to dev_info seems to make sense.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb: core: lower log level when device is not able to deal with string

2017-11-07 Thread Greg KH
On Tue, Nov 07, 2017 at 03:58:29AM -0500, Kai-Heng Feng wrote:
> USB devices should work just fine when they don't support language id.

They still work, but it's a "broken" device, and it should be fixed (I
thought it was part of the spec, but I can't find it right now...)

> Lower the log level so user won't panic in the future.

No one is panicing :)

> BugLink: https://bugs.launchpad.net/bugs/1729618

This change would not have stopped that bug report from happening,
right?

That being said, we do have the larger issue of "is this something that
a user can do something about", or "is this a code/device error that
prevents it from working" and the like, with our kernel log messages.
But that's a much larger conversation to have...

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] usb: core: lower log level when device is not able to deal with string

2017-11-07 Thread Kai-Heng Feng
USB devices should work just fine when they don't support language id.

Lower the log level so user won't panic in the future.

BugLink: https://bugs.launchpad.net/bugs/1729618
Signed-off-by: Kai-Heng Feng 
---
 drivers/usb/core/message.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 371a07d874a3..dbd67b953e80 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -776,7 +776,7 @@ static int usb_get_langid(struct usb_device *dev, unsigned 
char *tbuf)
 * deal with strings at all. Set string_langid to -1 in order to
 * prevent any string to be retrieved from the device */
if (err < 0) {
-   dev_err(>dev, "string descriptor 0 read error: %d\n",
+   dev_info(>dev, "string descriptor 0 read error: %d\n",
err);
dev->string_langid = -1;
return -EPIPE;
-- 
2.14.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html