Project

General

Profile

Actions

Bug #7216

closed

usba logging through cmn_err (via usba_bus_ctl) output truncates (leading) some device names

Added by James Blachly about 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
driver - device drivers
Start date:
2016-07-23
Due date:
% Done:

100%

Estimated time:
1.00 h
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

In illumos-gate/usr/src/uts/common/io/usb/usba/usba.c,

usba_get_mfg_prod_sn_str() fills a buffer with a string by combining USB device Mfr name, USB product name, USB device Serial No.

The logic that builds the string checks to see if the product name contains a leading substring that includes the manufacturer name. If so, it intends to leave it out.

For example, if mfr = "Intel" and product = "Intel USB-powered toothbrush", and serial = "TB001", it would build the string "Intel USB-powered toothbrush TB001", rather than "Intel Intel USB-powered toothbrush TB001".

However, I have a Tripp Lite UPS that reports the following values (trailing spaces verbatim, but irrelevant to this issue):

mfr:     "Tripp Lite " 
product: "TRIPP LITE SMART1000RM2U " 

The logic that does substring matching and removes duplicates matches on the capital "T" in "Tripp Lite" and "TRIPP LITE", and strips the second T. Therefore, my dmesg log entries look like this:

2016-07-23T19:04:44.595667+00:00 smartos usba: [ID 349649 kern.info] #011Tripp Lite  RIPP LITE SMART1000RM2U  2535EY0SM826700276

(Side note: The #011 is a separate unrelated problem for which I've filed an issue (#7215), and I will fix that with same commit as this issue)

Now, this could be approached in at least two ways:
  1. Eliminate the substring matching. This could produce log file entries like
    "Intel Intel USB-powered toothbrush TB001"
    , but only if vendors include their mfr name in the product id, which not all may do.
  2. Make the substring matching case-insensitive. This would find "Tripp Lite" and "TRIPP LITE" equivalent and eliminate redundancy, but at the cost of extra kernel/driver code.

I am happy to fix this in whichever way the developer consensus leans.


Related issues

Related to illumos gate - Bug #7215: usba logging through cmn_err (via usba_bus_ctl) output erroneously includes tabClosedJames Blachly2016-07-23

Actions
Actions #1

Updated by James Blachly about 5 years ago

  • Related to Bug #7215: usba logging through cmn_err (via usba_bus_ctl) output erroneously includes tab added
Actions #2

Updated by Electric Monk almost 5 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 5c9564e13556d93b85933b234fdd8810ce82cd93

commit  5c9564e13556d93b85933b234fdd8810ce82cd93
Author: James Blachly <james.blachly@gmail.com>
Date:   2016-08-15T14:19:42.000Z

    7215 usba logging through cmn_err (via usba_bus_ctl) output erroneously includes tab
    7216 usba logging through cmn_err (via usba_bus_ctl) output truncates (leading) some device names
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Approved by: Dan McDonald <danmcd@omniti.com>

Actions

Also available in: Atom PDF