Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp968261rwr; Thu, 20 Apr 2023 08:21:05 -0700 (PDT) X-Google-Smtp-Source: AKy350aIZMDIowdl2ipihw4x14CsOWN43GOZGJTXFtkRhIMm+PRAUpaniCB0YPjZ5Mc1X6F79c5Z X-Received: by 2002:a17:902:c40f:b0:1a6:6edc:c884 with SMTP id k15-20020a170902c40f00b001a66edcc884mr2494173plk.16.1682004065159; Thu, 20 Apr 2023 08:21:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682004065; cv=none; d=google.com; s=arc-20160816; b=hq+vmtLQYRW6Q/TcZ/dZ4FTXLBMoSNSNDU6dLVeLM56nWyZKv5rDYqm4afTXvM1SdP 5Rit7Kdkju8VmjwFHUnsmbBpquFedFf8ExDTWD6NhPe5P2fviHKs4ezqscqkbZQnXK4p SAqf75Sk+EXREERu0FxLo0op/OvgMvdC46ns2OoVMpi3mBoWJCvoFO4yUn6qJeWAsR7+ DalDaQOD2bcchKFfLh3Te/EDU6wIKA1Jl1GEStsy+L014K3HAWXsw40zUmHWZqcevqRv 61JXan45fhKwjjVk0m57x/ox3nQ1CcOHo3wlUZk56vnKPME5MRJKogqctZH1I9/JBuOR xEFg== 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=oLyBYmKjkF6br8ghif0n07rMSjKHunrPZas1d+BhcwY=; b=FOhgHlk9RkYVU5LW+neVjZ6n5yv/bgdYVmbea1LGrq3l1bZrKXzTDDJ90vrtKVIo9d 3bQiPS9eIYHOj7UeGhY5mzdB3cO8J0oRy59IrcFTH+TAZriCzGOQ+6O8F+CQvEgjwRFI 7m/NtAc7c06N1TeovpVkDNw8ZBJSVR7gUMatSEqfU5RqTxUBFTq24OXWMOP0Prw0CaMm zdF3AilIyBuU8ranPWE7S6/ZRY3im8VtES2GRUCh4s5zqfa07V5kEJPcLjHS5PLJXwyz GAxvmJvzxPAbkFKhBUF/kr7Igalg3jSXETl3W5I4Tx3B0wP1FiZmHNzF8s39gTQUv6AN 48SA== 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 y16-20020a170902b49000b0019f359c651esi1813249plr.556.2023.04.20.08.20.38; Thu, 20 Apr 2023 08:21:05 -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 S232490AbjDTOth (ORCPT + 99 others); Thu, 20 Apr 2023 10:49:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230510AbjDTOtf (ORCPT ); Thu, 20 Apr 2023 10:49:35 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 42A4049FA for ; Thu, 20 Apr 2023 07:49:34 -0700 (PDT) Received: (qmail 502434 invoked by uid 1000); 20 Apr 2023 10:49:33 -0400 Date: Thu, 20 Apr 2023 10:49:33 -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 Subject: Re: [PATCH] =?utf-8?B?VUhDSe+8mmFkanVz?= =?utf-8?Q?t?= zhaoxin UHCI controllers OverCurrent bit value Message-ID: <95017e76-d029-4e55-af4f-4c7be0a14576@rowland.harvard.edu> References: <20230420111445.5028-1-WeitaoWang-oc@zhaoxin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230420111445.5028-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 Thu, Apr 20, 2023 at 07:14:45PM +0800, Weitao Wang wrote: > Over Current condition is not standardized in the UHCI spec. > Zhaoxin UHCI controllers report OverCurrent bit active off. > Intel controllers report it active on, so we'll adjust the bit value. The last sentence is irrelevant. You should say instead that the uhci-hcd driver needs to be told to expect the active-off behavior. > > Signed-off-by: Weitao Wang > --- > drivers/usb/host/uhci-pci.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/usb/host/uhci-pci.c b/drivers/usb/host/uhci-pci.c > index 3592f757fe05..177e3c2aa287 100644 > --- a/drivers/usb/host/uhci-pci.c > +++ b/drivers/usb/host/uhci-pci.c > @@ -126,6 +126,10 @@ static int uhci_pci_init(struct usb_hcd *hcd) > if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_VIA) > uhci->oc_low = 1; > > + /* ZHAOXIN controllers report OverCurrent bit active off. */ > + if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_ZHAOXIN) > + uhci->oc_low = 1; This is really just a matter of taste, but IMO it would be better to combine this comment and test with the preceding one. Something like: /* * 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 || to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_ZHAOXIN) uhci->oc_low = 1; Alan Stern