aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas/mpt2sas_transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_transport.c')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_transport.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_transport.c b/drivers/scsi/mpt2sas/mpt2sas_transport.c
index 9d26637308be..7143e86af326 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_transport.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_transport.c
@@ -1901,7 +1901,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
1901 struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); 1901 struct MPT2SAS_ADAPTER *ioc = shost_priv(shost);
1902 Mpi2SmpPassthroughRequest_t *mpi_request; 1902 Mpi2SmpPassthroughRequest_t *mpi_request;
1903 Mpi2SmpPassthroughReply_t *mpi_reply; 1903 Mpi2SmpPassthroughReply_t *mpi_reply;
1904 int rc, i; 1904 int rc;
1905 u16 smid; 1905 u16 smid;
1906 u32 ioc_state; 1906 u32 ioc_state;
1907 unsigned long timeleft; 1907 unsigned long timeleft;
@@ -1916,7 +1916,8 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
1916 void *pci_addr_out = NULL; 1916 void *pci_addr_out = NULL;
1917 u16 wait_state_count; 1917 u16 wait_state_count;
1918 struct request *rsp = req->next_rq; 1918 struct request *rsp = req->next_rq;
1919 struct bio_vec *bvec = NULL; 1919 struct bio_vec bvec;
1920 struct bvec_iter iter;
1920 1921
1921 if (!rsp) { 1922 if (!rsp) {
1922 printk(MPT2SAS_ERR_FMT "%s: the smp response space is " 1923 printk(MPT2SAS_ERR_FMT "%s: the smp response space is "
@@ -1955,11 +1956,11 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
1955 goto out; 1956 goto out;
1956 } 1957 }
1957 1958
1958 bio_for_each_segment(bvec, req->bio, i) { 1959 bio_for_each_segment(bvec, req->bio, iter) {
1959 memcpy(pci_addr_out + offset, 1960 memcpy(pci_addr_out + offset,
1960 page_address(bvec->bv_page) + bvec->bv_offset, 1961 page_address(bvec.bv_page) + bvec.bv_offset,
1961 bvec->bv_len); 1962 bvec.bv_len);
1962 offset += bvec->bv_len; 1963 offset += bvec.bv_len;
1963 } 1964 }
1964 } else { 1965 } else {
1965 dma_addr_out = pci_map_single(ioc->pdev, bio_data(req->bio), 1966 dma_addr_out = pci_map_single(ioc->pdev, bio_data(req->bio),
@@ -2106,19 +2107,19 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
2106 u32 offset = 0; 2107 u32 offset = 0;
2107 u32 bytes_to_copy = 2108 u32 bytes_to_copy =
2108 le16_to_cpu(mpi_reply->ResponseDataLength); 2109 le16_to_cpu(mpi_reply->ResponseDataLength);
2109 bio_for_each_segment(bvec, rsp->bio, i) { 2110 bio_for_each_segment(bvec, rsp->bio, iter) {
2110 if (bytes_to_copy <= bvec->bv_len) { 2111 if (bytes_to_copy <= bvec.bv_len) {
2111 memcpy(page_address(bvec->bv_page) + 2112 memcpy(page_address(bvec.bv_page) +
2112 bvec->bv_offset, pci_addr_in + 2113 bvec.bv_offset, pci_addr_in +
2113 offset, bytes_to_copy); 2114 offset, bytes_to_copy);
2114 break; 2115 break;
2115 } else { 2116 } else {
2116 memcpy(page_address(bvec->bv_page) + 2117 memcpy(page_address(bvec.bv_page) +
2117 bvec->bv_offset, pci_addr_in + 2118 bvec.bv_offset, pci_addr_in +
2118 offset, bvec->bv_len); 2119 offset, bvec.bv_len);
2119 bytes_to_copy -= bvec->bv_len; 2120 bytes_to_copy -= bvec.bv_len;
2120 } 2121 }
2121 offset += bvec->bv_len; 2122 offset += bvec.bv_len;
2122 } 2123 }
2123 } 2124 }
2124 } else { 2125 } else {