Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jul 2002 23:38:51 +0100
From:      Ian Dowse <iedowse@maths.tcd.ie>
To:        Michiel Boland <boland@carmel.diva.nl>
Cc:        Mike Tancsa <mike@sentex.net>, stable@FreeBSD.ORG, sos@freebsd.dk
Subject:   Re: strange ATA behavior with -STABLE 
Message-ID:   <200207122338.aa27236@salmon.maths.tcd.ie>
In-Reply-To: Your message of "Thu, 11 Jul 2002 10:01:37 %2B0200." <20020711095747.B19121-100000@carmel.diva.nl> 

next in thread | previous in thread | raw e-mail | index | archive | help
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




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