diff options
author | David S. Miller <davem@davemloft.net> | 2015-10-20 09:08:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-20 09:08:27 -0400 |
commit | 26440c835f8b1a491e2704118ac55bf87334366c (patch) | |
tree | 3c2d23b59fd49b252fdbf6c09efc41b354933fc6 /drivers/scsi/3w-9xxx.c | |
parent | 371f1c7e0d854796adc622cc3bacfcc5fc638db1 (diff) | |
parent | 1099f86044111e9a7807f09523e42d4c9d0fb781 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/usb/asix_common.c
net/ipv4/inet_connection_sock.c
net/switchdev/switchdev.c
In the inet_connection_sock.c case the request socket hashing scheme
is completely different in net-next.
The other two conflicts were overlapping changes.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/scsi/3w-9xxx.c')
-rw-r--r-- | drivers/scsi/3w-9xxx.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index add419d6ff34..a56a7b243e91 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c | |||
@@ -212,6 +212,17 @@ static const struct file_operations twa_fops = { | |||
212 | .llseek = noop_llseek, | 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 | /* This function will complete an aen request from the isr */ | 226 | /* This function will complete an aen request from the isr */ |
216 | static int twa_aen_complete(TW_Device_Extension *tw_dev, int request_id) | 227 | static int twa_aen_complete(TW_Device_Extension *tw_dev, int request_id) |
217 | { | 228 | { |
@@ -1339,7 +1350,8 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance) | |||
1339 | } | 1350 | } |
1340 | 1351 | ||
1341 | /* Now complete the io */ | 1352 | /* Now complete the io */ |
1342 | scsi_dma_unmap(cmd); | 1353 | if (twa_command_mapped(cmd)) |
1354 | scsi_dma_unmap(cmd); | ||
1343 | cmd->scsi_done(cmd); | 1355 | cmd->scsi_done(cmd); |
1344 | tw_dev->state[request_id] = TW_S_COMPLETED; | 1356 | tw_dev->state[request_id] = TW_S_COMPLETED; |
1345 | twa_free_request_id(tw_dev, request_id); | 1357 | twa_free_request_id(tw_dev, request_id); |
@@ -1582,7 +1594,8 @@ static int twa_reset_device_extension(TW_Device_Extension *tw_dev) | |||
1582 | struct scsi_cmnd *cmd = tw_dev->srb[i]; | 1594 | struct scsi_cmnd *cmd = tw_dev->srb[i]; |
1583 | 1595 | ||
1584 | cmd->result = (DID_RESET << 16); | 1596 | cmd->result = (DID_RESET << 16); |
1585 | scsi_dma_unmap(cmd); | 1597 | if (twa_command_mapped(cmd)) |
1598 | scsi_dma_unmap(cmd); | ||
1586 | cmd->scsi_done(cmd); | 1599 | cmd->scsi_done(cmd); |
1587 | } | 1600 | } |
1588 | } | 1601 | } |
@@ -1765,12 +1778,14 @@ static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_ | |||
1765 | retval = twa_scsiop_execute_scsi(tw_dev, request_id, NULL, 0, NULL); | 1778 | retval = twa_scsiop_execute_scsi(tw_dev, request_id, NULL, 0, NULL); |
1766 | switch (retval) { | 1779 | switch (retval) { |
1767 | case SCSI_MLQUEUE_HOST_BUSY: | 1780 | case SCSI_MLQUEUE_HOST_BUSY: |
1768 | scsi_dma_unmap(SCpnt); | 1781 | if (twa_command_mapped(SCpnt)) |
1782 | scsi_dma_unmap(SCpnt); | ||
1769 | twa_free_request_id(tw_dev, request_id); | 1783 | twa_free_request_id(tw_dev, request_id); |
1770 | break; | 1784 | break; |
1771 | case 1: | 1785 | case 1: |
1772 | SCpnt->result = (DID_ERROR << 16); | 1786 | SCpnt->result = (DID_ERROR << 16); |
1773 | scsi_dma_unmap(SCpnt); | 1787 | if (twa_command_mapped(SCpnt)) |
1788 | scsi_dma_unmap(SCpnt); | ||
1774 | done(SCpnt); | 1789 | done(SCpnt); |
1775 | tw_dev->state[request_id] = TW_S_COMPLETED; | 1790 | tw_dev->state[request_id] = TW_S_COMPLETED; |
1776 | twa_free_request_id(tw_dev, request_id); | 1791 | twa_free_request_id(tw_dev, request_id); |
@@ -1831,8 +1846,7 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, | |||
1831 | /* Map sglist from scsi layer to cmd packet */ | 1846 | /* Map sglist from scsi layer to cmd packet */ |
1832 | 1847 | ||
1833 | if (scsi_sg_count(srb)) { | 1848 | if (scsi_sg_count(srb)) { |
1834 | if ((scsi_sg_count(srb) == 1) && | 1849 | if (!twa_command_mapped(srb)) { |
1835 | (scsi_bufflen(srb) < TW_MIN_SGL_LENGTH)) { | ||
1836 | if (srb->sc_data_direction == DMA_TO_DEVICE || | 1850 | if (srb->sc_data_direction == DMA_TO_DEVICE || |
1837 | srb->sc_data_direction == DMA_BIDIRECTIONAL) | 1851 | srb->sc_data_direction == DMA_BIDIRECTIONAL) |
1838 | scsi_sg_copy_to_buffer(srb, | 1852 | scsi_sg_copy_to_buffer(srb, |
@@ -1905,7 +1919,7 @@ static void twa_scsiop_execute_scsi_complete(TW_Device_Extension *tw_dev, int re | |||
1905 | { | 1919 | { |
1906 | struct scsi_cmnd *cmd = tw_dev->srb[request_id]; | 1920 | struct scsi_cmnd *cmd = tw_dev->srb[request_id]; |
1907 | 1921 | ||
1908 | if (scsi_bufflen(cmd) < TW_MIN_SGL_LENGTH && | 1922 | if (!twa_command_mapped(cmd) && |
1909 | (cmd->sc_data_direction == DMA_FROM_DEVICE || | 1923 | (cmd->sc_data_direction == DMA_FROM_DEVICE || |
1910 | cmd->sc_data_direction == DMA_BIDIRECTIONAL)) { | 1924 | cmd->sc_data_direction == DMA_BIDIRECTIONAL)) { |
1911 | if (scsi_sg_count(cmd) == 1) { | 1925 | if (scsi_sg_count(cmd) == 1) { |