From owner-freebsd-stable Fri Jul 12 15:46:42 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2FCD337B4B2 for ; Fri, 12 Jul 2002 15:45:27 -0700 (PDT) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id 5BA86449F8 for ; Fri, 12 Jul 2002 15:39:11 -0700 (PDT) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 12 Jul 2002 23:38:56 +0100 (BST) To: Michiel Boland Cc: Mike Tancsa , stable@FreeBSD.ORG, sos@freebsd.dk Subject: Re: strange ATA behavior with -STABLE In-Reply-To: Your message of "Thu, 11 Jul 2002 10:01:37 +0200." <20020711095747.B19121-100000@carmel.diva.nl> Date: Fri, 12 Jul 2002 23:38:51 +0100 From: Ian Dowse Message-ID: <200207122338.aa27236@salmon.maths.tcd.ie> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <20020711095747.B19121-100000@carmel.diva.nl>, Michiel Boland writes : >Please correct me if I'm wrong but I don't think the splx patch does >anything to help people with broken CD-ROM drives. Try the following. It fixes CD-ROM drives in VMWare for me, so there is a good chance it may help with real CD-ROM drives too. Sorry, I meant to try to track this down ages ago as it sounded (and was) really easy to find, but I rarely use CD-ROM drives in VMWare so I never got around to it. It's just a simple race where if the completion interrupt comes in between the splx() and the tsleep(), the tsleep will sit in "atprq" forever. Moving the splx() to after the tsleep ensures that this can't happen. Ian Index: atapi-all.c =================================================================== RCS file: /home/iedowse/CVS/src/sys/dev/ata/atapi-all.c,v retrieving revision 1.46.2.13 diff -u -r1.46.2.13 atapi-all.c --- atapi-all.c 26 Mar 2002 09:36:43 -0000 1.46.2.13 +++ atapi-all.c 12 Jul 2002 22:35:17 -0000 @@ -206,15 +206,17 @@ TAILQ_INSERT_HEAD(&atadev->channel->atapi_queue, request, chain); else TAILQ_INSERT_TAIL(&atadev->channel->atapi_queue, request, chain); - splx(s); ata_start(atadev->channel); /* if callback used, then just return, gets called from interrupt context */ - if (callback) + if (callback) { + splx(s); return 0; + } /* wait for request to complete */ tsleep((caddr_t)request, PRIBIO, "atprq", 0); + splx(s); error = request->error; if (error) bcopy(&request->sense, atadev->result, sizeof(struct atapi_reqsense)); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message