linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dinh Nguyen <dinguyen@opensource.altera.com>
To: Paul Zimmerman <Paul.Zimmerman@synopsys.com>,
	Kever Yang <kever.yang@rock-chips.com>,
	Doug Anderson <dianders@chromium.org>
Cc: Felipe Balbi <balbi@ti.com>,
	"romain.perier@gmail.com" <romain.perier@gmail.com>,
	Heiko Stuebner <heiko@sntech.de>,
	Sonny Rao <sonnyrao@chromium.org>,
	Addy Ke <addy.ke@rock-chips.com>, Eddie Cai <cf@rock-chips.com>,
	lyz <lyz@rock-chips.com>, wulf <wulf@rock-chips.com>,
	Tao Huang <huangtao@rock-chips.com>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"jwerner@chromium.org" <jwerner@chromium.org>
Subject: Re: [PATCH v3] usb: dwc2: add bus suspend/resume for dwc2
Date: Wed, 7 Jan 2015 11:14:41 -0600	[thread overview]
Message-ID: <54AD6981.2030308@opensource.altera.com> (raw)
In-Reply-To: <A2CA0424C0A6F04399FB9E1CD98E030484505A12@US01WEMBX2.internal.synopsys.com>

On 01/05/2015 09:02 PM, Paul Zimmerman wrote:
>> From: Kever Yang [mailto:kever.yang@rock-chips.com]
>> Sent: Monday, January 05, 2015 5:42 PM
>>
>> Hi Paul,
>>
>> I think you need this patch to fix the problem:
>>
>> usb: dwc2: resume root hub when device detect with suspend state
>> https://patchwork.kernel.org/patch/5325111/

This patch may have fixed hotplug when a device is connected directly to
the USB port, but it does not seem to fix a hotplug when a device is
connected to a hub.

I booted the board up with a device connected to a 4-port hub, the
device is detected, unplug the device from a hub, wait 5-sec, re-plug
the device into hub. The device is not detected.

>>
>> Thanks,
>>
>> - Kever
>> On 01/06/2015 09:23 AM, Paul Zimmerman wrote:
>>>> From: Kever Yang [mailto:kever.yang@rock-chips.com]
>>>> Sent: Wednesday, November 12, 2014 4:42 PM
>>>>
>>>> On 11/13/2014 07:22 AM, Doug Anderson wrote:
>>>>> Kever,
>>>>>
>>>>> On Mon, Nov 10, 2014 at 5:09 AM, Kever Yang <kever.yang@rock-chips.com> wrote:
>>>>>> Hcd controller needs bus_suspend/resume, dwc2 controller make
>>>>>> root hub generate suspend/resume signal with hprt0 register
>>>>>> when work in host mode.
>>>>>> After the root hub enter suspend, we can make controller enter
>>>>>> low power state with PCGCTL register.
>>>>>>
>>>>>> We also update the lx_state for hsotg state.
>>>>>>
>>>>>> This patch has tested on rk3288 with suspend/resume.
>>>>>>
>>>>>> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
>>>>>> Acked-by: Paul Zimmerman <paulz@synopsys.com>
>>>>>> ---
>>>>>>
>>>>>> Changes in v3:
>>>>>> - remove CONFIG_PM macro for bus_suspend/resume
>>>>>> - add PCGCTL operation for no device connect case
>>>>>>
>>>>>> Changes in v2:
>>>>>> - update commit message
>>>>>> - make dwc2 suspend/resume sourcecode work
>>>>>>
>>>>>>    drivers/usb/dwc2/hcd.c | 88 +++++++++++++++++++++++++++++++++++++++++++-------
>>>>>>    1 file changed, 77 insertions(+), 11 deletions(-)
>>>>> I would certainly appreciate confirmation, but my inclination is to
>>>>> NAK this change due to the fact that it regresses functionality.  I
>>>>> haven't done any serious review of it, but I've been testing it and it
>>>>> appears to break hotplug.
>>>>>
>>>>> Said another way, I did this:
>>>>>
>>>>> 1. Without this patch, I booted with a USB stick in.  It was detected.
>>>>> I unplugged it, waited 5 seconds, and then plugged it back in.  The
>>>>> USB stick was redetcted.
>>>>>
>>>>> 2. With this patch, I did the same thing.  The USB not redected after
>>>>> plugging it back in.
>>>> With this patch, the dwc2 hcd/root hub will be auto suspend after device
>>>> on port is disconnected, and it can't detect the device connect any more,
>>>> I think that's the problem.
>>>>
>>>> I will figure out how to make dwc2 detect the device connect after auto
>>>> suspend,
>>>> or disable the auto suspend feature for the dwc2 hcd.
>>> Kever,
>>>
>>> This patch has made it into Linus' kernel as commit 0cf884e819e0, and
>>> it breaks disconnect/connect on at least the Altera SOCFPGA platform.
>>> I haven't been able to test it on any other platforms.
>>>
>>> You need to submit a patch to either fix this, or to only enable this
>>> feature for the Rock-chip platform. Otherwise the patch has to be
>>> reverted.
> 
> Unfortunately, after applying that patch there is another problem. If I
> connect a device that causes an overcurrent condition to the root port,
> then the port is dead after that. No further devices are detected until
> after I reboot.
> 
> I tried adding another call to usb_hcd_resume_root_hub() in the
> "if (hprt0 & HPRT0_OVRCURRCHG)" branch, but then an overcurrent
> condition causes a continuous stream of these messages:
> 
> [  133.348776] dwc2 ffb40000.usb: GetPortStatus wIndex=0x0001 flags=0x00000022
> [  133.355717] dwc2 ffb40000.usb: Overcurrent change detected
> [  133.361179] dwc2 ffb40000.usb:   HPRT0: 0x00020000
> [  133.365960] dwc2 ffb40000.usb: port_status=00080000
> [  133.373236] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0000
> [  133.380038] hub 1-0:1.0: hub_suspend
> [  133.384237] usb usb1: bus auto-suspend, wakeup 1
> [  133.393631] dwc2 ffb40000.usb: DWC OTG HCD HUB STATUS DATA: Root port status changed
> [  133.401341] dwc2 ffb40000.usb:   port_connect_status_change: 0
> [  133.407157] dwc2 ffb40000.usb:   port_reset_change: 0
> [  133.412186] dwc2 ffb40000.usb:   port_enable_change: 0
> [  133.417310] dwc2 ffb40000.usb:   port_suspend_change: 0
> [  133.422519] dwc2 ffb40000.usb:   port_over_current_change: 1
> [  133.428154] usb usb1: suspend raced with wakeup event
> [  133.433191] usb usb1: usb auto-resume
> [  133.441522] hub 1-0:1.0: hub_resume
> [  133.455505] dwc2 ffb40000.usb: GetPortStatus wIndex=0x0001 flags=0x00000022
> [  133.462443] dwc2 ffb40000.usb: Overcurrent change detected
> [  133.467907] dwc2 ffb40000.usb:   HPRT0: 0x00020000
> [  133.472684] dwc2 ffb40000.usb: port_status=00080000
> [  133.480088] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0000
> [  133.485578] hub 1-0:1.0: hub_suspend
> [  133.489157] usb usb1: bus auto-suspend, wakeup 1
> [  133.493768] dwc2 ffb40000.usb: _dwc2_hcd_suspend()
> [  133.498540] dwc2 ffb40000.usb: DWC OTG HCD HUB STATUS DATA: Root port status changed
> [  133.506257] dwc2 ffb40000.usb:   port_connect_status_change: 0
> [  133.512065] dwc2 ffb40000.usb:   port_reset_change: 0
> [  133.517102] dwc2 ffb40000.usb:   port_enable_change: 0
> [  133.522218] dwc2 ffb40000.usb:   port_suspend_change: 0
> [  133.527428] dwc2 ffb40000.usb:   port_over_current_change: 1
> [  133.533069] usb usb1: suspend raced with wakeup event
> [  133.538098] usb usb1: usb auto-resume
> [  133.546439] hub 1-0:1.0: hub_resume
> 
> Any ideas?
> 

Dinh

  reply	other threads:[~2015-01-07 17:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-10 13:09 [PATCH v3] usb: dwc2: add bus suspend/resume for dwc2 Kever Yang
2014-11-12 23:22 ` Doug Anderson
2014-11-13  0:42   ` Kever Yang
2014-11-14  4:49     ` Julius Werner
2014-11-14 15:55       ` Alan Stern
2014-11-17 14:25         ` Kever Yang
2014-11-14 20:17       ` Paul Zimmerman
2015-01-06  1:23     ` Paul Zimmerman
2015-01-06  1:42       ` Kever Yang
2015-01-06  3:02         ` Paul Zimmerman
2015-01-07 17:14           ` Dinh Nguyen [this message]
2015-01-06  3:12       ` What are these weird line-noise signatures? Jeff Epler
2015-01-06  3:19         ` Peter Hurley
2015-01-06 13:15           ` Jeff Epler

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=54AD6981.2030308@opensource.altera.com \
    --to=dinguyen@opensource.altera.com \
    --cc=Paul.Zimmerman@synopsys.com \
    --cc=addy.ke@rock-chips.com \
    --cc=balbi@ti.com \
    --cc=cf@rock-chips.com \
    --cc=dianders@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=huangtao@rock-chips.com \
    --cc=jwerner@chromium.org \
    --cc=kever.yang@rock-chips.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lyz@rock-chips.com \
    --cc=romain.perier@gmail.com \
    --cc=sonnyrao@chromium.org \
    --cc=wulf@rock-chips.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;
as well as URLs for NNTP newsgroup(s).