From owner-freebsd-stable@FreeBSD.ORG Thu May 3 15:32:06 2007 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4419716A406 for ; Thu, 3 May 2007 15:32:06 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from pobox.codelabs.ru (pobox.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id ECB1513C44B for ; Thu, 3 May 2007 15:32:05 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) DomainKey-Signature: a=rsa-sha1; q=dns; c=simple; s=one; d=codelabs.ru; h=Received:Date:From:To:Cc:Message-ID:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:Sender:X-Spam-Status:Subject; b=RiMy44rTRh/Zy3ND3oqv/P+jfuvH45BPNa08GEIwQYygiP10NTlF0nZDE9h9RkK7QA77Z7Q7zwtZRdNNyPDsI0rvllF/hdKVDnBobZ6h5UUkCY/nSBvwFI1bhSbAy8+wtE7nL/w9Km5BIowSDQEiNDDE4LLlxaPqVEbgz5ZQqSQ=; Received: from codelabs.ru (pobox.codelabs.ru [144.206.177.45]) by pobox.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1Hjd1q-000DNM-Mw; Thu, 03 May 2007 19:15:35 +0400 Date: Thu, 3 May 2007 19:15:30 +0400 From: Eygene Ryabinkin To: pvh@wfeet.za.net Message-ID: <20070503151530.GE27817@codelabs.ru> References: <5560-cups.bugs@news.easysw.com> <5561-cups.bugs@news.easysw.com> <4639FA65.7010005@wfeet.za.net> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <4639FA65.7010005@wfeet.za.net> Sender: rea-fbsd@codelabs.ru X-Spam-Status: No, score=-3.4 required=4.0 tests=ALL_TRUSTED,AWL,BAYES_00 Cc: freebsd-stable@freebsd.org Subject: Re: [cups.bugs] tcgetattr() causes lockup in USB backend on FreeBSD6-STABLE X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 May 2007 15:32:06 -0000 Peter, good day. Thu, May 03, 2007 at 05:06:13PM +0200, Peter van Heusden wrote: > Sorry, a bit more investigation revealed that my earlier comments were > wrong. Yes, the tcgetattr() call *does* "hang" - on my system it takes > 10 seconds to return, before returning ENODEV (the only thing that ioctl > on a ulpt returns on FreeBSD, according to my reading of the kernel). > That, however, isn't the real problem - the real hang occurs when > backendRunLoop() in runloop.c tries to read backchannel data from the > ulpt - despite select() saying that there is data available, the read() > blocks (I've even tried making the read buffer's size 1 byte, the > problem persists). This causes the usb backend hang. So indeed, setting > use_bc = 0 solves the problem. I'm not sure why select() / read() > interact like this. Seems like the FreeBSD kernel reports your device as the bi-directional one? I mean that 'dmesg | grep directi' shows something like 'ulpt0: using bi-directional mode'? If yes, then adding your device to the USB quirks as the uni-directional one should fix your problem. If you can rebuild the kernel, but don't know how to correct the quirks, send me the output of the 'usbdevs -v' with the printer plugged in and I will try to send you the patch for the USB quirks file. -- Eygene