public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Peter Robinson <pbrobinson@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH] Revert "usb: kbd: destroy device after console is stopped"
Date: Thu, 22 Apr 2021 10:19:10 +0100	[thread overview]
Message-ID: <20210422091910.83560-1-pbrobinson@gmail.com> (raw)

Reverts commit eb5fd9e46c1, it causes ARMv7 devices to stop booting
Linux when a USB keyboard is attached. The kernels starts but there's
no output. Reverting it makes things work again.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---

This has caused us issues on a number of ARMv7 deviices. I'm not sure
why specifically ARMv7 because it happens on a RPi3 running Fedora
armhfp, but doesn't happen on aarch64. Issue seen on RPis, Cubietruck,
and others.

 common/usb_kbd.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index afad260d3d..515f37136f 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -622,12 +622,12 @@ int usb_kbd_deregister(int force)
 	if (dev) {
 		usb_kbd_dev = (struct usb_device *)dev->priv;
 		data = usb_kbd_dev->privptr;
+		if (stdio_deregister_dev(dev, force) != 0)
+			return 1;
 #if CONFIG_IS_ENABLED(CONSOLE_MUX)
-		if (iomux_replace_device(stdin, DEVNAME, force ? "nulldev" : ""))
+		if (iomux_doenv(stdin, env_get("stdin")) != 0)
 			return 1;
 #endif
-		if (stdio_deregister_dev(dev, force) != 0)
-			return 1;
 #ifdef CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
 		destroy_int_queue(usb_kbd_dev, data->intq);
 #endif
@@ -665,16 +665,16 @@ static int usb_kbd_remove(struct udevice *dev)
 		goto err;
 	}
 	data = udev->privptr;
+	if (stdio_deregister_dev(sdev, true)) {
+		ret = -EPERM;
+		goto err;
+	}
 #if CONFIG_IS_ENABLED(CONSOLE_MUX)
-	if (iomux_replace_device(stdin, DEVNAME, "nulldev")) {
+	if (iomux_doenv(stdin, env_get("stdin"))) {
 		ret = -ENOLINK;
 		goto err;
 	}
 #endif
-	if (stdio_deregister_dev(sdev, true)) {
-		ret = -EPERM;
-		goto err;
-	}
 #ifdef CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
 	destroy_int_queue(udev, data->intq);
 #endif
-- 
2.31.1

             reply	other threads:[~2021-04-22  9:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22  9:19 Peter Robinson [this message]
2021-04-22 10:52 ` [PATCH] Revert "usb: kbd: destroy device after console is stopped" Andy Shevchenko
2021-04-22 11:11   ` Peter Robinson
2021-04-22 11:28     ` Andy Shevchenko
2021-04-22 11:30     ` Andy Shevchenko
2021-04-22 19:34       ` Marek Vasut

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=20210422091910.83560-1-pbrobinson@gmail.com \
    --to=pbrobinson@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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