From nobody@FreeBSD.ORG  Tue Jan 11 16:29:21 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 8C7A015037; Tue, 11 Jan 2000 16:29:16 -0800 (PST)
Message-Id: <20000112002916.8C7A015037@hub.freebsd.org>
Date: Tue, 11 Jan 2000 16:29:16 -0800 (PST)
From: sam@errno.com
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: ata driver has a race in ata_command
X-Send-Pr-Version: www-1.0

>Number:         16071
>Category:       i386
>Synopsis:       ata driver has a race in ata_command
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 11 16:30:00 PST 2000
>Closed-Date:    Mon Feb 28 11:17:49 PST 2000
>Last-Modified:  Mon Feb 28 11:18:41 PST 2000
>Originator:     Sam Leffler
>Release:        4.0-CURRENT
>Organization:
>Environment:
FreeBSD melange.errno.com 4.0-CURRENT FreeBSD 4.0-CURRENT #0: Thu Jan  6 23:50:00 GMT 2000     root@melange.errno.com:/home/sam/freebsd/src/sys/compile/MELANGE  i386


>Description:
ata_command (1.39) sends a command before doing a tsleep to wait for the result.
If the device interrupts before tsleep is able to place the process on the sleep
queue then the interrupt will be missed.
>How-To-Repeat:
Boot 4.0-CURRENT under vmware w/ the ata driver configured instead of the
wd driver.  Notice that no IDE devices are recognized; each gets a complaint:

ata_command: timeout waiting for interrupt

A little investigation shows the obvious race that's exasperated by operating
in a pseudo-synchronous environment.
>Fix:
I'll let Soren (sic?) do his own.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Wed Jan 12 07:39:39 PST 2000 
Responsible-Changed-Why:  
Over to Mr. ATA. 
State-Changed-From-To: open->closed 
State-Changed-By: sos 
State-Changed-When: Mon Feb 28 11:17:49 PST 2000 
State-Changed-Why:  
Fixed in 4.0. 
>Unformatted:
