Received: by 10.213.65.68 with SMTP id h4csp1640677imn; Mon, 26 Mar 2018 11:29:03 -0700 (PDT) X-Google-Smtp-Source: AG47ELuVyEiT1JKMrbfaZYqVRgypEGeh1wmS0+4zFuhUgUFBjntYsHLnNst6vMhnN9NNB0egJPVo X-Received: by 10.99.101.193 with SMTP id z184mr29935991pgb.429.1522088943742; Mon, 26 Mar 2018 11:29:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522088943; cv=none; d=google.com; s=arc-20160816; b=mqCTWbyETCR61nZJCJ7ZWYtdMB0oUa+wl7w5uRo6OFOubKkjO/ec0FgVtq3TYqur6Y 8m+xOExPlA6pJ0DyzJguWH9vN7VEae8hQdGeD79HjwrgeudF5rNpXijUjAmsAx4iETDf STgDA/GqJEusCLQBHc4gdNClK7wIKptlqMYST8jMuRq2Nk+yDqwPc4KRVv6aZ2VXhvT0 ctDSUIZxnbJpDjPI252zB2weMTUeQm13FiWw74F9LCF+gMUwquWyq0UM+JNwxw+qZHxh V3RnNDuquTgQOvzlmxegljO0yLlEVcBBl8aOi9ychTFSBpEzJ6moKO8+EZR5XBylpujv 7/9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date:arc-authentication-results; bh=V44INgrAgUEmZ7kg9mdX3IL0Er73W27HpPsKgA7PLm4=; b=u8Cu3uxcz7EVIwuBbhk1evv2ZsngFsV9MuVzMKjarnZ6ni43IuXRHH5fLb+ZNWiAn8 UgxpkM+OpOilmhjFg5Kp7PQm4E8hBhUMqTMngpR+YJ3JxnZEHK+OQp8ZWlOJ3SnaiiQi LwePGmtnD17RVRtsCN73l7blF2EOYdewXECUvj5YDWe5KCZdGII9gdB9nvKFEQj7mu18 jM3oVlN9JiDR8PB+VFu7BEmr3uwIQ/OOuupSUJISmPEYqO/dktvLhSfTGrnH6KY4Xl4y TK+ndZL1uOSY0MqwsZWLtdmT7G1kyIvv6NNHnkR6zJ6kUHzUBx1zZWyYpEVDRm/nAu+6 QV1Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o26si10659175pge.538.2018.03.26.11.28.48; Mon, 26 Mar 2018 11:29:03 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752716AbeCZS1f (ORCPT + 99 others); Mon, 26 Mar 2018 14:27:35 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:37466 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752459AbeCZS1b (ORCPT ); Mon, 26 Mar 2018 14:27:31 -0400 Received: (qmail 2364 invoked by uid 2102); 26 Mar 2018 14:27:30 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 26 Mar 2018 14:27:30 -0400 Date: Mon, 26 Mar 2018 14:27:30 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Benson Leung cc: gregkh@linuxfoundation.org, , , , Subject: Re: [PATCH v3] USB: announce bcdDevice as well as idVendor, idProduct. In-Reply-To: <20180324174027.12522-1-bleung@chromium.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 24 Mar 2018, 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. > > Match the %2x.%02x formatting that's used by lsusb -v for this same value. > > Signed-off-by: Benson Leung > --- > > v3: Remove unnecessary whitespace changes. > v2: Format for decimal output. > > drivers/usb/core/hub.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c > index aaeef03c0d83..779725836cf5 100644 > --- a/drivers/usb/core/hub.c > +++ b/drivers/usb/core/hub.c > @@ -2192,9 +2192,13 @@ 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", > + u16 bcdDevice = le16_to_cpu(udev->descriptor.bcdDevice); > + > + dev_info(&udev->dev, > + "New USB device found, idVendor=%04x, idProduct=%04x, bcdDevice=%2x.%02x\n", > le16_to_cpu(udev->descriptor.idVendor), > - le16_to_cpu(udev->descriptor.idProduct)); > + le16_to_cpu(udev->descriptor.idProduct), > + bcdDevice >> 8, bcdDevice & 0xff); > dev_info(&udev->dev, > "New USB device strings: Mfr=%d, Product=%d, SerialNumber=%d\n", > udev->descriptor.iManufacturer, Acked-by: Alan Stern