Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2386492rwr; Fri, 21 Apr 2023 08:12:46 -0700 (PDT) X-Google-Smtp-Source: AKy350bM54qhyAzl6g0T9mVO0mlktBG7H1GeTzI10KDv2a8IK9RT9a+nqfejWk1kMQzdG7+D77Xb X-Received: by 2002:a17:90a:1a01:b0:24b:5ebd:56c3 with SMTP id 1-20020a17090a1a0100b0024b5ebd56c3mr3082006pjk.2.1682089966256; Fri, 21 Apr 2023 08:12:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682089966; cv=none; d=google.com; s=arc-20160816; b=OjrAM+WXzCnbhnRdHzS/dTSFhotfYOz/Zg0Zw+7cQob4CrvfZdoxv2UzrLHpmh4fWR WHWnQpLiulXuB6WjiWr7POziIbWD9b7uEiFiQpatmOJc5k/kBlDvcmNlu5ssZ0ow/Jpr 7uitnkw56Y2XPZ+pKlsDwk5AdiS16QeiqPzGUA2D6dzQrzdMnS2L0388MihmqZ+ty18T fR1x18uakdv50COxAQXcdZO7b+b82HswpuH0Mts8aAd1Zz0jJ66mp5V7catoPUSs/usT VqmoDegqI5wonvp3VIeWwFFCQzbxdgmJw2YnfkJn1SliRksoF5FEJCuda3wwpEpf35HM XAFg== 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=BRCzRBZv8EwYSa4u2jMwhopt4t2X+EsJO7dbX2Lpakk=; b=gfeNUieAaYwZ/oF4ltWFQSY3qyoNrdlyq0M4E21yQMoeo29hvNqfUCyEZul2CvqM+3 OJ2fO4OO00r/rPj5plO9INNfH/an1bm5d5ocOPx8cj4m3eeeLhehMMXjPo1WvNUxs7rz zZMmYARCIqn19kxD5HGmswTlJfeOZrZKF32QEMcOinn9hUmIfwBF3q/2GOmWGRQwW92H fpoIF0ETpmLHqttVHpR91POL+TpaQ7iq/JSCVcD8pexKo0EhTSlSJVIXR8ORmBUdXyaB ngd6gI87RWyBj7lOWiO7m1UpLG5rZaBAzX2cypf+Hll/IAPbQPSJgDwUxB2jMU1367zQ srcQ== 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 my17-20020a17090b4c9100b002474ff0aee3si8042549pjb.150.2023.04.21.08.12.34; Fri, 21 Apr 2023 08:12:46 -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 S232713AbjDUO7r (ORCPT + 99 others); Fri, 21 Apr 2023 10:59:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231910AbjDUO7q (ORCPT ); Fri, 21 Apr 2023 10:59:46 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 268389EF2 for ; Fri, 21 Apr 2023 07:59:42 -0700 (PDT) Received: (qmail 546476 invoked by uid 1000); 21 Apr 2023 10:59:41 -0400 Date: Fri, 21 Apr 2023 10:59:41 -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 v2] UHCI:adjust zhaoxin UHCI controllers OverCurrent bit value Message-ID: References: <20230421174142.382602-1-WeitaoWang-oc@zhaoxin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230421174142.382602-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 Sat, Apr 22, 2023 at 01:41:42AM +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 > --- > 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.) > */ The style we use now for multi-line comments is: /* * Blah blah blah * blah blah blah */ > - 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) The indentation level of the continuation line should be different from the indentation of the statement below. Otherwise it looks like the continuation line is part of the conditional block. Alan Stern > uhci->oc_low = 1; > > /* HP's server management chip requires a longer port reset delay. */ > -- > 2.32.0 >