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] [day] [month] [year] [list]
Message-ID: <545ADA1D.1000800@linux.intel.com>
Date:	Thu, 06 Nov 2014 10:17:01 +0800
From:	"Lu, Baolu" <baolu.lu@...ux.intel.com>
To:	Alan Stern <stern@...land.harvard.edu>
CC:	Mathias Nyman <mathias.nyman@...el.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/3] usb: xhci: This reworks ff8cbf250b448aac35589f6075082c3fcad8a8fe


On 11/6/2014 5:24 AM, Alan Stern wrote:
> On Wed, 5 Nov 2014, Lu Baolu wrote:
>
>> xhci: clear root port wake on bits if controller isn't allowed to do wakeup
>>
>> When system is being suspended, if host device is not allowed to do wakeup,
>> xhci_suspend() needs to clear all root port wake on bits. Otherwise, some
>> platforms may generate spurious wakeup, even if PCI PME# is disabled.
>>
>> Signed-off-by: Lu Baolu <baolu.lu@...ux.intel.com>
>> Suggested-by: Alan Stern <stern@...land.harvard.edu>
> This looks pretty good now.
>
>> +static void xhci_disable_port_wake_on_bits(struct xhci_hcd *xhci)
>> +{
>> +	int port_index;
>> +	__le32 __iomem **port_array;
>> +	unsigned long flags;
>> +	u32 t1, t2;
>> +
>> +	spin_lock_irqsave(&xhci->lock, flags);
>> +
>> +	/* disble usb3 ports Wake bits*/
>> +	port_index = xhci->num_usb3_ports;
>> +	port_array = xhci->usb3_ports;
>> +	while (port_index--) {
>> +		t1 = readl(port_array[port_index]);
>> +		t2 = xhci_port_state_to_neutral(t1);
>> +		t2 &= ~PORT_WAKE_BITS;
>> +		t1 = xhci_port_state_to_neutral(t1);
>> +		if (t1 != t2)
>> +			writel(t2, port_array[port_index]);
> Why not just do:
>
> 		t1 = readl(port_array[port_index]);
> 		t1 = xhci_port_state_to_neutral(t1);
> 		t2 = t1 & ~PORT_WAKE_BITS;
> 		if (t1 != t2) ...
Right, this looks better. I will test and resend the patches with this 
change.

>
> Apart from that minor point,
>
> Acked-by: Alan Stern <stern@...land.harvard.edu>
>
> Alan Stern
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ