mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>,
	Vivien Didelot <vivien.didelot@gmail.com>
Subject: [PATCH] usb: imx: Do not disable VBUS on ehci_register()'s success
Date: Sun, 24 Feb 2019 22:52:29 -0800	[thread overview]
Message-ID: <20190225065229.3386-1-andrew.smirnov@gmail.com> (raw)

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

             reply	other threads:[~2019-02-25  6:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-25  6:52 Andrey Smirnov [this message]
2019-02-27  7:27 ` Sascha Hauer

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=20190225065229.3386-1-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=vivien.didelot@gmail.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