Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 three bug fixes, two of which are regressions from
recent updates (the 3ware one from 4.1 and the device handler fixes
from 4.2)"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
3w-9xxx: don't unmap bounce buffered commands
scsi_dh: Use the correct module name when loading device handler
libiscsi: Fix iscsi_check_transport_timeouts possible infinite loop

+33 -14
+21 -7
drivers/scsi/3w-9xxx.c
··· 212 212 .llseek = noop_llseek, 213 213 }; 214 214 215 + /* 216 + * The controllers use an inline buffer instead of a mapped SGL for small, 217 + * single entry buffers. Note that we treat a zero-length transfer like 218 + * a mapped SGL. 219 + */ 220 + static bool twa_command_mapped(struct scsi_cmnd *cmd) 221 + { 222 + return scsi_sg_count(cmd) != 1 || 223 + scsi_bufflen(cmd) >= TW_MIN_SGL_LENGTH; 224 + } 225 + 215 226 /* This function will complete an aen request from the isr */ 216 227 static int twa_aen_complete(TW_Device_Extension *tw_dev, int request_id) 217 228 { ··· 1350 1339 } 1351 1340 1352 1341 /* Now complete the io */ 1353 - scsi_dma_unmap(cmd); 1342 + if (twa_command_mapped(cmd)) 1343 + scsi_dma_unmap(cmd); 1354 1344 cmd->scsi_done(cmd); 1355 1345 tw_dev->state[request_id] = TW_S_COMPLETED; 1356 1346 twa_free_request_id(tw_dev, request_id); ··· 1594 1582 struct scsi_cmnd *cmd = tw_dev->srb[i]; 1595 1583 1596 1584 cmd->result = (DID_RESET << 16); 1597 - scsi_dma_unmap(cmd); 1585 + if (twa_command_mapped(cmd)) 1586 + scsi_dma_unmap(cmd); 1598 1587 cmd->scsi_done(cmd); 1599 1588 } 1600 1589 } ··· 1778 1765 retval = twa_scsiop_execute_scsi(tw_dev, request_id, NULL, 0, NULL); 1779 1766 switch (retval) { 1780 1767 case SCSI_MLQUEUE_HOST_BUSY: 1781 - scsi_dma_unmap(SCpnt); 1768 + if (twa_command_mapped(SCpnt)) 1769 + scsi_dma_unmap(SCpnt); 1782 1770 twa_free_request_id(tw_dev, request_id); 1783 1771 break; 1784 1772 case 1: 1785 1773 SCpnt->result = (DID_ERROR << 16); 1786 - scsi_dma_unmap(SCpnt); 1774 + if (twa_command_mapped(SCpnt)) 1775 + scsi_dma_unmap(SCpnt); 1787 1776 done(SCpnt); 1788 1777 tw_dev->state[request_id] = TW_S_COMPLETED; 1789 1778 twa_free_request_id(tw_dev, request_id); ··· 1846 1831 /* Map sglist from scsi layer to cmd packet */ 1847 1832 1848 1833 if (scsi_sg_count(srb)) { 1849 - if ((scsi_sg_count(srb) == 1) && 1850 - (scsi_bufflen(srb) < TW_MIN_SGL_LENGTH)) { 1834 + if (!twa_command_mapped(srb)) { 1851 1835 if (srb->sc_data_direction == DMA_TO_DEVICE || 1852 1836 srb->sc_data_direction == DMA_BIDIRECTIONAL) 1853 1837 scsi_sg_copy_to_buffer(srb, ··· 1919 1905 { 1920 1906 struct scsi_cmnd *cmd = tw_dev->srb[request_id]; 1921 1907 1922 - if (scsi_bufflen(cmd) < TW_MIN_SGL_LENGTH && 1908 + if (!twa_command_mapped(cmd) && 1923 1909 (cmd->sc_data_direction == DMA_FROM_DEVICE || 1924 1910 cmd->sc_data_direction == DMA_BIDIRECTIONAL)) { 1925 1911 if (scsi_sg_count(cmd) == 1) {
+11 -6
drivers/scsi/libiscsi.c
··· 976 976 wake_up(&conn->ehwait); 977 977 } 978 978 979 - static void iscsi_send_nopout(struct iscsi_conn *conn, struct iscsi_nopin *rhdr) 979 + static int iscsi_send_nopout(struct iscsi_conn *conn, struct iscsi_nopin *rhdr) 980 980 { 981 981 struct iscsi_nopout hdr; 982 982 struct iscsi_task *task; 983 983 984 984 if (!rhdr && conn->ping_task) 985 - return; 985 + return -EINVAL; 986 986 987 987 memset(&hdr, 0, sizeof(struct iscsi_nopout)); 988 988 hdr.opcode = ISCSI_OP_NOOP_OUT | ISCSI_OP_IMMEDIATE; ··· 996 996 hdr.ttt = RESERVED_ITT; 997 997 998 998 task = __iscsi_conn_send_pdu(conn, (struct iscsi_hdr *)&hdr, NULL, 0); 999 - if (!task) 999 + if (!task) { 1000 1000 iscsi_conn_printk(KERN_ERR, conn, "Could not send nopout\n"); 1001 - else if (!rhdr) { 1001 + return -EIO; 1002 + } else if (!rhdr) { 1002 1003 /* only track our nops */ 1003 1004 conn->ping_task = task; 1004 1005 conn->last_ping = jiffies; 1005 1006 } 1007 + 1008 + return 0; 1006 1009 } 1007 1010 1008 1011 static int iscsi_nop_out_rsp(struct iscsi_task *task, ··· 2095 2092 if (time_before_eq(last_recv + recv_timeout, jiffies)) { 2096 2093 /* send a ping to try to provoke some traffic */ 2097 2094 ISCSI_DBG_CONN(conn, "Sending nopout as ping\n"); 2098 - iscsi_send_nopout(conn, NULL); 2099 - next_timeout = conn->last_ping + (conn->ping_timeout * HZ); 2095 + if (iscsi_send_nopout(conn, NULL)) 2096 + next_timeout = jiffies + (1 * HZ); 2097 + else 2098 + next_timeout = conn->last_ping + (conn->ping_timeout * HZ); 2100 2099 } else 2101 2100 next_timeout = last_recv + recv_timeout; 2102 2101
+1 -1
drivers/scsi/scsi_dh.c
··· 111 111 112 112 dh = __scsi_dh_lookup(name); 113 113 if (!dh) { 114 - request_module(name); 114 + request_module("scsi_dh_%s", name); 115 115 dh = __scsi_dh_lookup(name); 116 116 } 117 117