Message ID | 20230420111445.5028-1-WeitaoWang-oc@zhaoxin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp42131vqo; Wed, 19 Apr 2023 20:25:05 -0700 (PDT) X-Google-Smtp-Source: AKy350be1QFwjRtxNiSRK8fc/w4JkpbT5fUO7uIJqMXGnbA9NlxXBTwaI0A+Wkp3vTd0XZBVu6JM X-Received: by 2002:a17:902:c951:b0:1a9:317a:dab6 with SMTP id i17-20020a170902c95100b001a9317adab6mr461265pla.31.1681961104866; Wed, 19 Apr 2023 20:25:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681961104; cv=none; d=google.com; s=arc-20160816; b=BIeHwrx3Pb86+CGoL7sZDeFjiLYHPQ0qTu95c0sBWWzpHmCq0cDu57xYbzKiAly6kE IczB4bwwpUnB9isGip4/ql2pWsk8UlDsbvYQh9HXiiKc+k6DaRglIDuq1unZGZ1jjD8V EWCCAtb19npuxkPp9JjZBtDA5FExT9klBBmROn28pzqFyalNiqJABWQ5/aRoO4DT49Z5 jvyVa+vQPhbyRIh2HeBamBODiSPbQQdmZZiqkSJ8f5LxYrEQl91DQRqK3vZTM+EpHWVk jLadjsFXOUloo/kMKB74e/riZBdFpXfv1EMLKyOw//ojpNc8VmCt/rmbHy5ANcTPIlAu gc+w== 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=kZbaMjcPAbr+B/KjnM2do1QFv/cAfFwpA3JKSWyuwCY=; b=ceqDvrt6Mw/fpO7ZC/mTyQgGwb2Q1Ox4zfNb/LiGg7r+bwcEh+FiYFP9e5J/8ny/SL zCy2LaYTy51H8mAoZ4FPXof3GTVTwwhubpkWsJi7xdbEs7kmip65YOZ0ajDX9l1VnEGh bms/RlIwk1C2l+L7EF/uNOlIhqwJu+hKDLesAUCFzMb8rAEtsoCCUnKYwYupLB0bSgc5 FFTZ9iJ1kkmUl6eU3vxRkeynFkmQsWCAYJmARqFyaw+yTer7bdG9WEhdDTBymoXBQ1vT xqZ3UZDGyAocJmG6HHswzmHkZZTAxLU2/7QHOnG1qpqxfj+FrTr1JIIYnZ06sKzNsWN1 EcpQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y2-20020a17090264c200b001a6f0e81eccsi594166pli.233.2023.04.19.20.24.48; Wed, 19 Apr 2023 20:25:04 -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 S232414AbjDTDPA (ORCPT <rfc822;peter110.wang@gmail.com> + 99 others); Wed, 19 Apr 2023 23:15:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232367AbjDTDOv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 19 Apr 2023 23:14:51 -0400 Received: from mx2.zhaoxin.com (mx2.zhaoxin.com [203.110.167.99]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA9182103 for <linux-kernel@vger.kernel.org>; Wed, 19 Apr 2023 20:14:49 -0700 (PDT) X-ASG-Debug-ID: 1681960486-1eb14e63872b340001-xx1T2L Received: from ZXSHMBX2.zhaoxin.com (ZXSHMBX2.zhaoxin.com [10.28.252.164]) by mx2.zhaoxin.com with ESMTP id KWBNUDq3hfWgjigh (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 20 Apr 2023 11:14:46 +0800 (CST) X-Barracuda-Envelope-From: WeitaoWang-oc@zhaoxin.com X-Barracuda-RBL-Trusted-Forwarder: 10.28.252.164 Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) by ZXSHMBX2.zhaoxin.com (10.28.252.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 20 Apr 2023 11:14:46 +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; Thu, 20 Apr 2023 11:14:46 +0800 X-Barracuda-RBL-Trusted-Forwarder: 10.28.252.164 From: Weitao Wang <WeitaoWang-oc@zhaoxin.com> X-Barracuda-RBL-Trusted-Forwarder: 10.29.252.163 To: <stern@rowland.harvard.edu>, <gregkh@linuxfoundation.org>, <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org> CC: <tonywwang@zhaoxin.com>, <weitaowang@zhaoxin.com> Subject: [PATCH] =?utf-8?q?UHCI=EF=BC=9Aadjust_zhaoxin_UHCI_controllers_Over?= =?utf-8?q?Current_bit_value?= Date: Thu, 20 Apr 2023 19:14:45 +0800 X-ASG-Orig-Subj: [PATCH] =?utf-8?q?UHCI=EF=BC=9Aadjust_zhaoxin_UHCI_controll?= =?utf-8?q?ers_OverCurrent_bit_value?= Message-ID: <20230420111445.5028-1-WeitaoWang-oc@zhaoxin.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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: ZXSHMBX2.zhaoxin.com[10.28.252.164] X-Barracuda-Start-Time: 1681960486 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: 1007 X-Barracuda-BRTS-Status: 1 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0103 1.0000 -1.9535 X-Barracuda-Spam-Score: 1.16 X-Barracuda-Spam-Status: No, SCORE=1.16 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.107661 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763664047070737799?= X-GMAIL-MSGID: =?utf-8?q?1763664047070737799?= |
Series |
UHCI:adjust zhaoxin UHCI controllers OverCurrent bit value
|
|
Commit Message
Weitao Wang
April 20, 2023, 11:14 a.m. UTC
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.
Signed-off-by: Weitao Wang <WeitaoWang-oc@zhaoxin.com>
---
drivers/usb/host/uhci-pci.c | 4 ++++
1 file changed, 4 insertions(+)
Comments
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. > > Signed-off-by: Weitao Wang <WeitaoWang-oc@zhaoxin.com> Note, your Subject: line has odd characters in it, can you rewrite it to just use ascii? I think it's the ':' character which should be ':', right? > --- > 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 should also go to the stable kernels, right? But a new UHCI controller? And this affects all of them? And why is Intel an issue here (as you mention in the changelog text)? thanks, greg k-h
On Fri, Apr 21, 2023 at 01:14:46AM +0800, WeitaoWang-oc@zhaoxin.com wrote: > On 2023/4/20 16:05, Greg KH wrote: > > 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. > > > > > > Signed-off-by: Weitao Wang <WeitaoWang-oc@zhaoxin.com> > > > > Note, your Subject: line has odd characters in it, can you rewrite it to > > just use ascii? I think it's the ':' character which should be ':', > > right?Yes,you are right. it's my typo mistake. I'll rewrite this patch. Thanks! > > > > --- > > > 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 should also go to the stable kernels, right? > > > > But a new UHCI controller? And this affects all of them? > All UHCI controller of zhaoxin have this issue, And Hope this > patch go to stable kernel.Could I resubmit this patch with > modify subject typo mistake? Yes, please do so and add the needed cc: stable as is documented https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html thanks, greg k-h
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 <WeitaoWang-oc@zhaoxin.com> > --- > 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
On 2023/4/20 16:05, Greg KH wrote: > 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. >> >> Signed-off-by: Weitao Wang <WeitaoWang-oc@zhaoxin.com> > > Note, your Subject: line has odd characters in it, can you rewrite it to > just use ascii? I think it's the ':' character which should be ':', > right?Yes,you are right. it's my typo mistake. I'll rewrite this patch. Thanks! >> --- >> 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 should also go to the stable kernels, right? > > But a new UHCI controller? And this affects all of them? All UHCI controller of zhaoxin have this issue, And Hope this patch go to stable kernel.Could I resubmit this patch with modify subject typo mistake? > Intel an issue here (as you mention in the changelog text)? > I got this info from uhci driver comments in function uhci_pci_init. "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.)" Best Regards, weitao > thanks, > > greg k-h > .
On 2023/4/20 22:49, Alan Stern wrote: > 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. Okay, I'll change this description.Thanks! >> >> Signed-off-by: Weitao Wang <WeitaoWang-oc@zhaoxin.com> >> --- >> 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: This advice is good and the code looks more concise. I'll change these code and description in next patch version. Thanks, Weitao > /* > * 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 > .
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; + /* HP's server management chip requires a longer port reset delay. */ if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_HP) uhci->wait_for_hp = 1;