r3776 - trunk/src/target/u-boot/patches
werner at sita.openmoko.org
werner at sita.openmoko.org
Sat Jan 5 21:16:13 CET 2008
Author: werner
Date: 2008-01-05 21:16:09 +0100 (Sat, 05 Jan 2008)
New Revision: 3776
Modified:
trunk/src/target/u-boot/patches/uboot-usbtty-acm.patch
Log:
This fixes the hang at boot time if usbtty is set but no USB is connected.
http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=887
The problem surfaced in the first place because upstream changed
USBTTY_BUFFER_SIZE from 2048 bytes, which was apparently always big enough, to
256 bytes, which isn't. The logic of the fix is slightly ugly since we could
already exit in usbtty_puts if there is no USB. However, this kills the slight
chance that someone might connect and see the buffered messages.
uboot-usbtty-acm.patch:
- drivers/serial/usbtty.c (__usbtty_puts): allow overwriting of the circular
buffer if usbtty is not configured. This is a slight variation of
http://bugzilla.openmoko.org/cgi-bin/bugzilla/attachment.cgi?id=462
Modified: trunk/src/target/u-boot/patches/uboot-usbtty-acm.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-usbtty-acm.patch 2008-01-05 19:15:31 UTC (rev 3775)
+++ trunk/src/target/u-boot/patches/uboot-usbtty-acm.patch 2008-01-05 20:16:09 UTC (rev 3776)
@@ -25,7 +25,20 @@
#include <circbuf.h>
#include <devices.h>
#include "usbtty.h"
-@@ -544,6 +545,14 @@
+@@ -474,6 +475,12 @@
+ usbtty_poll ();
+
+ space = maxlen - usbtty_output.size;
++
++ /* If the USB is not configured, allow the circular buffer to
++ be overwritten. Otherwise this while() will loop forever. */
++ if (!usbtty_configured())
++ space = maxlen;
++
+ /* Empty buffer here, if needed, to ensure space... */
+ if (space) {
+ write_buffer (&usbtty_output);
+@@ -544,6 +551,14 @@
}
usbtty_init_terminal_type(strcmp(tt,"cdc_acm"));
@@ -68,7 +81,7 @@
#define CONFIG_USBD_CONFIGURATION_STR "TTY via USB"
-Index: u-boot/drivers/usbdcore_omap1510.c
+Index: u-boot/drivers/usb/usbdcore_omap1510.c
===================================================================
--- u-boot.orig/drivers/usb/usbdcore_omap1510.c
+++ u-boot/drivers/usb/usbdcore_omap1510.c
More information about the commitlog
mailing list