Skip to contentSkip to conversation

efi_loader: GOP fix for no display

PATCH Applied Rob Clark 3 participants 6 messages Aug 4, 2017 – Aug 31, 2017

lore
Share & tools
lore

Rob Clark

author
#0 lore raw

PATCH 1/1 efi_loader: GOP fix for no display

uclass_first_device() returns 0 if there is no device, but error if there is a device that failed to probe.

---
 lib/efi_loader/efi_gop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_gop.c +1 -1
index e063e0c79b..411a8c9226 100644
@@ -137,7 +137,7 @@ int efi_gop_register(void)
 	struct udevice *vdev;
 
 	/* We only support a single video output device for now */
-	if (uclass_first_device(UCLASS_VIDEO, &vdev))
+	if (uclass_first_device(UCLASS_VIDEO, &vdev) || !vdev)
 		return -1;
 
 	struct video_priv *priv = dev_get_uclass_priv(vdev);
Signature · 1 line
2.13.0
author
#1 lore raw

PATCH 1/1 usb: kbd: don't fail with iomux

stdin might not be set, which would cause iomux_doenv() to fail therefore causing probe_usb_keyboard() to fail. Furthermore if we do have iomux enabled, the sensible thing (in terms of user experience) would be to simply add ourselves to the list of stdin devices.

This fixes an issue with usbkbd on dragonboard410c with distro- bootcmd, where stdin is not set (so stdinname is null).

---
v2: address Bin's review comments
v3: fix fail with free()ing if usbkbd is already in stdin env variable
pointed out by Simon

 common/usb_kbd.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
common/usb_kbd.c +15 -0
index d2d29cc98f..703dd748f5 100644
@@ -517,7 +517,22 @@ static int probe_usb_keyboard(struct usb_device *dev)
 
 	stdinname = getenv("stdin");
 #if CONFIG_IS_ENABLED(CONSOLE_MUX)
+	char *devname = DEVNAME;
+	/*
+	 * stdin might not be set yet.. either way, with console-mux the
+	 * sensible thing to do is add ourselves to the list of stdio
+	 * devices:
+	 */
+	if (stdinname && !strstr(stdinname, DEVNAME)) {
+		char *newstdin = malloc(strlen(stdinname) + strlen(","DEVNAME) + 1);
+		sprintf(newstdin, "%s,"DEVNAME, stdinname);
+		stdinname = newstdin;
+	} else if (!stdinname) {
+		stdinname = devname;
+	}
 	error = iomux_doenv(stdin, stdinname);
+	if (stdinname != devname)
+		free(stdinname);
 	if (error)
 		return error;
 #else
Signature · 1 line
2.13.0
#2 lore raw

PATCH 1/1 usb: kbd: don't fail with iomux

Hi Rob,

Quoted 5 lines · Rob Clark

stdin might not be set, which would cause iomux_doenv() to fail therefore causing probe_usb_keyboard() to fail. Furthermore if we do have iomux enabled, the sensible thing (in terms of user experience) would be to simply add ourselves to the list of stdin devices.

Quoted 9 lines

This fixes an issue with usbkbd on dragonboard410c with distro- bootcmd, where stdin is not set (so stdinname is null).

---
v2: address Bin's review comments
v3: fix fail with free()ing if usbkbd is already in stdin env variable
pointed out by Simon

Can you please indicate the version number in the email title next time? It's really hard to track which version the patch is.

Quoted 20 lines
 common/usb_kbd.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
common/usb_kbd.c +9 -0
index d2d29cc98f..703dd748f5 100644
@@ -517,7 +517,22 @@ static int probe_usb_keyboard(struct usb_device *dev)
 
        stdinname = getenv("stdin");
 #if CONFIG_IS_ENABLED(CONSOLE_MUX)
+       char *devname = DEVNAME;
+       /*
+        * stdin might not be set yet.. either way, with console-mux the
+        * sensible thing to do is add ourselves to the list of stdio
+        * devices:
+        */
+       if (stdinname && !strstr(stdinname, DEVNAME)) {
+               char *newstdin = malloc(strlen(stdinname) + strlen(","DEVNAME) + 1);
+               sprintf(newstdin, "%s,"DEVNAME, stdinname);

common/usb_kbd.c static int probe_usb_keyboard(struct usb_device *dev) · line 538

Quoted 10 lines
common/usb_kbd.c +6 -0
+               stdinname = newstdin;
+       } else if (!stdinname) {
+               stdinname = devname;
+       }
        error = iomux_doenv(stdin, stdinname);
+       if (stdinname != devname)
+               free(stdinname);
        if (error)
                return error;
 #else

And what's the difference between this "v3" and previous "v2"?

Previous v2 is here: http://patchwork.ozlabs.org/patch/797418/

Regards,
Bin

author
#3 lore raw

PATCH 1/1 usb: kbd: don't fail with iomux

Quoted 18 lines · Bin Meng

Hi Rob,

Quoted 5 lines · Rob Clark

stdin might not be set, which would cause iomux_doenv() to fail therefore causing probe_usb_keyboard() to fail. Furthermore if we do have iomux enabled, the sensible thing (in terms of user experience) would be to simply add ourselves to the list of stdin devices.

Quoted 9 lines

This fixes an issue with usbkbd on dragonboard410c with distro- bootcmd, where stdin is not set (so stdinname is null).

---
v2: address Bin's review comments
v3: fix fail with free()ing if usbkbd is already in stdin env variable
pointed out by Simon

Quoted 2 lines

Can you please indicate the version number in the email title next time? It's really hard to track which version the patch is.

ok, I had assumed u-boot followed linux kernel conventions of history below the "---" so it doesn't end up in git history.

Quoted 33 lines
Quoted 20 lines
 common/usb_kbd.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
common/usb_kbd.c +9 -0
index d2d29cc98f..703dd748f5 100644
@@ -517,7 +517,22 @@ static int probe_usb_keyboard(struct usb_device *dev)
 
        stdinname = getenv("stdin");
 #if CONFIG_IS_ENABLED(CONSOLE_MUX)
+       char *devname = DEVNAME;
+       /*
+        * stdin might not be set yet.. either way, with console-mux the
+        * sensible thing to do is add ourselves to the list of stdio
+        * devices:
+        */
+       if (stdinname && !strstr(stdinname, DEVNAME)) {
+               char *newstdin = malloc(strlen(stdinname) + strlen(","DEVNAME) + 1);
+               sprintf(newstdin, "%s,"DEVNAME, stdinname);

common/usb_kbd.c static int probe_usb_keyboard(struct usb_device *dev) · line 538

Quoted 10 lines
common/usb_kbd.c +6 -0
+               stdinname = newstdin;
+       } else if (!stdinname) {
+               stdinname = devname;
+       }
        error = iomux_doenv(stdin, stdinname);
+       if (stdinname != devname)
+               free(stdinname);
        if (error)
                return error;
 #else

And what's the difference between this "v3" and previous "v2"?

Quoted 2 lines

Previous v2 is here: http://patchwork.ozlabs.org/patch/797418/

Nothing because I apparently passed the old commit sha to git-format-patch again. Sorry about that. (I guess I'm doing too many things at once with trying to finalize a big efi_loader patchset in parallel with bisecting a couple remaining nonsensical travis failures as well as updating and resending these various other unrelated patches.)

I'll resend the real v3 in a moment.

BR,
-R

#4 lore raw

PATCH 1/1 usb: kbd: don't fail with iomux

Hi Rob,

Quoted 19 lines · Rob Clark
Quoted 18 lines · Bin Meng

Hi Rob,

Quoted 14 lines · Rob Clark

stdin might not be set, which would cause iomux_doenv() to fail therefore causing probe_usb_keyboard() to fail. Furthermore if we do have iomux enabled, the sensible thing (in terms of user experience) would be to simply add ourselves to the list of stdin devices.

This fixes an issue with usbkbd on dragonboard410c with distro- bootcmd, where stdin is not set (so stdinname is null).

---
v2: address Bin's review comments
v3: fix fail with free()ing if usbkbd is already in stdin env variable
pointed out by Simon

Quoted 5 lines
Quoted 2 lines

Can you please indicate the version number in the email title next time? It's really hard to track which version the patch is.

ok, I had assumed u-boot followed linux kernel conventions of history below the "---" so it doesn't end up in git history.

Yes, U-Boot follows the same Linux kernel conventions with regard to patch submission. What I was saying is not the commit title. It's the email title, something like "[PATCH v3] usb: kbd: don't fail with iomux"

Quoted 37 lines
Quoted 34 lines
Quoted 21 lines
 common/usb_kbd.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
common/usb_kbd.c +9 -0
index d2d29cc98f..703dd748f5 100644
@@ -517,7 +517,22 @@ static int probe_usb_keyboard(struct usb_device *dev)
 
        stdinname = getenv("stdin");
 #if CONFIG_IS_ENABLED(CONSOLE_MUX)
+       char *devname = DEVNAME;
+       /*
+        * stdin might not be set yet.. either way, with console-mux the
+        * sensible thing to do is add ourselves to the list of stdio
+        * devices:
+        */
+       if (stdinname && !strstr(stdinname, DEVNAME)) {
+               char *newstdin = malloc(strlen(stdinname) + strlen(","DEVNAME) + 1);
+               sprintf(newstdin, "%s,"DEVNAME, stdinname);

common/usb_kbd.c static int probe_usb_keyboard(struct usb_device *dev) · line 538

Quoted 10 lines
common/usb_kbd.c +6 -0
+               stdinname = newstdin;
+       } else if (!stdinname) {
+               stdinname = devname;
+       }
        error = iomux_doenv(stdin, stdinname);
+       if (stdinname != devname)
+               free(stdinname);
        if (error)
                return error;
 #else

And what's the difference between this "v3" and previous "v2"?

Quoted 2 lines

Previous v2 is here: http://patchwork.ozlabs.org/patch/797418/

Quoted 7 lines

Nothing because I apparently passed the old commit sha to git-format-patch again. Sorry about that. (I guess I'm doing too many things at once with trying to finalize a big efi_loader patchset in parallel with bisecting a couple remaining nonsensical travis failures as well as updating and resending these various other unrelated patches.)

You really should start trying patman instead of git-format-patch :)

Quoted 2 lines

I'll resend the real v3 in a moment.

Regards,
Bin