* [PATCH] usb: dwc2: resume root hub when device detect with suspend state
@ 2014-11-17 13:14 Kever Yang
2014-11-17 15:21 ` Kever Yang
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Kever Yang @ 2014-11-17 13:14 UTC (permalink / raw)
To: Paul Zimmerman, Felipe Balbi
Cc: Dinh Nguyen, romain.perier, Heiko Stuebner, dianders, sonnyrao,
addy.ke, cf, wulf, huangtao, linux-rockchip, Kever Yang, Roy Li,
Greg Kroah-Hartman, linux-usb, linux-kernel
After we implement the bus_suspend/resume, auto suspend id enabled.
The root hub will be auto suspend if there is no device connected,
we need to resume the root hub when a device connect detect.
This patch tested on rk3288.
Signed-off-by: Roy Li <roy.li@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---
drivers/usb/dwc2/hcd_intr.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c
index 551ba87..c8299fd 100644
--- a/drivers/usb/dwc2/hcd_intr.c
+++ b/drivers/usb/dwc2/hcd_intr.c
@@ -355,6 +355,13 @@ static void dwc2_port_intr(struct dwc2_hsotg *hsotg)
hprt0_modify |= HPRT0_CONNDET;
/*
+ * Check if root hub is in suspend state
+ * if root hub in suspend, resume it.
+ */
+ if ((bus->root_hub) && (hcd->state == HC_STATE_SUSPENDED))
+ usb_hcd_resume_root_hub(hcd);
+
+ /*
* The Hub driver asserts a reset when it sees port connect
* status change flag
*/
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: dwc2: resume root hub when device detect with suspend state
2014-11-17 13:14 [PATCH] usb: dwc2: resume root hub when device detect with suspend state Kever Yang
@ 2014-11-17 15:21 ` Kever Yang
2014-11-17 18:16 ` Sergei Shtylyov
2014-11-17 21:21 ` Julius Werner
2 siblings, 0 replies; 5+ messages in thread
From: Kever Yang @ 2014-11-17 15:21 UTC (permalink / raw)
To: Paul Zimmerman, Felipe Balbi
Cc: Dinh Nguyen, romain.perier, Heiko Stuebner, dianders, sonnyrao,
addy.ke, cf, wulf, huangtao, linux-rockchip, Roy Li,
Greg Kroah-Hartman, linux-usb, linux-kernel
This patch is no complete, Sorry for that, I will upload a new version
tomorrow.
- Kever
On 11/17/2014 09:14 PM, Kever Yang wrote:
> After we implement the bus_suspend/resume, auto suspend id enabled.
> The root hub will be auto suspend if there is no device connected,
> we need to resume the root hub when a device connect detect.
>
> This patch tested on rk3288.
>
> Signed-off-by: Roy Li <roy.li@rock-chips.com>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>
> drivers/usb/dwc2/hcd_intr.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c
> index 551ba87..c8299fd 100644
> --- a/drivers/usb/dwc2/hcd_intr.c
> +++ b/drivers/usb/dwc2/hcd_intr.c
> @@ -355,6 +355,13 @@ static void dwc2_port_intr(struct dwc2_hsotg *hsotg)
> hprt0_modify |= HPRT0_CONNDET;
>
> /*
> + * Check if root hub is in suspend state
> + * if root hub in suspend, resume it.
> + */
> + if ((bus->root_hub) && (hcd->state == HC_STATE_SUSPENDED))
> + usb_hcd_resume_root_hub(hcd);
> +
> + /*
> * The Hub driver asserts a reset when it sees port connect
> * status change flag
> */
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: dwc2: resume root hub when device detect with suspend state
2014-11-17 13:14 [PATCH] usb: dwc2: resume root hub when device detect with suspend state Kever Yang
2014-11-17 15:21 ` Kever Yang
@ 2014-11-17 18:16 ` Sergei Shtylyov
2014-11-17 21:21 ` Julius Werner
2 siblings, 0 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2014-11-17 18:16 UTC (permalink / raw)
To: Kever Yang, Paul Zimmerman, Felipe Balbi
Cc: Dinh Nguyen, romain.perier, Heiko Stuebner, dianders, sonnyrao,
addy.ke, cf, wulf, huangtao, linux-rockchip, Roy Li,
Greg Kroah-Hartman, linux-usb, linux-kernel
Hello.
On 11/17/2014 04:14 PM, Kever Yang wrote:
> After we implement the bus_suspend/resume, auto suspend id enabled.
> The root hub will be auto suspend if there is no device connected,
> we need to resume the root hub when a device connect detect.
> This patch tested on rk3288.
> Signed-off-by: Roy Li <roy.li@rock-chips.com>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
> drivers/usb/dwc2/hcd_intr.c | 7 +++++++
> 1 file changed, 7 insertions(+)
> diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c
> index 551ba87..c8299fd 100644
> --- a/drivers/usb/dwc2/hcd_intr.c
> +++ b/drivers/usb/dwc2/hcd_intr.c
> @@ -355,6 +355,13 @@ static void dwc2_port_intr(struct dwc2_hsotg *hsotg)
> hprt0_modify |= HPRT0_CONNDET;
>
> /*
> + * Check if root hub is in suspend state
> + * if root hub in suspend, resume it.
> + */
> + if ((bus->root_hub) && (hcd->state == HC_STATE_SUSPENDED))
Inner parens are not needed, especially the first ones.
[...]
WBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: dwc2: resume root hub when device detect with suspend state
2014-11-17 13:14 [PATCH] usb: dwc2: resume root hub when device detect with suspend state Kever Yang
2014-11-17 15:21 ` Kever Yang
2014-11-17 18:16 ` Sergei Shtylyov
@ 2014-11-17 21:21 ` Julius Werner
2014-11-18 1:11 ` Kever Yang
2 siblings, 1 reply; 5+ messages in thread
From: Julius Werner @ 2014-11-17 21:21 UTC (permalink / raw)
To: Kever Yang
Cc: Paul Zimmerman, Felipe Balbi, Dinh Nguyen, Romain Perier,
Heiko Stuebner, Douglas Anderson, Sonny Rao, addy ke, Eddie Cai,
wulf, Tao Huang, open list:ARM/Rockchip SoC..., Roy Li,
Greg Kroah-Hartman, linux-usb@vger.kernel.org, LKML
On Mon, Nov 17, 2014 at 5:14 AM, Kever Yang <kever.yang@rock-chips.com> wrote:
> After we implement the bus_suspend/resume, auto suspend id enabled.
> The root hub will be auto suspend if there is no device connected,
> we need to resume the root hub when a device connect detect.
>
> This patch tested on rk3288.
>
> Signed-off-by: Roy Li <roy.li@rock-chips.com>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>
> drivers/usb/dwc2/hcd_intr.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c
> index 551ba87..c8299fd 100644
> --- a/drivers/usb/dwc2/hcd_intr.c
> +++ b/drivers/usb/dwc2/hcd_intr.c
> @@ -355,6 +355,13 @@ static void dwc2_port_intr(struct dwc2_hsotg *hsotg)
> hprt0_modify |= HPRT0_CONNDET;
>
> /*
> + * Check if root hub is in suspend state
> + * if root hub in suspend, resume it.
> + */
> + if ((bus->root_hub) && (hcd->state == HC_STATE_SUSPENDED))
What is bus->root_hub checking for? Is there any chance that this
could be NULL here?
> + usb_hcd_resume_root_hub(hcd);
> +
> + /*
> * The Hub driver asserts a reset when it sees port connect
> * status change flag
> */
> --
> 1.9.1
Seems sensible in general. Does this actually fix the problem Doug was
reporting?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: dwc2: resume root hub when device detect with suspend state
2014-11-17 21:21 ` Julius Werner
@ 2014-11-18 1:11 ` Kever Yang
0 siblings, 0 replies; 5+ messages in thread
From: Kever Yang @ 2014-11-18 1:11 UTC (permalink / raw)
To: Julius Werner
Cc: Paul Zimmerman, Felipe Balbi, Dinh Nguyen, Romain Perier,
Heiko Stuebner, Douglas Anderson, Sonny Rao, addy ke, Eddie Cai,
wulf, Tao Huang, open list:ARM/Rockchip SoC..., Roy Li,
Greg Kroah-Hartman, linux-usb@vger.kernel.org, LKML
Hi Julius,
On 11/18/2014 05:21 AM, Julius Werner wrote:
> On Mon, Nov 17, 2014 at 5:14 AM, Kever Yang <kever.yang@rock-chips.com> wrote:
>> After we implement the bus_suspend/resume, auto suspend id enabled.
>> The root hub will be auto suspend if there is no device connected,
>> we need to resume the root hub when a device connect detect.
>>
>> This patch tested on rk3288.
>>
>> Signed-off-by: Roy Li <roy.li@rock-chips.com>
>> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
>> ---
>>
>> drivers/usb/dwc2/hcd_intr.c | 7 +++++++
>> 1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c
>> index 551ba87..c8299fd 100644
>> --- a/drivers/usb/dwc2/hcd_intr.c
>> +++ b/drivers/usb/dwc2/hcd_intr.c
>> @@ -355,6 +355,13 @@ static void dwc2_port_intr(struct dwc2_hsotg *hsotg)
>> hprt0_modify |= HPRT0_CONNDET;
>>
>> /*
>> + * Check if root hub is in suspend state
>> + * if root hub in suspend, resume it.
>> + */
>> + if ((bus->root_hub) && (hcd->state == HC_STATE_SUSPENDED))
> What is bus->root_hub checking for? Is there any chance that this
> could be NULL here?
I add bus->root_hub check because the _dwc2_hcd_start check this before it
call the usb_hcd_resume_root_hub.
I think we don't need this check for the root_hub must be there if we
register
the HCD success, right?
I will remove this in next version.
>
>> + usb_hcd_resume_root_hub(hcd);
>> +
>> + /*
>> * The Hub driver asserts a reset when it sees port connect
>> * status change flag
>> */
>> --
>> 1.9.1
> Seems sensible in general. Does this actually fix the problem Doug was
> reporting?
Yes, this fix the problem Doug reported with my dwc2 hcd suspend/resume
patch.
- Kever
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-11-18 1:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-17 13:14 [PATCH] usb: dwc2: resume root hub when device detect with suspend state Kever Yang
2014-11-17 15:21 ` Kever Yang
2014-11-17 18:16 ` Sergei Shtylyov
2014-11-17 21:21 ` Julius Werner
2014-11-18 1:11 ` Kever Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox