Skip to content

Commit d753856

Browse files
committed
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 fixes: one to correct an abort path thinko causing failures (and a panic) in USB on device misbehaviour, One to fix an out of order issue in the fnic driver and one to match discard expectations to qemu which otherwise cause Linux to behave badly as a guest" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: SCSI: fix regression in scsi_send_eh_cmnd() fnic: IOMMU Fault occurs when IO and abort IO is out of order sd: tweak discard heuristics to work around QEMU SCSI issue
2 parents 6a4bfa7 + 511833a commit d753856

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

drivers/scsi/fnic/fnic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
#define DRV_NAME "fnic"
4141
#define DRV_DESCRIPTION "Cisco FCoE HBA Driver"
42-
#define DRV_VERSION "1.6.0.16"
42+
#define DRV_VERSION "1.6.0.17"
4343
#define PFX DRV_NAME ": "
4444
#define DFX DRV_NAME "%d: "
4545

drivers/scsi/fnic/fnic_scsi.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,6 +1892,21 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
18921892
goto fnic_abort_cmd_end;
18931893
}
18941894

1895+
/* IO out of order */
1896+
1897+
if (!(CMD_FLAGS(sc) & (FNIC_IO_ABORTED | FNIC_IO_DONE))) {
1898+
spin_unlock_irqrestore(io_lock, flags);
1899+
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
1900+
"Issuing Host reset due to out of order IO\n");
1901+
1902+
if (fnic_host_reset(sc) == FAILED) {
1903+
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
1904+
"fnic_host_reset failed.\n");
1905+
}
1906+
ret = FAILED;
1907+
goto fnic_abort_cmd_end;
1908+
}
1909+
18951910
CMD_STATE(sc) = FNIC_IOREQ_ABTS_COMPLETE;
18961911

18971912
/*

drivers/scsi/scsi_error.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,
10411041
}
10421042
/* signal not to enter either branch of the if () below */
10431043
timeleft = 0;
1044-
rtn = NEEDS_RETRY;
1044+
rtn = FAILED;
10451045
} else {
10461046
timeleft = wait_for_completion_timeout(&done, timeout);
10471047
rtn = SUCCESS;
@@ -1081,7 +1081,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,
10811081
rtn = FAILED;
10821082
break;
10831083
}
1084-
} else if (!rtn) {
1084+
} else if (rtn != FAILED) {
10851085
scsi_abort_eh_cmnd(scmd);
10861086
rtn = FAILED;
10871087
}

drivers/scsi/sd.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2623,8 +2623,9 @@ static void sd_read_block_limits(struct scsi_disk *sdkp)
26232623
sd_config_discard(sdkp, SD_LBP_WS16);
26242624

26252625
} else { /* LBP VPD page tells us what to use */
2626-
2627-
if (sdkp->lbpws)
2626+
if (sdkp->lbpu && sdkp->max_unmap_blocks && !sdkp->lbprz)
2627+
sd_config_discard(sdkp, SD_LBP_UNMAP);
2628+
else if (sdkp->lbpws)
26282629
sd_config_discard(sdkp, SD_LBP_WS16);
26292630
else if (sdkp->lbpws10)
26302631
sd_config_discard(sdkp, SD_LBP_WS10);

0 commit comments

Comments
 (0)