diff options
author | sos <sos@FreeBSD.org> | 2002-09-12 13:53:33 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2002-09-12 13:53:33 +0000 |
commit | 8a7241d8c2af8571ec8faa3fff4b41668c4b6435 (patch) | |
tree | 2b9af6f2730d0ba7a6aa60dbfa829a17ec9b968b /sys/dev/ata | |
parent | 8ac38ef59e65b29edd5bfe02dd7eefdddf36b6a2 (diff) | |
download | FreeBSD-src-8a7241d8c2af8571ec8faa3fff4b41668c4b6435.zip FreeBSD-src-8a7241d8c2af8571ec8faa3fff4b41668c4b6435.tar.gz |
Dont hang in atprq on poll_dsc command.
This is a temporary fix until I get proper locking done.
Submitted by: iedowse@maths.tcd.ie
Diffstat (limited to 'sys/dev/ata')
-rw-r--r-- | sys/dev/ata/atapi-all.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/ata/atapi-all.c b/sys/dev/ata/atapi-all.c index 8fafd45..8a6c035 100644 --- a/sys/dev/ata/atapi-all.c +++ b/sys/dev/ata/atapi-all.c @@ -177,6 +177,7 @@ atapi_queue_cmd(struct ata_device *atadev, int8_t *ccb, caddr_t data, request->data = data; request->bytecount = count; request->flags = flags; + request->error = EINPROGRESS; request->timeout = timeout * hz; request->ccbsize = atadev->param->packet_size ? 16 : 12; bcopy(ccb, request->ccb, request->ccbsize); @@ -207,8 +208,9 @@ atapi_queue_cmd(struct ata_device *atadev, int8_t *ccb, caddr_t data, return 0; } - /* wait for request to complete */ - tsleep((caddr_t)request, PRIBIO, "atprq", 0); + /* only sleep when command is in progress */ + if (request->error == EINPROGRESS) + tsleep((caddr_t)request, PRIBIO, "atprq", 0); splx(s); error = request->error; if (error) |