Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1180711ybf; Thu, 27 Feb 2020 06:25:30 -0800 (PST) X-Google-Smtp-Source: APXvYqxdvsU2gFqj9mSF9SZPNAik3YhdcmNmNR2y/EoheLqa4NVr4kUJU1OAXgyxnY2iqHFQUuEL X-Received: by 2002:aca:dc45:: with SMTP id t66mr3604265oig.39.1582813530147; Thu, 27 Feb 2020 06:25:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582813530; cv=none; d=google.com; s=arc-20160816; b=L10yYqwocFYn4bSnFkaQ9MKhACPVNQoQ9GsORMzdPONAmGeVAVJLFXs6/x8vfPEDqa 4uM8fXY2e00cCAzxYR2LafCpxtRKKltBgfdIX1r0AwmBw+a2VNSujpDI23Zb2zf3+QlY k5Tw7Qk56pQPriCEGXcKMfk7QOrJtAVJxnAINxGfsIaTJMDV23eYRYx7G2lnevPZZQoZ BFpp9/7676paUeFBi2EhE2flDi7oZeL1snsB+enxEnWz0YMmvV5CJM7d+aWpSRaT5fMz MDuQ4O1CUcKt/EpbQYo4+JVMQqveBPk3Nrhn6RnkWzPg9Bg65oD4siMd+cMyk6sjoZpK Qcsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pRHU1OJ0vo0uw6/1gErPOvSz2UmTGHiUDlZvc8UfHzA=; b=TsSEFJkBniA/e5yYbS7QnYy4H1CPN3d5sYCt/4+fYzTC/U7vMtzOeIUpAdZsw5ssTz VmoadOK3bnodPkp0cdMFP9EDgbbAEShn6f81cmLV3xsmW6aKGAja9uKWa0iRBmHIOqL6 UHv9eLKrZXCPZ5GiZ7/C2qPiBrAzUq7F6P79FqvUxPQ+QBra6NYfmhJM3StUT0bxcYu2 tr/u9tJiUY4G3rU8ingj7ij8SaZDxu1Qjwir/Taa7d1KKNHqHaNav+zisUC6IVwY3Onq JdZSWpcBpa8QuwqCV3spoyFHxuZjtVOI7jZYNvYxqnFGHx4NOsl3Fk6v29XFwGup4Maa 6C2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=etEzOyWo; 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 o15si1474846otp.314.2020.02.27.06.25.18; Thu, 27 Feb 2020 06:25:30 -0800 (PST) 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=@kernel.org header.s=default header.b=etEzOyWo; 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 S2389091AbgB0OON (ORCPT + 99 others); Thu, 27 Feb 2020 09:14:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:53262 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730942AbgB0OOK (ORCPT ); Thu, 27 Feb 2020 09:14:10 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C53C420578; Thu, 27 Feb 2020 14:14:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582812849; bh=9va24nQcUnztpfTBbAc1NT0YuuUGrt7nm98NPeeF0k0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=etEzOyWoAhpiGa2LG4cJIOgT1qfST0tWGgVGHZEp+swndVCCznrjReWoHJ2mNuzaY uKbzSQSM+Wf+tKN6tYA4wRc7MfUJH+zJ9eBYz+f38Fo19aSUvTHG4JPJcbmmSa/ywB F4EPqlqqf3yjb3SiyogTKimDCBpL8emowqipb9z8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Stern , Hardik Gajjar , Eugeniu Rosca Subject: [PATCH 5.5 040/150] USB: hub: Fix the broken detection of USB3 device in SMSC hub Date: Thu, 27 Feb 2020 14:36:17 +0100 Message-Id: <20200227132238.759227845@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227132232.815448360@linuxfoundation.org> References: <20200227132232.815448360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hardik Gajjar commit 1208f9e1d758c991b0a46a1bd60c616b906bbe27 upstream. Renesas R-Car H3ULCB + Kingfisher Infotainment Board is either not able to detect the USB3.0 mass storage devices or is detecting those as USB2.0 high speed devices. The explanation given by Renesas is that, due to a HW issue, the XHCI driver does not wake up after going to sleep on connecting a USB3.0 device. In order to mitigate that, disable the auto-suspend feature specifically for SMSC hubs from hub_probe() function, as a quirk. Renesas Kingfisher Infotainment Board has two USB3.0 ports (CN2) which are connected via USB5534B 4-port SuperSpeed/Hi-Speed, low-power, configurable hub controller. [1] SanDisk USB 3.0 device detected as USB-2.0 before the patch [ 74.036390] usb 5-1.1: new high-speed USB device number 4 using xhci-hcd [ 74.061598] usb 5-1.1: New USB device found, idVendor=0781, idProduct=5581, bcdDevice= 1.00 [ 74.069976] usb 5-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 74.077303] usb 5-1.1: Product: Ultra [ 74.080980] usb 5-1.1: Manufacturer: SanDisk [ 74.085263] usb 5-1.1: SerialNumber: 4C530001110208116550 [2] SanDisk USB 3.0 device detected as USB-3.0 after the patch [ 34.565078] usb 6-1.1: new SuperSpeed Gen 1 USB device number 3 using xhci-hcd [ 34.588719] usb 6-1.1: New USB device found, idVendor=0781, idProduct=5581, bcdDevice= 1.00 [ 34.597098] usb 6-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 34.604430] usb 6-1.1: Product: Ultra [ 34.608110] usb 6-1.1: Manufacturer: SanDisk [ 34.612397] usb 6-1.1: SerialNumber: 4C530001110208116550 Suggested-by: Alan Stern Signed-off-by: Hardik Gajjar Acked-by: Alan Stern Tested-by: Eugeniu Rosca Cc: stable Link: https://lore.kernel.org/r/1580989763-32291-1-git-send-email-hgajjar@de.adit-jv.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/hub.c | 15 +++++++++++++++ drivers/usb/core/hub.h | 1 + 2 files changed, 16 insertions(+) --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -38,7 +38,9 @@ #include "otg_whitelist.h" #define USB_VENDOR_GENESYS_LOGIC 0x05e3 +#define USB_VENDOR_SMSC 0x0424 #define HUB_QUIRK_CHECK_PORT_AUTOSUSPEND 0x01 +#define HUB_QUIRK_DISABLE_AUTOSUSPEND 0x02 #define USB_TP_TRANSMISSION_DELAY 40 /* ns */ #define USB_TP_TRANSMISSION_DELAY_MAX 65535 /* ns */ @@ -1726,6 +1728,10 @@ static void hub_disconnect(struct usb_in kfree(hub->buffer); pm_suspend_ignore_children(&intf->dev, false); + + if (hub->quirk_disable_autosuspend) + usb_autopm_put_interface(intf); + kref_put(&hub->kref, hub_release); } @@ -1858,6 +1864,11 @@ static int hub_probe(struct usb_interfac if (id->driver_info & HUB_QUIRK_CHECK_PORT_AUTOSUSPEND) hub->quirk_check_port_auto_suspend = 1; + if (id->driver_info & HUB_QUIRK_DISABLE_AUTOSUSPEND) { + hub->quirk_disable_autosuspend = 1; + usb_autopm_get_interface(intf); + } + if (hub_configure(hub, &desc->endpoint[0].desc) >= 0) return 0; @@ -5594,6 +5605,10 @@ out_hdev_lock: } static const struct usb_device_id hub_id_table[] = { + { .match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_INT_CLASS, + .idVendor = USB_VENDOR_SMSC, + .bInterfaceClass = USB_CLASS_HUB, + .driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND}, { .match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_INT_CLASS, .idVendor = USB_VENDOR_GENESYS_LOGIC, --- a/drivers/usb/core/hub.h +++ b/drivers/usb/core/hub.h @@ -61,6 +61,7 @@ struct usb_hub { unsigned quiescing:1; unsigned disconnected:1; unsigned in_reset:1; + unsigned quirk_disable_autosuspend:1; unsigned quirk_check_port_auto_suspend:1;