Commit d753856c authored by Linus Torvalds's avatar Linus Torvalds

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
parents 6a4bfa7c 511833ac
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#define DRV_NAME "fnic" #define DRV_NAME "fnic"
#define DRV_DESCRIPTION "Cisco FCoE HBA Driver" #define DRV_DESCRIPTION "Cisco FCoE HBA Driver"
#define DRV_VERSION "1.6.0.16" #define DRV_VERSION "1.6.0.17"
#define PFX DRV_NAME ": " #define PFX DRV_NAME ": "
#define DFX DRV_NAME "%d: " #define DFX DRV_NAME "%d: "
......
...@@ -1892,6 +1892,21 @@ int fnic_abort_cmd(struct scsi_cmnd *sc) ...@@ -1892,6 +1892,21 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
goto fnic_abort_cmd_end; goto fnic_abort_cmd_end;
} }
/* IO out of order */
if (!(CMD_FLAGS(sc) & (FNIC_IO_ABORTED | FNIC_IO_DONE))) {
spin_unlock_irqrestore(io_lock, flags);
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
"Issuing Host reset due to out of order IO\n");
if (fnic_host_reset(sc) == FAILED) {
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
"fnic_host_reset failed.\n");
}
ret = FAILED;
goto fnic_abort_cmd_end;
}
CMD_STATE(sc) = FNIC_IOREQ_ABTS_COMPLETE; CMD_STATE(sc) = FNIC_IOREQ_ABTS_COMPLETE;
/* /*
......
...@@ -1041,7 +1041,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd, ...@@ -1041,7 +1041,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,
} }
/* signal not to enter either branch of the if () below */ /* signal not to enter either branch of the if () below */
timeleft = 0; timeleft = 0;
rtn = NEEDS_RETRY; rtn = FAILED;
} else { } else {
timeleft = wait_for_completion_timeout(&done, timeout); timeleft = wait_for_completion_timeout(&done, timeout);
rtn = SUCCESS; rtn = SUCCESS;
...@@ -1081,7 +1081,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd, ...@@ -1081,7 +1081,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,
rtn = FAILED; rtn = FAILED;
break; break;
} }
} else if (!rtn) { } else if (rtn != FAILED) {
scsi_abort_eh_cmnd(scmd); scsi_abort_eh_cmnd(scmd);
rtn = FAILED; rtn = FAILED;
} }
......
...@@ -2623,8 +2623,9 @@ static void sd_read_block_limits(struct scsi_disk *sdkp) ...@@ -2623,8 +2623,9 @@ static void sd_read_block_limits(struct scsi_disk *sdkp)
sd_config_discard(sdkp, SD_LBP_WS16); sd_config_discard(sdkp, SD_LBP_WS16);
} else { /* LBP VPD page tells us what to use */ } else { /* LBP VPD page tells us what to use */
if (sdkp->lbpu && sdkp->max_unmap_blocks && !sdkp->lbprz)
if (sdkp->lbpws) sd_config_discard(sdkp, SD_LBP_UNMAP);
else if (sdkp->lbpws)
sd_config_discard(sdkp, SD_LBP_WS16); sd_config_discard(sdkp, SD_LBP_WS16);
else if (sdkp->lbpws10) else if (sdkp->lbpws10)
sd_config_discard(sdkp, SD_LBP_WS10); sd_config_discard(sdkp, SD_LBP_WS10);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment