All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lu, Baolu" <baolu.lu@linux.intel.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Mathias Nyman <mathias.nyman@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/3] usb: xhci: This reworks ff8cbf250b448aac35589f6075082c3fcad8a8fe
Date: Thu, 06 Nov 2014 10:17:01 +0800	[thread overview]
Message-ID: <545ADA1D.1000800@linux.intel.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1411051621280.1531-100000@iolanthe.rowland.org>


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@linux.intel.com>
>> Suggested-by: Alan Stern <stern@rowland.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@rowland.harvard.edu>
>
> Alan Stern
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2014-11-06  2:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-05  5:07 [PATCH v3 0/3] Rework "xhci: clear root port wake on bits if controller isn't wake-up capable" Lu Baolu
2014-11-05  5:07 ` [PATCH v3 1/3] usb: xhci: Revert " Lu Baolu
2014-11-05  5:07 ` [PATCH v3 2/3] usb: xhci: This reworks ff8cbf250b448aac35589f6075082c3fcad8a8fe Lu Baolu
2014-11-05 21:24   ` Alan Stern
2014-11-06  2:17     ` Lu, Baolu [this message]
2014-11-05  5:07 ` [PATCH v3 3/3] usb: xhci: fix comment for PORT_DEV_REMOVE Lu Baolu

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=545ADA1D.1000800@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=stern@rowland.harvard.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.