aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-03 19:57:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-03 19:57:19 -0400
commit877f075aac900288ce2e6a64075cceff09210a7e (patch)
tree2bcf23e903403a2bfa3c6fac14d1334614e4d0f1 /drivers/scsi
parent3cf59142bcd391680beb6932838fe09a73947705 (diff)
parentf7eaa7ed8fd46542275cf249cd934a366f6556bb (diff)
Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
Pull infiniband updates from Roland Dreier: "Main batch of InfiniBand/RDMA changes for 3.15: - The biggest change is core API extensions and mlx5 low-level driver support for handling DIF/DIX-style protection information, and the addition of PI support to the iSER initiator. Target support will be arriving shortly through the SCSI target tree. - A nice simplification to the "umem" memory pinning library now that we have chained sg lists. Kudos to Yishai Hadas for realizing our code didn't have to be so crazy. - Another nice simplification to the sg wrappers used by qib, ipath and ehca to handle their mapping of memory to adapter. - The usual batch of fixes to bugs found by static checkers etc. from intrepid people like Dan Carpenter and Yann Droneaud. - A large batch of cxgb4, ocrdma, qib driver updates" * tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (102 commits) RDMA/ocrdma: Unregister inet notifier when unloading ocrdma RDMA/ocrdma: Fix warnings about pointer <-> integer casts RDMA/ocrdma: Code clean-up RDMA/ocrdma: Display FW version RDMA/ocrdma: Query controller information RDMA/ocrdma: Support non-embedded mailbox commands RDMA/ocrdma: Handle CQ overrun error RDMA/ocrdma: Display proper value for max_mw RDMA/ocrdma: Use non-zero tag in SRQ posting RDMA/ocrdma: Memory leak fix in ocrdma_dereg_mr() RDMA/ocrdma: Increment abi version count RDMA/ocrdma: Update version string be2net: Add abi version between be2net and ocrdma RDMA/ocrdma: ABI versioning between ocrdma and be2net RDMA/ocrdma: Allow DPP QP creation RDMA/ocrdma: Read ASIC_ID register to select asic_gen RDMA/ocrdma: SQ and RQ doorbell offset clean up RDMA/ocrdma: EQ full catastrophe avoidance RDMA/cxgb4: Disable DSGL use by default RDMA/cxgb4: rx_data() needs to hold the ep mutex ...
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/libiscsi.c32
-rw-r--r--drivers/scsi/scsi_transport_srp.c1
2 files changed, 33 insertions, 0 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 5b8605ca42fa..26dc005bb0f0 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -387,6 +387,10 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_task *task)
387 if (rc) 387 if (rc)
388 return rc; 388 return rc;
389 } 389 }
390
391 if (scsi_get_prot_op(sc) != SCSI_PROT_NORMAL)
392 task->protected = true;
393
390 if (sc->sc_data_direction == DMA_TO_DEVICE) { 394 if (sc->sc_data_direction == DMA_TO_DEVICE) {
391 unsigned out_len = scsi_out(sc)->length; 395 unsigned out_len = scsi_out(sc)->length;
392 struct iscsi_r2t_info *r2t = &task->unsol_r2t; 396 struct iscsi_r2t_info *r2t = &task->unsol_r2t;
@@ -822,6 +826,33 @@ static void iscsi_scsi_cmd_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
822 826
823 sc->result = (DID_OK << 16) | rhdr->cmd_status; 827 sc->result = (DID_OK << 16) | rhdr->cmd_status;
824 828
829 if (task->protected) {
830 sector_t sector;
831 u8 ascq;
832
833 /**
834 * Transports that didn't implement check_protection
835 * callback but still published T10-PI support to scsi-mid
836 * deserve this BUG_ON.
837 **/
838 BUG_ON(!session->tt->check_protection);
839
840 ascq = session->tt->check_protection(task, &sector);
841 if (ascq) {
842 sc->result = DRIVER_SENSE << 24 |
843 SAM_STAT_CHECK_CONDITION;
844 scsi_build_sense_buffer(1, sc->sense_buffer,
845 ILLEGAL_REQUEST, 0x10, ascq);
846 sc->sense_buffer[7] = 0xc; /* Additional sense length */
847 sc->sense_buffer[8] = 0; /* Information desc type */
848 sc->sense_buffer[9] = 0xa; /* Additional desc length */
849 sc->sense_buffer[10] = 0x80; /* Validity bit */
850
851 put_unaligned_be64(sector, &sc->sense_buffer[12]);
852 goto out;
853 }
854 }
855
825 if (rhdr->response != ISCSI_STATUS_CMD_COMPLETED) { 856 if (rhdr->response != ISCSI_STATUS_CMD_COMPLETED) {
826 sc->result = DID_ERROR << 16; 857 sc->result = DID_ERROR << 16;
827 goto out; 858 goto out;
@@ -1582,6 +1613,7 @@ static inline struct iscsi_task *iscsi_alloc_task(struct iscsi_conn *conn,
1582 task->have_checked_conn = false; 1613 task->have_checked_conn = false;
1583 task->last_timeout = jiffies; 1614 task->last_timeout = jiffies;
1584 task->last_xfer = jiffies; 1615 task->last_xfer = jiffies;
1616 task->protected = false;
1585 INIT_LIST_HEAD(&task->running); 1617 INIT_LIST_HEAD(&task->running);
1586 return task; 1618 return task;
1587} 1619}
diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c
index d47ffc8d3e43..13e898332e45 100644
--- a/drivers/scsi/scsi_transport_srp.c
+++ b/drivers/scsi/scsi_transport_srp.c
@@ -810,6 +810,7 @@ EXPORT_SYMBOL_GPL(srp_remove_host);
810 810
811/** 811/**
812 * srp_stop_rport_timers - stop the transport layer recovery timers 812 * srp_stop_rport_timers - stop the transport layer recovery timers
813 * @rport: SRP remote port for which to stop the timers.
813 * 814 *
814 * Must be called after srp_remove_host() and scsi_remove_host(). The caller 815 * Must be called after srp_remove_host() and scsi_remove_host(). The caller
815 * must hold a reference on the rport (rport->dev) and on the SCSI host 816 * must hold a reference on the rport (rport->dev) and on the SCSI host