mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "WeitaoWang-oc@zhaoxin.com" <WeitaoWang-oc@zhaoxin.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: <gregkh@linuxfoundation.org>, <linux-usb@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <tonywwang@zhaoxin.com>,
	<weitaowang@zhaoxin.com>
Subject: Re: [PATCH] UHCI:adjust zhaoxin UHCI controllers OverCurrent bit value
Date: Fri, 21 Apr 2023 18:59:18 +0800	[thread overview]
Message-ID: <295cbf2a-8ba5-765b-4c07-25efc08fc47b@zhaoxin.com> (raw)
In-Reply-To: <95017e76-d029-4e55-af4f-4c7be0a14576@rowland.harvard.edu>

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
> .

      reply	other threads:[~2023-04-21  3:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-20 11:14 Weitao Wang
2023-04-20  8:05 ` Greg KH
2023-04-20 17:14   ` WeitaoWang-oc
2023-04-20  9:23     ` Greg KH
2023-04-20 14:49 ` Alan Stern
2023-04-21 10:59   ` WeitaoWang-oc [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=295cbf2a-8ba5-765b-4c07-25efc08fc47b@zhaoxin.com \
    --to=weitaowang-oc@zhaoxin.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=tonywwang@zhaoxin.com \
    --cc=weitaowang@zhaoxin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®