mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] usb: imx: Do not disable VBUS on ehci_register()'s success
@ 2019-02-25  6:52 Andrey Smirnov
  2019-02-27  7:27 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Smirnov @ 2019-02-25  6:52 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov, Vivien Didelot

Original code was written to exit early on ehci_register()'s
success. As a part of e3eb0c729b, however, it was modified to to early
exit on failure instead. This resulted in VBUS being erroneously
disabled after EHCI controller was added, thus breaking USB on some
i.MX boards (confirmed on ZII's RDU2).

Fixes: e3eb0c729b ("usb: host: ehci: add ehci_unregister()")
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Vivien Didelot <vivien.didelot@gmail.com>
---
 drivers/usb/imx/chipidea-imx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
index 879221770..6c60c383f 100644
--- a/drivers/usb/imx/chipidea-imx.c
+++ b/drivers/usb/imx/chipidea-imx.c
@@ -201,14 +201,14 @@ static int ci_register_role(struct imx_chipidea *ci)
 				return ret;
 
 			ehci = ehci_register(ci->dev, &ci->data);
-			if (IS_ERR(ehci))
+			if (IS_ERR(ehci)) {
+				regulator_disable(ci->vbus);
 				return PTR_ERR(ehci);
+			}
 
 			ci->ehci = ehci;
 
 			ci->dev->detect = ci_ehci_detect;
-
-			regulator_disable(ci->vbus);
 		} else {
 			dev_err(ci->dev, "Host support not available\n");
 			return -ENODEV;
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] usb: imx: Do not disable VBUS on ehci_register()'s success
  2019-02-25  6:52 [PATCH] usb: imx: Do not disable VBUS on ehci_register()'s success Andrey Smirnov
@ 2019-02-27  7:27 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2019-02-27  7:27 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: barebox, Vivien Didelot

On Sun, Feb 24, 2019 at 10:52:29PM -0800, Andrey Smirnov wrote:
> Original code was written to exit early on ehci_register()'s
> success. As a part of e3eb0c729b, however, it was modified to to early
> exit on failure instead. This resulted in VBUS being erroneously
> disabled after EHCI controller was added, thus breaking USB on some
> i.MX boards (confirmed on ZII's RDU2).
> 
> Fixes: e3eb0c729b ("usb: host: ehci: add ehci_unregister()")
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> Cc: Vivien Didelot <vivien.didelot@gmail.com>
> ---
>  drivers/usb/imx/chipidea-imx.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Applied to master, thanks

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2019-02-27  7:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-25  6:52 [PATCH] usb: imx: Do not disable VBUS on ehci_register()'s success Andrey Smirnov
2019-02-27  7:27 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox