From owner-freebsd-bugs@FreeBSD.ORG Mon Nov 19 22:40:04 2007 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6611816A4A5 for ; Mon, 19 Nov 2007 22:40:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 38C9913C4D5 for ; Mon, 19 Nov 2007 22:40:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id lAJMe4L1075729 for ; Mon, 19 Nov 2007 22:40:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id lAJMe4a1075728; Mon, 19 Nov 2007 22:40:04 GMT (envelope-from gnats) Resent-Date: Mon, 19 Nov 2007 22:40:04 GMT Resent-Message-Id: <200711192240.lAJMe4a1075728@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Heikki Suonsivu Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD27F16A421 for ; Mon, 19 Nov 2007 22:37:49 +0000 (UTC) (envelope-from hsu@joutseno.wlansystems.com) Received: from joutseno.wlansystems.com (joutseno.wlansystems.com [212.16.100.99]) by mx1.freebsd.org (Postfix) with ESMTP id EC0A813C457 for ; Mon, 19 Nov 2007 22:37:45 +0000 (UTC) (envelope-from hsu@joutseno.wlansystems.com) Received: from joutseno.wlansystems.com (localhost [127.0.0.1]) by joutseno.wlansystems.com (8.14.2/8.14.2) with ESMTP id lAJMbaoR078561 for ; Tue, 20 Nov 2007 00:37:37 +0200 (EET) (envelope-from hsu@joutseno.wlansystems.com) Received: (from root@localhost) by joutseno.wlansystems.com (8.14.2/8.14.2/Submit) id lAJMbZ3i078560; Tue, 20 Nov 2007 00:37:35 +0200 (EET) (envelope-from hsu) Message-Id: <200711192237.lAJMbZ3i078560@joutseno.wlansystems.com> Date: Tue, 20 Nov 2007 00:37:35 +0200 (EET) From: Heikki Suonsivu To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/118140: quick hack for ucom to get it behave with Nokia phones X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Heikki Suonsivu List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2007 22:40:04 -0000 >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: