All of lore.kernel.org
 help / color / mirror / Atom feed
* [v3,4/6] usb: chipidea: Fix otg event handler
@ 2018-09-04 15:18 Loic Poulain
  0 siblings, 0 replies; 2+ messages in thread
From: Loic Poulain @ 2018-09-04 15:18 UTC (permalink / raw)
  To: Peter.Chen
  Cc: linux-usb, linux-arm-msm, david.brown, robh+dt, bjorn.andersson,
	andy.gross, andy.shevchenko, Loic Poulain

At OTG work running time, it's possible that several events need to be
addressed (e.g. ID and VBUS events). The current implementation handles
only one event at a time which leads to ignoring the other one. Fix it.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
---
 v2: v3: no change

 drivers/usb/chipidea/otg.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c
index db4ceff..f25d482 100644
--- a/drivers/usb/chipidea/otg.c
+++ b/drivers/usb/chipidea/otg.c
@@ -203,14 +203,17 @@ static void ci_otg_work(struct work_struct *work)
 	}
 
 	pm_runtime_get_sync(ci->dev);
+
 	if (ci->id_event) {
 		ci->id_event = false;
 		ci_handle_id_switch(ci);
-	} else if (ci->b_sess_valid_event) {
+	}
+
+	if (ci->b_sess_valid_event) {
 		ci->b_sess_valid_event = false;
 		ci_handle_vbus_change(ci);
-	} else
-		dev_err(ci->dev, "unexpected event occurs at %s\n", __func__);
+	}
+
 	pm_runtime_put_sync(ci->dev);
 
 	enable_irq(ci->irq);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [v3,4/6] usb: chipidea: Fix otg event handler
@ 2018-09-05  3:25 Peter Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Chen @ 2018-09-05  3:25 UTC (permalink / raw)
  To: Loic Poulain
  Cc: linux-usb, linux-arm-msm, david.brown, robh+dt, bjorn.andersson,
	andy.gross, andy.shevchenko

>  v2: v3: no change
> 
>  drivers/usb/chipidea/otg.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c index
> db4ceff..f25d482 100644
> --- a/drivers/usb/chipidea/otg.c
> +++ b/drivers/usb/chipidea/otg.c
> @@ -203,14 +203,17 @@ static void ci_otg_work(struct work_struct *work)
>  	}
> 
>  	pm_runtime_get_sync(ci->dev);
> +
>  	if (ci->id_event) {
>  		ci->id_event = false;
>  		ci_handle_id_switch(ci);
> -	} else if (ci->b_sess_valid_event) {
> +	}
> +
> +	if (ci->b_sess_valid_event) {
>  		ci->b_sess_valid_event = false;
>  		ci_handle_vbus_change(ci);
> -	} else
> -		dev_err(ci->dev, "unexpected event occurs at %s\n", __func__);
> +	}
> +
>  	pm_runtime_put_sync(ci->dev);
> 
>  	enable_irq(ci->irq);
> --

For chipidea changes, I will apply them. Thanks.

Peter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-05  3:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-04 15:18 [v3,4/6] usb: chipidea: Fix otg event handler Loic Poulain
2018-09-05  3:25 Peter Chen

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.