Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp156954rdb; Thu, 30 Nov 2023 00:49:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtjhCtQJPj1IbSPo66A0xyaLD5xTUlKzzl4evBkj/WDiiCOXKk5eD48l2TGpPrMKawXbH1 X-Received: by 2002:a9d:6a4a:0:b0:6d2:e1fc:f387 with SMTP id h10-20020a9d6a4a000000b006d2e1fcf387mr25929378otn.4.1701334163120; Thu, 30 Nov 2023 00:49:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701334163; cv=none; d=google.com; s=arc-20160816; b=xzHFrCMEm5JaUbQYQeLtK3Prz5THtP8+VXPDwDinVJOA3j0uQy3JFsmyNkR1AZ4Qt6 qDvE0j/3iVe8DW4GWw7Mdlp8uStqtkdOSBoeFebp29dDKjbhuASt3Gu7X4/M057cNwiU qUYswur2Vxky4cQw4IxSj8Epy2xPfHCeEPP3QGrNrZhNOGI6E0xU/2MzdoaVMQXPmeif 0/aX8KP5SWj6dwsetrJ8Zr/LhZ8pjZvsq0N0MyxKE1OZH+L1iAYcUaH6dg9S+b3o7D7V XzIBFJc1XfTGjwo9nAN9pase6UvVwPbeW1+boRaICFQ4Dsk9PSO8aZMrzkRae0yRWl+X Xycw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=0LiCBnUAdSdhncbOcxvX73ZZaS7RU2OC6SyWSid3Em4=; fh=4g3cd4RM+YweIDbfrjYz4rUwslbbBUIy1rrG5jFTReQ=; b=k0u9w7dFG58KB9CR4JvAaOGx9Cl2WjeXfxZuv3+Za7oCT7ilenrbF4HC/KTep01rFc cR9iTNFO/1UlYQ5iq+VAeRGIFyBnzRmsgRbVjdkWgE2zUbphMUFrCDOI2ssw/FtI15kd 6VI94R20v5hWlmpVSKKqLNIHh3RqU98Gxp7CETENlOG5L3rX3eXdWs3l0xlnGVig4atG ZkK6iSZ44EWezP+F7li+2YDDfIcl447skU+bQOiRBi+f2DYrJS9bCPKGdeJ9Dd03yWXs TNO8ddpegRiwOdnJe2YJXlEa6+8DyKXLWZCsGppPqJyxzUBBdY14p7DU3o9sYgLD0SrP qVuA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id x13-20020a63fe4d000000b005c1cd1ba05csi803131pgj.240.2023.11.30.00.49.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 00:49:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 5C0BA802F948; Thu, 30 Nov 2023 00:49:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229710AbjK3ItG (ORCPT + 99 others); Thu, 30 Nov 2023 03:49:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231728AbjK3ItF (ORCPT ); Thu, 30 Nov 2023 03:49:05 -0500 Received: from hi1smtp01.de.adit-jv.com (smtp1.de.adit-jv.com [93.241.18.167]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86B3AB9; Thu, 30 Nov 2023 00:49:10 -0800 (PST) Received: from hi2exch02.adit-jv.com (hi2exch02.adit-jv.com [10.72.92.28]) by hi1smtp01.de.adit-jv.com (Postfix) with ESMTP id 82A6E520115; Thu, 30 Nov 2023 09:49:08 +0100 (CET) Received: from vmlxhi-118.adit-jv.com (10.72.93.77) by hi2exch02.adit-jv.com (10.72.92.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Thu, 30 Nov 2023 09:49:08 +0100 From: Hardik Gajjar To: , , CC: , , , , , , Subject: [PATCH v2] usb: hub: Add quirk to decrease IN-ep poll interval for Microchip USB491x hub Date: Thu, 30 Nov 2023 09:48:55 +0100 Message-ID: <20231130084855.119937-1-hgajjar@de.adit-jv.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.72.93.77] X-ClientProxiedBy: hi2exch02.adit-jv.com (10.72.92.28) To hi2exch02.adit-jv.com (10.72.92.28) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 30 Nov 2023 00:49:20 -0800 (PST) There is a potential delay in notifying Linux USB drivers of downstream USB bus activity when connecting a high-speed or superSpeed device via the Microchip USB491x hub. This delay is due to the fixed bInterval value of 12 in the silicon of the Microchip USB491x hub. Microchip requested to ignore the device descriptor and decrease that value to 9 as it was too late to modify that in silicon. This patch speeds up the USB enummeration process that helps to pass Apple Carplay certifications and improve the User experience when utilizing the USB device via Microchip Multihost USB491x Hub. A new hub quirk HUB_QUIRK_REDUCE_FRAME_INTR_BINTERVAL speeds up the notification process for Microchip USB491x hub by limiting the maximum bInterval value to 9. Signed-off-by: Hardik Gajjar --- changes since version 1: - Move implementation from config.c and quirk.c to hub.c as this is hub specific changes. - Improve commit message. - Link to v1 - https://lore.kernel.org/all/20231123081948.58776-1-hgajjar@de.adit-jv.com/ --- drivers/usb/core/hub.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index b4584a0cd484..3d26d942fcae 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -47,12 +47,18 @@ #define USB_VENDOR_TEXAS_INSTRUMENTS 0x0451 #define USB_PRODUCT_TUSB8041_USB3 0x8140 #define USB_PRODUCT_TUSB8041_USB2 0x8142 +#define USB_VENDOR_MICROCHIP 0x0424 +#define USB_PRODUCT_USB4913 0x4913 +#define USB_PRODUCT_USB4914 0x4914 +#define USB_PRODUCT_USB4915 0x4915 #define HUB_QUIRK_CHECK_PORT_AUTOSUSPEND 0x01 #define HUB_QUIRK_DISABLE_AUTOSUSPEND 0x02 +#define HUB_QUIRK_REDUCE_FRAME_INTR_BINTERVAL 0x08 #define USB_TP_TRANSMISSION_DELAY 40 /* ns */ #define USB_TP_TRANSMISSION_DELAY_MAX 65535 /* ns */ #define USB_PING_RESPONSE_TIME 400 /* ns */ +#define USB_REDUCE_FRAME_INTR_BINTERVAL 9 /* Protect struct usb_device->state and ->children members * Note: Both are also protected by ->dev.sem, except that ->state can @@ -1927,6 +1933,12 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) usb_autopm_get_interface_no_resume(intf); } + if ((id->driver_info & HUB_QUIRK_REDUCE_FRAME_INTR_BINTERVAL) && + desc->endpoint[0].desc.bInterval > USB_REDUCE_FRAME_INTR_BINTERVAL) { + desc->endpoint[0].desc.bInterval = + USB_REDUCE_FRAME_INTR_BINTERVAL; + } + if (hub_configure(hub, &desc->endpoint[0].desc) >= 0) { onboard_hub_create_pdevs(hdev, &hub->onboard_hub_devs); @@ -5918,6 +5930,21 @@ 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_MICROCHIP, + .idProduct = USB_PRODUCT_USB4913, + .driver_info = HUB_QUIRK_REDUCE_FRAME_INTR_BINTERVAL}, + { .match_flags = USB_DEVICE_ID_MATCH_VENDOR + | USB_DEVICE_ID_MATCH_PRODUCT, + .idVendor = USB_VENDOR_MICROCHIP, + .idProduct = USB_PRODUCT_USB4914, + .driver_info = HUB_QUIRK_REDUCE_FRAME_INTR_BINTERVAL}, + { .match_flags = USB_DEVICE_ID_MATCH_VENDOR + | USB_DEVICE_ID_MATCH_PRODUCT, + .idVendor = USB_VENDOR_MICROCHIP, + .idProduct = USB_PRODUCT_USB4915, + .driver_info = HUB_QUIRK_REDUCE_FRAME_INTR_BINTERVAL}, { .match_flags = USB_DEVICE_ID_MATCH_DEV_CLASS, .bDeviceClass = USB_CLASS_HUB}, { .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS, -- 2.17.1