aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi')
-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
3 files changed, 6 insertions, 5 deletions
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__));