Received: by 10.213.65.68 with SMTP id h4csp831204imn; Fri, 23 Mar 2018 18:09:58 -0700 (PDT) X-Google-Smtp-Source: AG47ELvO3gacFRi4/UyIo9zn9BCbGdSh9MhWlFrBGBATzZnjgA9dyYrA/muwQF1MwKun9m528bcb X-Received: by 10.99.123.86 with SMTP id k22mr8175276pgn.228.1521853798160; Fri, 23 Mar 2018 18:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521853798; cv=none; d=google.com; s=arc-20160816; b=HPquoXY5ZaS0Zw9fD3daGxYEE5JmC4ER6voySVbZhzqTjGA25AiQuO18XSSrDkQlEZ WwzUv6TKFStqBheJhkflQ9ImJgz32ZyYAgP/Gj6ZenZw5XQ6WTDUtK9GWXGPu+SqwsAi KrD9Bvmsc2mbm6Gsg686kTj+QVQbIzYGlRKk91ctN2X5P1ShociyAO0YA50HFlCVIBYm +fUeCDSL4dl8wTq48C5uOnLp9UO+EWu7rT4Ao1eMYQq3qLkDkorcQ57iickHZ6fqBfnC Ba6RDMAUJ6IjLsLS/rqX04EF0RqfWhPkH4M50KRVlUCrf6ZElv8eKwGYIqvYBRahcsc6 Fjaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=bFSf9JdJ65GTNGA4qO4weYOP40b5jW7ie9rxqRs5Hbs=; b=X7/bOpCk1F8Te0ZWyQcuAiYj+05zE50yVP1lTfKdCE3Iw5ER+2olAJhEzVyw8byg/2 KoXDdEs/8PTj2W6an3pqxy2k8ZAyP0TvykQaC1BB4g6997GfFuVlwGLLhsdBXWBR/ded Ti//zvH0XLh8sWvaZ7mQmV1pLgsCMYRzpVU7YRPiBE1rSw5zJ0gd/fBLKz8hLMyEa8m6 AQcJERKtZw1zrZIS3992CCYgFrxaWDJKPequuop2kqrFmSp/f2DtbNK94X2GOM0LYrTe 69LJ4M+37nWTMDXDOyuhd6kR/2DQ4sYpITgxkpThgiiTmHLg/cy15e49eMRftObRepjD 0kCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tCVQvfcv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q87si7674226pfa.385.2018.03.23.18.09.41; Fri, 23 Mar 2018 18:09:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tCVQvfcv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751907AbeCXBIu (ORCPT + 99 others); Fri, 23 Mar 2018 21:08:50 -0400 Received: from mail-yb0-f194.google.com ([209.85.213.194]:41214 "EHLO mail-yb0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751715AbeCXBIs (ORCPT ); Fri, 23 Mar 2018 21:08:48 -0400 Received: by mail-yb0-f194.google.com with SMTP id x72-v6so1059201ybe.8 for ; Fri, 23 Mar 2018 18:08:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=bFSf9JdJ65GTNGA4qO4weYOP40b5jW7ie9rxqRs5Hbs=; b=tCVQvfcvUtToWNvT/RI5HgFJ6ZVL02hBgEkTRczi6anFo01GGlX4KfevOewJw+6zwD zOX3g4hO3YaSy0UE1+MyygIthxLjTn47+rHFE8fIRXXCfG5cnFOLi3C28TOBGKu96wKN F+pOPoK7G8GzpLt5G6++Jd/5N0CISWepzAo3ZjyhMynVxggXXKL6VPqpqYZOTl5FCGuL GM0YiRvF+xWsHAfN544r+dDm/IBBC5PZBa6jzRTL3Mns+h/phOEx93x6w6HwhDLxavyl m/SkqwKQRud0eLMx19tQh2vWRs4jBk1ycDNOvdNrwt3hdoXBsmOzvQ3ffhg4WN+jV9XV rKJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=bFSf9JdJ65GTNGA4qO4weYOP40b5jW7ie9rxqRs5Hbs=; b=YPW32p/v9qb94Cp3giEtwE5ruvXH5VkJe229z+j0NSLtej1bLEkSh9Bs5H+yqNAVyf KYEeo2w2UnlCGUkWKvvS7td95Er3O+htZGY5MFx6ANj+Q+Z4hLztVSh5SLlVOPFdue8w NgXBn3zJsnh3XLm9kfFZ+6tKo5s3o85QrYqliK9tkzn7NgKIli1IUcn3XVzVhBAIESkX H7xne4tyPelimp8E5mSDZzRJoOwwaBsxtbPzYYwJVo4ftiES1qKdFO3ub+/CFk4HD+ob BcJPzf/O+J0oDVek+Bmc9Lf7BVQDPVNDFrOzed579q/4S3WX50VbVm2a/ZSFKzBe6j3W NT0A== X-Gm-Message-State: AElRT7HmKxs0p49HTLLgvD3BoBirASsVtaCcxrQS390EAFd5MOQDm8cn mLYs7G+ojqy4G/BodwTZsNw+wsibT0Id2BAXwboqoA== X-Received: by 2002:a25:810d:: with SMTP id o13-v6mr18731701ybk.340.1521853727788; Fri, 23 Mar 2018 18:08:47 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:6a41:0:0:0:0:0 with HTTP; Fri, 23 Mar 2018 18:08:07 -0700 (PDT) In-Reply-To: References: <20180324003330.180726-1-bleung@chromium.org> From: Andrew Chant Date: Fri, 23 Mar 2018 18:08:07 -0700 Message-ID: Subject: Re: [PATCH] USB: announce bcdDevice as well as idVendor, idProduct. To: Benson Leung Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Benson Leung Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 23, 2018 at 5:48 PM, Andrew Chant wrote: > On Fri, Mar 23, 2018 at 5:33 PM, Benson Leung wrote: >> Print bcdDevice which is used by vendors to identify different versions >> of the same product (or different versions of firmware). >> >> Adding this to the logs will be useful for support purposes. >> >> Signed-off-by: Benson Leung >> --- >> drivers/usb/core/hub.c | 16 +++++++++------- >> 1 file changed, 9 insertions(+), 7 deletions(-) >> >> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c >> index aaeef03c0d83..739d599814b6 100644 >> --- a/drivers/usb/core/hub.c >> +++ b/drivers/usb/core/hub.c >> @@ -2192,14 +2192,16 @@ static void show_string(struct usb_device *udev, char *id, char *string) >> >> static void announce_device(struct usb_device *udev) >> { >> - dev_info(&udev->dev, "New USB device found, idVendor=%04x, idProduct=%04x\n", >> - le16_to_cpu(udev->descriptor.idVendor), >> - le16_to_cpu(udev->descriptor.idProduct)); >> dev_info(&udev->dev, >> - "New USB device strings: Mfr=%d, Product=%d, SerialNumber=%d\n", >> - udev->descriptor.iManufacturer, >> - udev->descriptor.iProduct, >> - udev->descriptor.iSerialNumber); >> + "New USB device found, idVendor=%04x, idProduct=%04x, bcdDevice=%04x\n", >> + le16_to_cpu(udev->descriptor.idVendor), >> + le16_to_cpu(udev->descriptor.idProduct), >> + le16_to_cpu(udev->descriptor.bcdDevice)); >> + dev_info(&udev->dev, >> + "New USB device strings: Mfr=%d, Product=%d, SerialNumber=%d\n", >> + udev->descriptor.iManufacturer, >> + udev->descriptor.iProduct, >> + udev->descriptor.iSerialNumber); >> show_string(udev, "Product", udev->product); >> show_string(udev, "Manufacturer", udev->manufacturer); >> show_string(udev, "SerialNumber", udev->serial); >> -- >> 2.17.0.rc0.231.g781580f067-goog >> > >> + "New USB device found, idVendor=%04x, idProduct=%04x, bcdDevice=%04x\n", > Can you please decode bcdDevice into a decimal string? > > lsusb -v does this (bcdDevice: 0.03 for example) and in my experience > it has generally matched up with how hardware manufacturers refer > to their firmware. Nevermind, %x should show bcd properly. looks fine.