From 9d54441f7fe0cc4f14a28d0bb6d5a132762e1efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Schmidt?= Date: Thu, 12 Sep 2002 13:53:33 +0000 Subject: [PATCH] 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 --- sys/dev/ata/atapi-all.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/ata/atapi-all.c b/sys/dev/ata/atapi-all.c index 8fafd4570ce..8a6c0358261 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)