public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ZhenHua <zhen-hual@hp.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] driver,usb: Fix a warning in uhci-hcd driver
Date: Sun, 28 Apr 2013 09:51:06 +0800	[thread overview]
Message-ID: <517C808A.2060502@hp.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1304271111530.30732-100000@netrider.rowland.org>

On 04/27/2013 11:14 PM, Alan Stern wrote:
> On Sat, 27 Apr 2013, ZhenHua wrote:
>
>> On 04/27/2013 12:51 AM, Alan Stern wrote:
>>> On Fri, 26 Apr 2013, ZhenHua wrote:
>>>
>>>> There is a function  wait_for_HP() in uhci-hub.c. In this
>>>> patch, it is used in suspend_rh(),  I think this can be a
>>>> solution. And I have tested this patch, it can fix the bug.
>>>>
>>>> I think there is another patch needed. As Alan said in another
>>>> mail, in the UHCI_RH_RUNNING_NODEVS case, it should not be stopped
>>>> if the uhci device is HP iLo virtual usb.
>>> I believe that if you change the UHCI_RH_RUNNING_NODEVS case, you will
>>> find that this patch (calling wait_for_HP) isn't needed.
>>>
>>> In fact, the patch is so easy that I am including it below.  Please
>>> test this (without either of your patches) to see if it works.
>>>
>>> Alan Stern
>>>
>>>
>>>
>>>
>>> Index: usb-3.9/drivers/usb/host/uhci-hub.c
>>> ===================================================================
>>> --- usb-3.9.orig/drivers/usb/host/uhci-hub.c
>>> +++ usb-3.9/drivers/usb/host/uhci-hub.c
>>> @@ -225,7 +225,8 @@ static int uhci_hub_status_data(struct u
>>>    		/* auto-stop if nothing connected for 1 second */
>>>    		if (any_ports_active(uhci))
>>>    			uhci->rh_state = UHCI_RH_RUNNING;
>>> -		else if (time_after_eq(jiffies, uhci->auto_stop_time))
>>> +		else if (time_after_eq(jiffies, uhci->auto_stop_time) &&
>>> +				!uhci->wait_for_hp)
>>>    			suspend_rh(uhci, UHCI_RH_AUTO_STOPPED);
>>>    		break;
>>>    
>>>
>> I have tested the UHCI_RH_RUNNING_NODEVS case yeasterday, and it works.
>> But the function suspend_rh is also called in other places, so I think
>> it only fixes
>> the warning when auto stop is called, but not fix the warning when
>> uhci's bus_suspend
>> is called,  it will come out again.
> Have you tried this?  I expect the warning will not occur when the
> bus_suspend routine is called, because then there will be a 1-ms delay,
> not just a 400-us delay.
I tested this, and the warning is gone.  Is this patch committed ?
I need to paste the link to suse bugzilla.

>
>> And if you add uhci->wait_for_hp check in the UHCI_RH_RUNNING_NODEVS case,
>> all hp uhci devices will not auto stop, not only the virtual devices. I
>> guess it may waste resource.
> If you want, you can add a new flag specifically for virtual
> controllers.  But it shouldn't matter -- as long as your kernels are
> built with CONFIG_PM_RUNTIME enabled, there won't be any significant
> waste of resources.
>
> Alan Stern
>
I think we can check the product id to determine whether a device is 
virtual.
Do you know if there is another way to check this?

Thanks
Zhen-Hua

  reply	other threads:[~2013-04-28  1:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-26  7:38 [PATCH 1/1] driver,usb: Fix a warning in uhci-hcd driver Li, Zhen-Hua
2013-04-26  7:50 ` ZhenHua
2013-04-26  8:10   ` ZhenHua
2013-04-26 16:51   ` Alan Stern
2013-04-27  0:16     ` ZhenHua
2013-04-27 15:14       ` Alan Stern
2013-04-28  1:51         ` ZhenHua [this message]
2013-04-28 18:55           ` Alan Stern
2013-05-06  1:43             ` Li, Zhen-Hua (USL-China)
  -- strict thread matches above, loose matches on Subject: below --
2013-04-25  7:11 Li, Zhen-Hua
2013-04-25  7:12 ` ZhenHua
2013-04-25 14:33   ` Alan Stern
2013-04-25 14:56     ` Alan Stern
2013-04-23  7:15 Li, Zhen-Hua
2013-04-23 14:07 ` Greg KH
2013-04-23 15:10   ` Alan Stern
2013-04-25  1:22     ` ZhenHua
2013-04-25 14:54       ` Alan Stern
2013-04-26  1:10         ` ZhenHua
2013-04-23 23:55   ` ZhenHua
2013-04-24  1:57     ` Greg KH
2013-04-24  2:05       ` ZhenHua

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=517C808A.2060502@hp.com \
    --to=zhen-hual@hp.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox