Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
"This is a set of six fixes and a MAINTAINER update.

The fixes are two multipath (one in Test Unit Ready handling for the
path checkers and one in the section of code that sends a start unit
after failover; both of these were perturbed by the scsi-mq update), a
CD-ROM door locking fix that was likewise introduced by scsi-mq and
three driver fixes for a previous code update in cxgb4i, megaraid_sas
and bnx2fc"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
bnx2fc: fix tgt spinlock locking
megaraid_sas: fix bug in handling return value of pci_enable_msix_range()
cxgb4i: send abort_rpl correctly
cxgbi: add maintainer for cxgb3i/cxgb4i
scsi: TUR path is down after adapter gets reset with multipath
scsi: call device handler for failed TUR command
scsi: only re-lock door after EH on devices that were reset

Changed files
+60 -37
drivers
+14
MAINTAINERS
··· 2744 2744 S: Supported 2745 2745 F: drivers/net/ethernet/chelsio/cxgb3/ 2746 2746 2747 + CXGB3 ISCSI DRIVER (CXGB3I) 2748 + M: Karen Xie <kxie@chelsio.com> 2749 + L: linux-scsi@vger.kernel.org 2750 + W: http://www.chelsio.com 2751 + S: Supported 2752 + F: drivers/scsi/cxgbi/cxgb3i 2753 + 2747 2754 CXGB3 IWARP RNIC DRIVER (IW_CXGB3) 2748 2755 M: Steve Wise <swise@chelsio.com> 2749 2756 L: linux-rdma@vger.kernel.org ··· 2764 2757 W: http://www.chelsio.com 2765 2758 S: Supported 2766 2759 F: drivers/net/ethernet/chelsio/cxgb4/ 2760 + 2761 + CXGB4 ISCSI DRIVER (CXGB4I) 2762 + M: Karen Xie <kxie@chelsio.com> 2763 + L: linux-scsi@vger.kernel.org 2764 + W: http://www.chelsio.com 2765 + S: Supported 2766 + F: drivers/scsi/cxgbi/cxgb4i 2767 2767 2768 2768 CXGB4 IWARP RNIC DRIVER (IW_CXGB4) 2769 2769 M: Steve Wise <swise@chelsio.com>
-2
drivers/scsi/bnx2fc/bnx2fc_els.c
··· 480 480 bnx2fc_initiate_cleanup(orig_io_req); 481 481 /* Post a new IO req with the same sc_cmd */ 482 482 BNX2FC_IO_DBG(rec_req, "Post IO request again\n"); 483 - spin_unlock_bh(&tgt->tgt_lock); 484 483 rc = bnx2fc_post_io_req(tgt, new_io_req); 485 - spin_lock_bh(&tgt->tgt_lock); 486 484 if (!rc) 487 485 goto free_frame; 488 486 BNX2FC_IO_DBG(rec_req, "REC: io post err\n");
+10 -9
drivers/scsi/bnx2fc/bnx2fc_io.c
··· 1894 1894 goto exit_qcmd; 1895 1895 } 1896 1896 } 1897 + 1898 + spin_lock_bh(&tgt->tgt_lock); 1899 + 1897 1900 io_req = bnx2fc_cmd_alloc(tgt); 1898 1901 if (!io_req) { 1899 1902 rc = SCSI_MLQUEUE_HOST_BUSY; 1900 - goto exit_qcmd; 1903 + goto exit_qcmd_tgtlock; 1901 1904 } 1902 1905 io_req->sc_cmd = sc_cmd; 1903 1906 1904 1907 if (bnx2fc_post_io_req(tgt, io_req)) { 1905 1908 printk(KERN_ERR PFX "Unable to post io_req\n"); 1906 1909 rc = SCSI_MLQUEUE_HOST_BUSY; 1907 - goto exit_qcmd; 1910 + goto exit_qcmd_tgtlock; 1908 1911 } 1912 + 1913 + exit_qcmd_tgtlock: 1914 + spin_unlock_bh(&tgt->tgt_lock); 1909 1915 exit_qcmd: 1910 1916 return rc; 1911 1917 } ··· 2026 2020 int task_idx, index; 2027 2021 u16 xid; 2028 2022 2023 + /* bnx2fc_post_io_req() is called with the tgt_lock held */ 2024 + 2029 2025 /* Initialize rest of io_req fields */ 2030 2026 io_req->cmd_type = BNX2FC_SCSI_CMD; 2031 2027 io_req->port = port; ··· 2055 2047 /* Build buffer descriptor list for firmware from sg list */ 2056 2048 if (bnx2fc_build_bd_list_from_sg(io_req)) { 2057 2049 printk(KERN_ERR PFX "BD list creation failed\n"); 2058 - spin_lock_bh(&tgt->tgt_lock); 2059 2050 kref_put(&io_req->refcount, bnx2fc_cmd_release); 2060 - spin_unlock_bh(&tgt->tgt_lock); 2061 2051 return -EAGAIN; 2062 2052 } 2063 2053 ··· 2067 2061 task = &(task_page[index]); 2068 2062 bnx2fc_init_task(io_req, task); 2069 2063 2070 - spin_lock_bh(&tgt->tgt_lock); 2071 - 2072 2064 if (tgt->flush_in_prog) { 2073 2065 printk(KERN_ERR PFX "Flush in progress..Host Busy\n"); 2074 2066 kref_put(&io_req->refcount, bnx2fc_cmd_release); 2075 - spin_unlock_bh(&tgt->tgt_lock); 2076 2067 return -EAGAIN; 2077 2068 } 2078 2069 2079 2070 if (!test_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags)) { 2080 2071 printk(KERN_ERR PFX "Session not ready...post_io\n"); 2081 2072 kref_put(&io_req->refcount, bnx2fc_cmd_release); 2082 - spin_unlock_bh(&tgt->tgt_lock); 2083 2073 return -EAGAIN; 2084 2074 } 2085 2075 ··· 2093 2091 2094 2092 /* Ring doorbell */ 2095 2093 bnx2fc_ring_doorbell(tgt); 2096 - spin_unlock_bh(&tgt->tgt_lock); 2097 2094 return 0; 2098 2095 }
+9 -6
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
··· 936 936 cxgbi_sock_get(csk); 937 937 spin_lock_bh(&csk->lock); 938 938 939 - if (!cxgbi_sock_flag(csk, CTPF_ABORT_REQ_RCVD)) { 940 - cxgbi_sock_set_flag(csk, CTPF_ABORT_REQ_RCVD); 941 - cxgbi_sock_set_state(csk, CTP_ABORTING); 942 - goto done; 939 + cxgbi_sock_clear_flag(csk, CTPF_ABORT_REQ_RCVD); 940 + 941 + if (!cxgbi_sock_flag(csk, CTPF_TX_DATA_SENT)) { 942 + send_tx_flowc_wr(csk); 943 + cxgbi_sock_set_flag(csk, CTPF_TX_DATA_SENT); 943 944 } 944 945 945 - cxgbi_sock_clear_flag(csk, CTPF_ABORT_REQ_RCVD); 946 + cxgbi_sock_set_flag(csk, CTPF_ABORT_REQ_RCVD); 947 + cxgbi_sock_set_state(csk, CTP_ABORTING); 948 + 946 949 send_abort_rpl(csk, rst_status); 947 950 948 951 if (!cxgbi_sock_flag(csk, CTPF_ABORT_RPL_PENDING)) { 949 952 csk->err = abort_status_to_errno(csk, req->status, &rst_status); 950 953 cxgbi_sock_closed(csk); 951 954 } 952 - done: 955 + 953 956 spin_unlock_bh(&csk->lock); 954 957 cxgbi_sock_put(csk); 955 958 rel_skb:
+8 -10
drivers/scsi/cxgbi/libcxgbi.c
··· 905 905 { 906 906 cxgbi_sock_get(csk); 907 907 spin_lock_bh(&csk->lock); 908 + 909 + cxgbi_sock_set_flag(csk, CTPF_ABORT_RPL_RCVD); 908 910 if (cxgbi_sock_flag(csk, CTPF_ABORT_RPL_PENDING)) { 909 - if (!cxgbi_sock_flag(csk, CTPF_ABORT_RPL_RCVD)) 910 - cxgbi_sock_set_flag(csk, CTPF_ABORT_RPL_RCVD); 911 - else { 912 - cxgbi_sock_clear_flag(csk, CTPF_ABORT_RPL_RCVD); 913 - cxgbi_sock_clear_flag(csk, CTPF_ABORT_RPL_PENDING); 914 - if (cxgbi_sock_flag(csk, CTPF_ABORT_REQ_RCVD)) 915 - pr_err("csk 0x%p,%u,0x%lx,%u,ABT_RPL_RSS.\n", 916 - csk, csk->state, csk->flags, csk->tid); 917 - cxgbi_sock_closed(csk); 918 - } 911 + cxgbi_sock_clear_flag(csk, CTPF_ABORT_RPL_PENDING); 912 + if (cxgbi_sock_flag(csk, CTPF_ABORT_REQ_RCVD)) 913 + pr_err("csk 0x%p,%u,0x%lx,%u,ABT_RPL_RSS.\n", 914 + csk, csk->state, csk->flags, csk->tid); 915 + cxgbi_sock_closed(csk); 919 916 } 917 + 920 918 spin_unlock_bh(&csk->lock); 921 919 cxgbi_sock_put(csk); 922 920 }
+7
drivers/scsi/device_handler/scsi_dh_alua.c
··· 474 474 * LUN Not Ready -- Offline 475 475 */ 476 476 return SUCCESS; 477 + if (sdev->allow_restart && 478 + sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x02) 479 + /* 480 + * if the device is not started, we need to wake 481 + * the error handler to start the motor 482 + */ 483 + return FAILED; 477 484 break; 478 485 case UNIT_ATTENTION: 479 486 if (sense_hdr->asc == 0x29 && sense_hdr->ascq == 0x00)
+1 -1
drivers/scsi/megaraid/megaraid_sas_base.c
··· 4453 4453 instance->msixentry[i].entry = i; 4454 4454 i = pci_enable_msix_range(instance->pdev, instance->msixentry, 4455 4455 1, instance->msix_vectors); 4456 - if (i) 4456 + if (i > 0) 4457 4457 instance->msix_vectors = i; 4458 4458 else 4459 4459 instance->msix_vectors = 0;
+11 -9
drivers/scsi/scsi_error.c
··· 459 459 if (! scsi_command_normalize_sense(scmd, &sshdr)) 460 460 return FAILED; /* no valid sense data */ 461 461 462 - if (scmd->cmnd[0] == TEST_UNIT_READY && scmd->scsi_done != scsi_eh_done) 463 - /* 464 - * nasty: for mid-layer issued TURs, we need to return the 465 - * actual sense data without any recovery attempt. For eh 466 - * issued ones, we need to try to recover and interpret 467 - */ 468 - return SUCCESS; 469 - 470 462 scsi_report_sense(sdev, &sshdr); 471 463 472 464 if (scsi_sense_is_deferred(&sshdr)) ··· 473 481 return rc; 474 482 /* handler does not care. Drop down to default handling */ 475 483 } 484 + 485 + if (scmd->cmnd[0] == TEST_UNIT_READY && scmd->scsi_done != scsi_eh_done) 486 + /* 487 + * nasty: for mid-layer issued TURs, we need to return the 488 + * actual sense data without any recovery attempt. For eh 489 + * issued ones, we need to try to recover and interpret 490 + */ 491 + return SUCCESS; 476 492 477 493 /* 478 494 * Previous logic looked for FILEMARK, EOM or ILI which are ··· 2001 2001 * is no point trying to lock the door of an off-line device. 2002 2002 */ 2003 2003 shost_for_each_device(sdev, shost) { 2004 - if (scsi_device_online(sdev) && sdev->locked) 2004 + if (scsi_device_online(sdev) && sdev->was_reset && sdev->locked) { 2005 2005 scsi_eh_lock_door(sdev); 2006 + sdev->was_reset = 0; 2007 + } 2006 2008 } 2007 2009 2008 2010 /*