lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <95017e76-d029-4e55-af4f-4c7be0a14576@rowland.harvard.edu>
Date:   Thu, 20 Apr 2023 10:49:33 -0400
From:   Alan Stern <stern@...land.harvard.edu>
To:     Weitao Wang <WeitaoWang-oc@...oxin.com>
Cc:     gregkh@...uxfoundation.org, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org, tonywwang@...oxin.com,
        weitaowang@...oxin.com
Subject: Re: [PATCH] UHCI:adjust zhaoxin UHCI
 controllers OverCurrent bit value

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ