Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4756558rwr; Sun, 23 Apr 2023 12:32:44 -0700 (PDT) X-Google-Smtp-Source: AKy350a81jTV5VmqzS32hTFbBRajC5BurZXlIQ4thPHAt2nV5bVfiMbIXC5l0JAHIxNsfhQhi+Uw X-Received: by 2002:a05:6a00:15c1:b0:63d:24c0:1223 with SMTP id o1-20020a056a0015c100b0063d24c01223mr16871698pfu.29.1682278364413; Sun, 23 Apr 2023 12:32:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682278364; cv=none; d=google.com; s=arc-20160816; b=yW/pg1doPVssHdTo/9mV5ZPBtWETt22j8nAPHnn+WL+eSYj83yaCvscr4IqPdCkq2Y +DW9lhhuMJdvsPZQ7noETeh+TIxJwelzQUvdnNN2S8dcYEYCDIHc+IssBVRz5Qx7Ce6C GrSLAPfFnZfXKvhqKzTSB9gRKxsRb62+8qrSbW4DpDC2SbY9HoywXHCfeXHks+W8S3WE a4nQ1easroHr8a9T1WvHhr/oVxbDib2IEcV/MbAaA+2Gwa9LWkvQb//mNRXaO/grxVAL v46yQ8blNBdE2+nuLjJXgpFdvz75MItcdK00/AV967Sv2iBAcRAcDiRLW5HP+/iNQamG E88A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Tyibt0pAj1nywAd8hApdn6UbUnqJGzNluMg1dnCmaiU=; b=YT8n6iXnloOB1jopL7XHnctR30bYWMYbopCyiRwCWXjaU3WYCMRRDObTVmOrn+YzYt k1Wg6Nest+YJDxqAJ3L9JILhywqY2H2uPs89XyB4L+28p9vlPSYhzns6vbMvpi1blja4 D8nzlWE3C9CMkktMg5Hqmyx1rG/ksqwL3IkISrfqC9GvmbYmH++q/MWi7fTmrEb9bTrr aKq1goV3/WsuM6bBdTNKW1Squq2vlZZhQI6OLJ9Pp0X2x1qoCbfnH4MQTCgkWwe8frRr cfzhvbYzEi7LwBxflM9LwmvBshE0gP0Q+EyEgHENXt84L9ep5LIqpaDQyZSsL7dVjg3t yy3g== 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 r29-20020aa7963d000000b0063f18073138si7509335pfg.99.2023.04.23.12.32.31; Sun, 23 Apr 2023 12:32:44 -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 S229709AbjDWTOn (ORCPT + 99 others); Sun, 23 Apr 2023 15:14:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjDWTOm (ORCPT ); Sun, 23 Apr 2023 15:14:42 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 8A56E10E4 for ; Sun, 23 Apr 2023 12:14:40 -0700 (PDT) Received: (qmail 6389 invoked by uid 1000); 23 Apr 2023 14:14:38 -0400 Date: Sun, 23 Apr 2023 14:14:38 -0400 From: Alan Stern To: Weitao Wang Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, tonywwang@zhaoxin.com, weitaowang@zhaoxin.com, stable@vger.kernel.org Subject: Re: [PATCH v3] UHCI:adjust zhaoxin UHCI controllers OverCurrent bit value Message-ID: <75fa0424-d0e5-4d7d-a553-55f11218f960@rowland.harvard.edu> References: <20230423105952.4526-1-WeitaoWang-oc@zhaoxin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230423105952.4526-1-WeitaoWang-oc@zhaoxin.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 On Sun, Apr 23, 2023 at 06:59:52PM +0800, Weitao Wang wrote: > 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 > --- > v2->v3 > - Change patch code style. > > drivers/usb/host/uhci-pci.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/usb/host/uhci-pci.c b/drivers/usb/host/uhci-pci.c > index 3592f757fe05..7bd2fddde770 100644 > --- a/drivers/usb/host/uhci-pci.c > +++ b/drivers/usb/host/uhci-pci.c > @@ -119,11 +119,13 @@ 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. */ Acked-by: Alan Stern