Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1998514rwr; Fri, 21 Apr 2023 02:45:01 -0700 (PDT) X-Google-Smtp-Source: AKy350bIzfUj3J+5sckrXh4GSdIDKXjBH5iFzMUrgsoxt3OI/lTseUR/JdPwSEoYZhJVTqEMhN3m X-Received: by 2002:a17:902:c115:b0:1a8:637:8b17 with SMTP id 21-20020a170902c11500b001a806378b17mr4608900pli.2.1682070300867; Fri, 21 Apr 2023 02:45:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682070300; cv=none; d=google.com; s=arc-20160816; b=ugnBKrCnuks35jeZ0ATlsiIbZ2jc7UFt9yB/mOcevHzvn75yrqaLsZPT8m3XAm1u4A gvEsnbty6rY6netf1yc4mQEe/loLsJxdApeEB+w08A5ViKhL0B7T4m/NAiXxPVgyIso3 c5z4wN87DqAi7pZ80UKecBB8E1+TWBxlrILoE8AhLtsTWCDyb3dbNlr8bPkJ76CUWFKO VueK6Q75Q4KwoMYfIc6jXXjDOSmbndN5L7FN1MHqDbdX4u7g8lFlOvlh5vuiTMhDNBnM OKDnFThJLmuyKFCeUeqwSKI0mN38Ot5bDRPMAEOkg7Ng61tZM7QAA/WZi4c9sjbnIwxS eiOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=z/mFcg1Y39X/cJprabm1Bl6KzBBGGHQfJYFLSZxb+f4=; b=S0LMAP91GdPrBGtWPv1fX8+NMT30iluDtkItwVBVtzah8k/TfXRWzp7AlEs5o0PZvu SSFffC5mLUjAlQom5mfaeml4WTX1gSBrvA+N/MDK6cUh92IV04A8bkkJAvCu8bn7IJws viu8OUYzydlvEotWrVbQNuGZ7UhDtRNrSLobncnnoVqq//hVvvH3zi11qz57unBPAIJH 40ttf7iJkYqQ4FGC8a9fvTK6l+IC/mI6dsM6ES1deDLw+56XqwAsI1xYM4+Ni7DYNR2f I83kUADY5nB5rnWYZvxuaRsg1uHHLWhdhr5mhFbpeL/NKdo1tpiRVRWoQDb1Z7jfqsgt mFIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u8-20020a170902e80800b0019f25dae4f5si1814388plg.198.2023.04.21.02.44.49; Fri, 21 Apr 2023 02:45:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229682AbjDUJly (ORCPT + 99 others); Fri, 21 Apr 2023 05:41:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230450AbjDUJlw (ORCPT ); Fri, 21 Apr 2023 05:41:52 -0400 Received: from mx2.zhaoxin.com (mx2.zhaoxin.com [203.110.167.99]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A19C2AD24 for ; Fri, 21 Apr 2023 02:41:46 -0700 (PDT) X-ASG-Debug-ID: 1682070104-1eb14e6387376d0001-xx1T2L Received: from ZXSHMBX1.zhaoxin.com (ZXSHMBX1.zhaoxin.com [10.28.252.163]) by mx2.zhaoxin.com with ESMTP id sJ8LRkrTU6nIIko7 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Fri, 21 Apr 2023 17:41:44 +0800 (CST) X-Barracuda-Envelope-From: WeitaoWang-oc@zhaoxin.com X-Barracuda-RBL-Trusted-Forwarder: 10.28.252.163 Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) by ZXSHMBX1.zhaoxin.com (10.28.252.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 21 Apr 2023 17:41:43 +0800 Received: from L440.zhaoxin.com (10.29.8.21) by zxbjmbx1.zhaoxin.com (10.29.252.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 21 Apr 2023 17:41:43 +0800 X-Barracuda-RBL-Trusted-Forwarder: 10.28.252.163 From: Weitao Wang X-Barracuda-RBL-Trusted-Forwarder: 10.29.252.163 To: , , , CC: , , Subject: [PATCH v2] UHCI:adjust zhaoxin UHCI controllers OverCurrent bit value Date: Sat, 22 Apr 2023 01:41:42 +0800 X-ASG-Orig-Subj: [PATCH v2] UHCI:adjust zhaoxin UHCI controllers OverCurrent bit value Message-ID: <20230421174142.382602-1-WeitaoWang-oc@zhaoxin.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.29.8.21] X-ClientProxiedBy: zxbjmbx1.zhaoxin.com (10.29.252.163) To zxbjmbx1.zhaoxin.com (10.29.252.163) X-Barracuda-Connect: ZXSHMBX1.zhaoxin.com[10.28.252.163] X-Barracuda-Start-Time: 1682070104 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://10.28.252.36:4443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at zhaoxin.com X-Barracuda-Scan-Msg-Size: 1596 X-Barracuda-BRTS-Status: 1 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0002 1.0000 -2.0198 X-Barracuda-Spam-Score: 1.09 X-Barracuda-Spam-Status: No, SCORE=1.09 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests=DATE_IN_FUTURE_06_12, DATE_IN_FUTURE_06_12_2 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.107717 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.01 DATE_IN_FUTURE_06_12 Date: is 6 to 12 hours after Received: date 3.10 DATE_IN_FUTURE_06_12_2 DATE_IN_FUTURE_06_12_2 X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org OverCurrent condition is not standardized in the UHCI spec. Zhaoxin UHCI controllers report OverCurrent bit active off. In order to handle OverCurrent condition correctly, the uhci-hcd driver needs to be told to expect the active-off behavior. Suggested-by: Alan Stern Cc: stable@vger.kernel.org Signed-off-by: Weitao Wang --- v1->v2 - Modify the description of this patch. - Let Zhaoxin and VIA share a common oc_low flag drivers/usb/host/uhci-pci.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/uhci-pci.c b/drivers/usb/host/uhci-pci.c index 3592f757fe05..034586911bb5 100644 --- a/drivers/usb/host/uhci-pci.c +++ b/drivers/usb/host/uhci-pci.c @@ -119,11 +119,12 @@ static int uhci_pci_init(struct usb_hcd *hcd) uhci->rh_numports = uhci_count_ports(hcd); - /* Intel controllers report the OverCurrent bit active on. - * VIA controllers report it active off, so we'll adjust the - * bit value. (It's not standardized in the UHCI spec.) + /* Intel controllers report the OverCurrent bit active on. VIA + * and ZHAOXIN controllers report it active off, so we'll adjust + * the bit value. (It's not standardized in the UHCI spec.) */ - if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_VIA) + if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_VIA || + to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_ZHAOXIN) uhci->oc_low = 1; /* HP's server management chip requires a longer port reset delay. */ -- 2.32.0