From patchwork Tue Apr 11 08:31:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jimmy Hu X-Patchwork-Id: 672601 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E25EDC7619A for ; Tue, 11 Apr 2023 08:31:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230449AbjDKIb4 (ORCPT ); Tue, 11 Apr 2023 04:31:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230416AbjDKIbz (ORCPT ); Tue, 11 Apr 2023 04:31:55 -0400 Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FFF2E71 for ; Tue, 11 Apr 2023 01:31:52 -0700 (PDT) Received: by mail-pl1-x649.google.com with SMTP id j2-20020a170902da8200b001a055243657so4650881plx.19 for ; Tue, 11 Apr 2023 01:31:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1681201912; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=zVZa8iiDBE0PpkMkB5PA8G0RGtm/FlyaCAntJJ2YIOQ=; b=cDpsj3H+xWOEtctnZ6Qbjh9+3xxi7Ck1yT3sgXeq8OXdv/LYwSoAF2ok7JHEU9MGIE QWPiMEMss8w3WDdI/U3+SmaHMoUenmyYDfrJhFI7BvhXb6nmGIt5INhJfCJQBK5JWLI2 2SVkTGP5l3NjUDvy30lev7X7xFCPjx4vzGhOs7u/2qrvkBNx3qqXtAi3F20e763mm4Kb u+PhrsGlqa3AyrNyssOc82S+K1GcVg6WT6ZQACqSt3v9hemy7JRcV5Tiv1EEFl8Ye20S Ct0r0bVSVHaRxwVzMdKT2jslsdPTWeIn9P2idjb9QoanGUpvR7p75eHaZAwHY1+6LR+Q no+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681201912; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=zVZa8iiDBE0PpkMkB5PA8G0RGtm/FlyaCAntJJ2YIOQ=; b=Jhs6hgwHvDxLjSaTXoucdjqymY95iYHZrO7xJhuH590wiOik/HZc4uEGeH7B+vr0eJ cHrFqE0WfhYR0Fy14FLBKw864fGjPfCTITMY4fHk/1y5MOhaqgc5qfhLvU/Xo6D4frVG GPBG4Lxjl8Du6zX24Hmqj2qNHEPgsoCBb08mwbVMPCIUKnERhwT+fhlsJX6Ouorc+0Df OEbmXxX8qlfHa0WqtvIHurUaIUVpeJkioL4EXYgOq/E/RMAikCO9f3m726kl6NEmEVOR RpPzDgt9MUlpU+X6iuAMqGZhbMH7l3TG4cQzAqXCCUeKn8ae/ZHG1r5sdPLuvqekPrZr B6Gg== X-Gm-Message-State: AAQBX9fz/tlbZDR6Jku4CBRBccUzAFhGTSfudLPxk4Mz9O0iipyHPDxI KTIMnpaA+SOEiKPzVXZJcUt1GyLQEpU= X-Google-Smtp-Source: AKy350YoK4eeP0dsaY0OoM4tiioUCEUoT13Uio+p9zFhn+FUM6wEIAYHdArmQZkKcIomtQfA9KVyWVQGRLk= X-Received: from hhhuuu.c.googlers.com ([fda3:e722:ac3:cc00:3:22c1:c0a8:c80]) (user=hhhuuu job=sendgmr) by 2002:a17:90a:72c2:b0:244:9ef4:9a25 with SMTP id l2-20020a17090a72c200b002449ef49a25mr3054772pjk.4.1681201911814; Tue, 11 Apr 2023 01:31:51 -0700 (PDT) Date: Tue, 11 Apr 2023 08:31:45 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.40.0.577.gac1e443424-goog Message-ID: <20230411083145.2214105-1-hhhuuu@google.com> Subject: [PATCH] usb: core: hub: Disable autosuspend for VIA VL813 USB3.0 hub From: Jimmy Hu To: stern@rowland.harvard.edu, gregkh@linuxfoundation.org Cc: badhri@google.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Jimmy Hu , stable@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The VIA VL813 USB3.0 hub appears to have an issue with autosuspend and detecting USB3 devices. This can be reproduced by connecting a USB3 device to the hub after the hub enters autosuspend mode. //connect the hub [ 106.854204] usb 2-1: new SuperSpeed Gen 1 USB device number 2 using xhci-hcd [ 107.084993] usb 2-1: New USB device found, idVendor=2109, idProduct=0813, bcdDevice=90.15 [ 107.094520] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 107.111836] usb 2-1: Product: USB3.0 Hub [ 107.116835] usb 2-1: Manufacturer: VIA Labs, Inc. [ 107.314230] hub 2-1:1.0: USB hub found [ 107.321356] hub 2-1:1.0: 4 ports detected //the hub enters autosuspend mode [ 107.738873] hub 2-1:1.0: hub_suspend [ 107.922097] usb 2-1: usb auto-suspend, wakeup 1 //connect a USB3 device [ 133.120060] usb 2-1: usb wakeup-resume [ 133.160033] usb 2-1: Waited 0ms for CONNECT [ 133.165423] usb 2-1: finish resume [ 133.176919] hub 2-1:1.0: hub_resume [ 133.188026] usb 2-1-port3: status 0263 change 0041 [ 133.323585] hub 2-1:1.0: state 7 ports 4 chg 0008 evt 0008 [ 133.342423] usb 2-1-port3: link state change [ 133.358154] usb 2-1-port3: status 0263, change 0040, 5.0 Gb/s [ 133.875150] usb 2-1-port3: not reset yet, waiting 10ms [ 133.895502] usb 2-1-port3: not reset yet, waiting 10ms [ 133.918239] usb 2-1-port3: not reset yet, waiting 200ms [ 134.139529] usb 2-1-port3: not reset yet, waiting 200ms [ 134.365296] usb 2-1-port3: not reset yet, waiting 200ms [ 134.590185] usb 2-1-port3: not reset yet, waiting 200ms [ 134.641330] hub 2-1:1.0: state 7 ports 4 chg 0000 evt 0008 [ 134.658880] hub 2-1:1.0: hub_suspend [ 134.792908] usb 2-1: usb auto-suspend, wakeup 1 Disabling autosuspend for this hub resolves the issue. Signed-off-by: Jimmy Hu Cc: stable@vger.kernel.org --- drivers/usb/core/hub.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 97a0f8faea6e..5c6455224d9d 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -47,6 +47,8 @@ #define USB_VENDOR_TEXAS_INSTRUMENTS 0x0451 #define USB_PRODUCT_TUSB8041_USB3 0x8140 #define USB_PRODUCT_TUSB8041_USB2 0x8142 +#define USB_VENDOR_VIA 0x2109 +#define USB_PRODUCT_VL813_USB3 0x0813 #define HUB_QUIRK_CHECK_PORT_AUTOSUSPEND 0x01 #define HUB_QUIRK_DISABLE_AUTOSUSPEND 0x02 @@ -5866,6 +5868,11 @@ static const struct usb_device_id hub_id_table[] = { .idVendor = USB_VENDOR_TEXAS_INSTRUMENTS, .idProduct = USB_PRODUCT_TUSB8041_USB3, .driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND}, + { .match_flags = USB_DEVICE_ID_MATCH_VENDOR + | USB_DEVICE_ID_MATCH_PRODUCT, + .idVendor = USB_VENDOR_VIA, + .idProduct = USB_PRODUCT_VL813_USB3, + .driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND}, { .match_flags = USB_DEVICE_ID_MATCH_DEV_CLASS, .bDeviceClass = USB_CLASS_HUB}, { .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS,