From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 26 16:32:49 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4FD0916A420 for ; Thu, 26 Jan 2006 16:32:49 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 973A743D49 for ; Thu, 26 Jan 2006 16:32:48 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 7037605 for multiple; Thu, 26 Jan 2006 11:31:37 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k0QGWj1S043117; Thu, 26 Jan 2006 11:32:45 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Thu, 26 Jan 2006 11:33:38 -0500 User-Agent: KMail/1.9.1 References: <806128ad0601250608u67aae744u@mail.gmail.com> <200601250956.35818.jhb@freebsd.org> <806128ad0601260254u42dfd927k@mail.gmail.com> In-Reply-To: <806128ad0601260254u42dfd927k@mail.gmail.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_jnP2DIjaYjxVBkg" Message-Id: <200601261133.39848.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1252/Thu Jan 26 06:03:25 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: Vitaliy Skakun Subject: Re: Comtrol Rocketport UNIVERSAL PCI 32-port X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2006 16:32:49 -0000 --Boundary-00=_jnP2DIjaYjxVBkg Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Thursday 26 January 2006 05:54, Vitaliy Skakun wrote: > Hi everybody! > > One problem arised: > > when doing in the shell > echo "~WS" > /dev/cuaR00 > > for several times as quick as I can, I get panic with the following > message: panic: device_unbusy: called for non-busy device rp0 > > same thing when trying to send data to /dev/cuaR00 via JDK File streams ... > > :((( > > (Some kind of barcode printers are attached to this multiport card) > > Any help will be kindly accepted. > > Cheers > Vit Try the attached patch. tty's don't use D_TRACKCLOSE but rp(4) was expecting that rpclose() was called on every close, not just the last close. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org --Boundary-00=_jnP2DIjaYjxVBkg Content-Type: text/x-diff; charset="iso-8859-1"; name="rp_busy.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="rp_busy.patch" Index: rp.c =================================================================== RCS file: /usr/cvs/src/sys/dev/rp/rp.c,v retrieving revision 1.71 diff -u -r1.71 rp.c --- rp.c 4 Dec 2005 10:06:04 -0000 1.71 +++ rp.c 26 Jan 2006 16:32:48 -0000 @@ -929,7 +929,9 @@ rp_callout_handle = timeout(rp_do_poll, (void *)NULL, POLL_INTERVAL); - device_busy(rp->rp_ctlp->dev); + if (rp->rp_open_count == 0) + device_busy(rp->rp_ctlp->dev); + rp->rp_open_count++; return(0); } @@ -960,6 +962,7 @@ tp->t_actout = FALSE; wakeup(&tp->t_actout); wakeup(TSA_CARR_ON(tp)); + rp->rp_open_count = 0; device_unbusy(rp->rp_ctlp->dev); } Index: rpvar.h =================================================================== RCS file: /usr/cvs/src/sys/dev/rp/rpvar.h,v retrieving revision 1.9 diff -u -r1.9 rpvar.h --- rpvar.h 4 Dec 2005 10:06:04 -0000 1.9 +++ rpvar.h 26 Jan 2006 16:31:59 -0000 @@ -47,6 +47,7 @@ unsigned char state; /* state of dtr */ int rp_port; + int rp_open_count; int rp_flags; int rp_unit:2; int rp_aiop:2; --Boundary-00=_jnP2DIjaYjxVBkg--