Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Nov 2007 00:37:35 +0200 (EET)
From:      Heikki Suonsivu <hsu@bbnetworks.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/118140: quick hack for ucom to get it behave with Nokia phones
Message-ID:  <200711192237.lAJMbZ3i078560@joutseno.wlansystems.com>
Resent-Message-ID: <200711192240.lAJMe4a1075728@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         118140
>Category:       kern
>Synopsis:       quick hack for ucom to get it behave with Nokia phones
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 19 22:40:03 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     Heikki Suonsivu
>Release:        FreeBSD 7.0-BETA3 i386
>Organization:
bbnetworks.net
>Environment:
System: FreeBSD joutseno.wlansystems.com 7.0-BETA3 FreeBSD 7.0-BETA3 #3: Sun Nov 18 02:20:02 EET 2007 hsu@joutseno.wlansystems.com:/usr/obj/usr/src/sys/GENERIC i386

FreeBSD, Nokia 6680 (may work for some other models as well), usb cable. 
The port is usb1, if that means anything.

>Description:

Nokia phones on usb connection get 

ucom1: ucomreadcb: IOERROR

and the serial connection to the phone dies, requiring pppd restart.

>How-To-Repeat:

Take Nokia phone (6680 and 9300 triggered this), and try running pppd
to those.  You will also need the union patch to make them recognized
(search for FreeBSD Nokia 6630).  You also may need to have a USB1 port.  I
have not yet tested whether this same problem appears on USB2 ports as
well.

>Fix:

I took a blindfold and a big hammer to get it not get stuck in this
error, and the following at least seems to make it survive ucomreadcb,
instead it just spawns those errors every now and then.  As this only
cures the symptom, it may need a better knowledge to fix.

ucomwritecb batch may not be the right one (it may be that it survives
write errors anyway, I just noticed similar XXX there); someone
knowing the usb stuff could take a look.

Index: ucom.c
===================================================================
RCS file: /usr/CVS/src/sys/dev/usb/ucom.c,v
retrieving revision 1.64
diff -u -r1.64 ucom.c
--- ucom.c	25 Jun 2007 06:40:20 -0000	1.64
+++ ucom.c	19 Nov 2007 18:45:35 -0000
@@ -669,7 +669,9 @@
 		if (status == USBD_STALLED)
 			usbd_clear_endpoint_stall_async(sc->sc_bulkin_pipe);
 		/* XXX we should restart after some delay. */
-		goto error;
+		/* hsu: testing ignoring io errors */
+		if (status != USBD_IOERROR)
+		  goto error;
 	}
 
 	usbd_get_xfer_status(xfer, NULL, NULL, &cc, NULL);
@@ -749,7 +751,10 @@
 		if (status == USBD_STALLED)
 			usbd_clear_endpoint_stall_async(sc->sc_bulkin_pipe);
 		/* XXX we should restart after some delay. */
-		return;
+		if (status != USBD_IOERROR)
+		  return;
+		else /* hsu: Testing ignoring io errors */
+		  goto resubmit;
 	}
 	sc->sc_state |= UCS_RXSTOP;
 


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711192237.lAJMbZ3i078560>