aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/ub.c6
-rw-r--r--drivers/ide/ide-cd.c4
-rw-r--r--drivers/ide/ide-tape.c2
-rw-r--r--drivers/message/fusion/mptsas.c3
-rw-r--r--drivers/scsi/libsas/sas_expander.c4
-rw-r--r--drivers/scsi/libsas/sas_host_smp.c3
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_transport.c4
7 files changed, 15 insertions, 11 deletions
diff --git a/drivers/block/ub.c b/drivers/block/ub.c
index f32781cff456..e67bbae9547d 100644
--- a/drivers/block/ub.c
+++ b/drivers/block/ub.c
@@ -781,8 +781,10 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
781 781
782 if (cmd->error == 0) { 782 if (cmd->error == 0) {
783 if (blk_pc_request(rq)) { 783 if (blk_pc_request(rq)) {
784 if (cmd->act_len < blk_rq_bytes(rq)) 784 if (cmd->act_len >= rq->resid_len)
785 rq->resid_len = blk_rq_bytes(rq) - cmd->act_len; 785 rq->resid_len = 0;
786 else
787 rq->resid_len -= cmd->act_len;
786 scsi_status = 0; 788 scsi_status = 0;
787 } else { 789 } else {
788 if (cmd->act_len != cmd->len) { 790 if (cmd->act_len != cmd->len) {
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 4c7792fd5f93..081aed6781cc 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -699,6 +699,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
699 699
700out_end: 700out_end:
701 if (blk_pc_request(rq) && rc == 0) { 701 if (blk_pc_request(rq) && rc == 0) {
702 rq->resid_len = 0;
702 blk_end_request_all(rq, 0); 703 blk_end_request_all(rq, 0);
703 hwif->rq = NULL; 704 hwif->rq = NULL;
704 } else { 705 } else {
@@ -718,8 +719,7 @@ out_end:
718 719
719 /* make sure it's fully ended */ 720 /* make sure it's fully ended */
720 if (blk_fs_request(rq) == 0) { 721 if (blk_fs_request(rq) == 0) {
721 rq->resid_len = blk_rq_bytes(rq) - 722 rq->resid_len -= cmd->nbytes - cmd->nleft;
722 (cmd->nbytes - cmd->nleft);
723 if (uptodate == 0 && (cmd->tf_flags & IDE_TFLAG_WRITE)) 723 if (uptodate == 0 && (cmd->tf_flags & IDE_TFLAG_WRITE))
724 rq->resid_len += cmd->last_xfer_len; 724 rq->resid_len += cmd->last_xfer_len;
725 } 725 }
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index e16604562f28..683ff37d4079 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -380,7 +380,7 @@ static int ide_tape_callback(ide_drive_t *drive, int dsc)
380 } 380 }
381 381
382 tape->first_frame += blocks; 382 tape->first_frame += blocks;
383 rq->resid_len = blk_rq_bytes(rq) - blocks * tape->blk_size; 383 rq->resid_len -= blocks * tape->blk_size;
384 384
385 if (pc->error) { 385 if (pc->error) {
386 uptodate = 0; 386 uptodate = 0;
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 4e6fcf06a6f2..79f5433359f9 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -1357,7 +1357,8 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
1357 smprep = (SmpPassthroughReply_t *)ioc->sas_mgmt.reply; 1357 smprep = (SmpPassthroughReply_t *)ioc->sas_mgmt.reply;
1358 memcpy(req->sense, smprep, sizeof(*smprep)); 1358 memcpy(req->sense, smprep, sizeof(*smprep));
1359 req->sense_len = sizeof(*smprep); 1359 req->sense_len = sizeof(*smprep);
1360 rsp->resid_len = blk_rq_bytes(rsp) - smprep->ResponseDataLength; 1360 req->resid_len = 0;
1361 rsp->resid_len -= smprep->ResponseDataLength;
1361 } else { 1362 } else {
1362 printk(MYIOC_s_ERR_FMT "%s: smp passthru reply failed to be returned\n", 1363 printk(MYIOC_s_ERR_FMT "%s: smp passthru reply failed to be returned\n",
1363 ioc->name, __func__); 1364 ioc->name, __func__);
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index 531af9ed7199..54fa1e42dc4d 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -1937,7 +1937,11 @@ int sas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
1937 if (ret > 0) { 1937 if (ret > 0) {
1938 /* positive number is the untransferred residual */ 1938 /* positive number is the untransferred residual */
1939 rsp->resid_len = ret; 1939 rsp->resid_len = ret;
1940 req->resid_len = 0;
1940 ret = 0; 1941 ret = 0;
1942 } else if (ret == 0) {
1943 rsp->resid_len = 0;
1944 req->resid_len = 0;
1941 } 1945 }
1942 1946
1943 return ret; 1947 return ret;
diff --git a/drivers/scsi/libsas/sas_host_smp.c b/drivers/scsi/libsas/sas_host_smp.c
index be9a951b977d..1bc3b7567994 100644
--- a/drivers/scsi/libsas/sas_host_smp.c
+++ b/drivers/scsi/libsas/sas_host_smp.c
@@ -176,9 +176,6 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req,
176 resp_data[1] = req_data[1]; 176 resp_data[1] = req_data[1];
177 resp_data[2] = SMP_RESP_FUNC_UNK; 177 resp_data[2] = SMP_RESP_FUNC_UNK;
178 178
179 req->resid_len = blk_rq_bytes(req);
180 rsp->resid_len = blk_rq_bytes(rsp);
181
182 switch (req_data[1]) { 179 switch (req_data[1]) {
183 case SMP_REPORT_GENERAL: 180 case SMP_REPORT_GENERAL:
184 req->resid_len -= 8; 181 req->resid_len -= 8;
diff --git a/drivers/scsi/mpt2sas/mpt2sas_transport.c b/drivers/scsi/mpt2sas/mpt2sas_transport.c
index af95a449930e..5c65da519e39 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_transport.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_transport.c
@@ -1170,8 +1170,8 @@ transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
1170 1170
1171 memcpy(req->sense, mpi_reply, sizeof(*mpi_reply)); 1171 memcpy(req->sense, mpi_reply, sizeof(*mpi_reply));
1172 req->sense_len = sizeof(*mpi_reply); 1172 req->sense_len = sizeof(*mpi_reply);
1173 rsp->resid_len = blk_rq_bytes(rsp) - 1173 req->resid_len = 0;
1174 mpi_reply->ResponseDataLength; 1174 rsp->resid_len -= mpi_reply->ResponseDataLength;
1175 } else { 1175 } else {
1176 dtransportprintk(ioc, printk(MPT2SAS_DEBUG_FMT 1176 dtransportprintk(ioc, printk(MPT2SAS_DEBUG_FMT
1177 "%s - no reply\n", ioc->name, __func__)); 1177 "%s - no reply\n", ioc->name, __func__));