# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.823 -> 1.824 # drivers/scsi/sr.c 1.56 -> 1.57 # drivers/scsi/scsi_lib.c 1.36 -> 1.37 # drivers/scsi/sd.c 1.73 -> 1.74 # drivers/scsi/scsi_merge.c 1.24 -> 1.25 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/10/28 axboe@burns.home.kernel.dk 1.824 # Misc scsi bits # -------------------------------------------- # diff -Nru a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c --- a/drivers/scsi/scsi_lib.c Mon Oct 28 18:51:37 2002 +++ b/drivers/scsi/scsi_lib.c Mon Oct 28 18:51:37 2002 @@ -514,6 +514,12 @@ } } + if (blk_pc_request(req)) { + req->errors = result & 0xff; + if (!result) + req->data_len -= SCpnt->bufflen; + } + /* * Zero these out. They now point to freed memory, and it is * dangerous to hang onto the pointers. @@ -527,7 +533,7 @@ * Next deal with any sectors which we were able to correctly * handle. */ - if (good_sectors > 0) { + if (good_sectors >= 0) { SCSI_LOG_HLCOMPLETE(1, printk("%ld sectors total, %d sectors done.\n", req->nr_sectors, good_sectors)); SCSI_LOG_HLCOMPLETE(1, printk("use_sg is %d\n ", SCpnt->use_sg)); diff -Nru a/drivers/scsi/scsi_merge.c b/drivers/scsi/scsi_merge.c --- a/drivers/scsi/scsi_merge.c Mon Oct 28 18:51:37 2002 +++ b/drivers/scsi/scsi_merge.c Mon Oct 28 18:51:37 2002 @@ -62,15 +62,9 @@ int count, gfp_mask; /* - * non-sg block request. FIXME: check bouncing for isa hosts! + * if this is a rq->data based REQ_BLOCK_PC, setup for a non-sg xfer */ if ((req->flags & REQ_BLOCK_PC) && !req->bio) { - /* - * FIXME: isa bouncing - */ - if (SCpnt->host->unchecked_isa_dma) - goto fail; - SCpnt->request_bufflen = req->data_len; SCpnt->request_buffer = req->data; req->buffer = req->data; @@ -100,6 +94,8 @@ SCpnt->request_buffer = (char *) sgpnt; SCpnt->request_bufflen = req->nr_sectors << 9; + if (blk_pc_request(req)) + SCpnt->request_bufflen = req->data_len; req->buffer = NULL; /* @@ -123,7 +119,6 @@ /* * kill it. there should be no leftover blocks in this request */ -fail: SCpnt = scsi_end_request(SCpnt, 0, req->nr_sectors); BUG_ON(SCpnt); return 0; diff -Nru a/drivers/scsi/sd.c b/drivers/scsi/sd.c --- a/drivers/scsi/sd.c Mon Oct 28 18:51:37 2002 +++ b/drivers/scsi/sd.c Mon Oct 28 18:51:37 2002 @@ -308,6 +308,8 @@ if (rq->timeout) timeout = rq->timeout; + SCpnt->transfersize = rq->data_len; + SCpnt->underflow = rq->data_len; goto queue; } @@ -431,10 +433,10 @@ * host adapter, it's safe to assume that we can at least transfer * this many bytes between each connect / disconnect. */ -queue: SCpnt->transfersize = sdp->sector_size; SCpnt->underflow = this_count << 9; +queue: SCpnt->allowed = MAX_RETRIES; SCpnt->timeout_per_command = timeout; diff -Nru a/drivers/scsi/sr.c b/drivers/scsi/sr.c --- a/drivers/scsi/sr.c Mon Oct 28 18:51:37 2002 +++ b/drivers/scsi/sr.c Mon Oct 28 18:51:37 2002 @@ -287,6 +287,8 @@ if (rq->timeout) timeout = rq->timeout; + SCpnt->transfersize = rq->data_len; + SCpnt->underflow = rq->data_len; goto queue; } @@ -360,10 +362,10 @@ * host adapter, it's safe to assume that we can at least transfer * this many bytes between each connect / disconnect. */ -queue: SCpnt->transfersize = cd->device->sector_size; SCpnt->underflow = this_count << 9; +queue: SCpnt->allowed = MAX_RETRIES; SCpnt->timeout_per_command = timeout;