Commit 0b311e34 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull more SCSI updates from James Bottomley:
 "This is a few driver updates (iscsi, mpt3sas) that were still in the
  staging queue when the merge window opened (all committed on or before
  8 Feb) and some small bug fixes which came in during the merge window
  (all committed on 22 Feb)"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (30 commits)
  scsi: hpsa: Correct dev cmds outstanding for retried cmds
  scsi: sd: Fix Opal support
  scsi: target: tcmu: Fix memory leak caused by wrong uio usage
  scsi: target: tcmu: Move some functions without code change
  scsi: sd: sd_zbc: Don't pass GFP_NOIO to kvcalloc
  scsi: aic7xxx: Remove unused function pointer typedef ahc_bus_suspend/resume_t
  scsi: bnx2fc: Fix Kconfig warning & CNIC build errors
  scsi: ufs: Fix a duplicate dev quirk number
  scsi: aic79xx: Fix spelling of version
  scsi: target: core: Prevent underflow for service actions
  scsi: target: core: Add cmd length set before cmd complete
  scsi: iscsi: Drop session lock in iscsi_session_chkready()
  scsi: qla4xxx: Use iscsi_is_session_online()
  scsi: libiscsi: Reset max/exp cmdsn during recovery
  scsi: iscsi_tcp: Fix shost can_queue initialization
  scsi: libiscsi: Add helper to calculate max SCSI cmds per session
  scsi: libiscsi: Fix iSCSI host workq destruction
  scsi: libiscsi: Fix iscsi_task use after free()
  scsi: libiscsi: Drop taskqueuelock
  scsi: libiscsi: Fix iscsi_prep_scsi_cmd_pdu() error handling
  ...
parents 03dc748b f749d8b7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1175,7 +1175,7 @@ struct ahd_softc {
	uint8_t			  tqinfifonext;

	/*
	 * Cached verson of the hs_mailbox so we can avoid
	 * Cached version of the hs_mailbox so we can avoid
	 * pausing the sequencer during mailbox updates.
	 */
	uint8_t			  hs_mailbox;
+0 −2
Original line number Diff line number Diff line
@@ -896,8 +896,6 @@ union ahc_bus_softc {

typedef void (*ahc_bus_intr_t)(struct ahc_softc *);
typedef int (*ahc_bus_chip_init_t)(struct ahc_softc *);
typedef int (*ahc_bus_suspend_t)(struct ahc_softc *);
typedef int (*ahc_bus_resume_t)(struct ahc_softc *);
typedef void ahc_callback_t (void *);

struct ahc_softc {
+1 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ config SCSI_BNX2X_FCOE
	depends on (IPV6 || IPV6=n)
	depends on LIBFC
	depends on LIBFCOE
	depends on MMU
	select NETDEVICES
	select ETHERNET
	select NET_VENDOR_BROADCOM
+0 −2
Original line number Diff line number Diff line
@@ -1171,10 +1171,8 @@ static void bnx2i_cleanup_task(struct iscsi_task *task)
		bnx2i_send_cmd_cleanup_req(hba, task->dd_data);

		spin_unlock_bh(&conn->session->back_lock);
		spin_unlock_bh(&conn->session->frwd_lock);
		wait_for_completion_timeout(&bnx2i_conn->cmd_cleanup_cmpl,
				msecs_to_jiffies(ISCSI_CMD_CLEANUP_TIMEOUT));
		spin_lock_bh(&conn->session->frwd_lock);
		spin_lock_bh(&conn->session->back_lock);
	}
	bnx2i_iscsi_unmap_sg_list(task->dd_data);
+44 −7
Original line number Diff line number Diff line
@@ -1151,7 +1151,10 @@ static void __enqueue_cmd_and_start_io(struct ctlr_info *h,
{
	dial_down_lockup_detection_during_fw_flash(h, c);
	atomic_inc(&h->commands_outstanding);
	if (c->device)
	/*
	 * Check to see if the command is being retried.
	 */
	if (c->device && !c->retry_pending)
		atomic_inc(&c->device->commands_outstanding);

	reply_queue = h->reply_map[raw_smp_processor_id()];
@@ -5567,7 +5570,8 @@ static inline void hpsa_cmd_partial_init(struct ctlr_info *h, int index,
}

static int hpsa_ioaccel_submit(struct ctlr_info *h,
		struct CommandList *c, struct scsi_cmnd *cmd)
		struct CommandList *c, struct scsi_cmnd *cmd,
		bool retry)
{
	struct hpsa_scsi_dev_t *dev = cmd->device->hostdata;
	int rc = IO_ACCEL_INELIGIBLE;
@@ -5584,18 +5588,22 @@ static int hpsa_ioaccel_submit(struct ctlr_info *h,
	cmd->host_scribble = (unsigned char *) c;

	if (dev->offload_enabled) {
		hpsa_cmd_init(h, c->cmdindex, c);
		hpsa_cmd_init(h, c->cmdindex, c); /* Zeroes out all fields */
		c->cmd_type = CMD_SCSI;
		c->scsi_cmd = cmd;
		c->device = dev;
		if (retry) /* Resubmit but do not increment device->commands_outstanding. */
			c->retry_pending = true;
		rc = hpsa_scsi_ioaccel_raid_map(h, c);
		if (rc < 0)     /* scsi_dma_map failed. */
			rc = SCSI_MLQUEUE_HOST_BUSY;
	} else if (dev->hba_ioaccel_enabled) {
		hpsa_cmd_init(h, c->cmdindex, c);
		hpsa_cmd_init(h, c->cmdindex, c); /* Zeroes out all fields */
		c->cmd_type = CMD_SCSI;
		c->scsi_cmd = cmd;
		c->device = dev;
		if (retry) /* Resubmit but do not increment device->commands_outstanding. */
			c->retry_pending = true;
		rc = hpsa_scsi_ioaccel_direct_map(h, c);
		if (rc < 0)     /* scsi_dma_map failed. */
			rc = SCSI_MLQUEUE_HOST_BUSY;
@@ -5628,7 +5636,8 @@ static void hpsa_command_resubmit_worker(struct work_struct *work)

		if (c2->error_data.serv_response ==
				IOACCEL2_STATUS_SR_TASK_COMP_SET_FULL) {
			rc = hpsa_ioaccel_submit(h, c, cmd);
			/* Resubmit with the retry_pending flag set. */
			rc = hpsa_ioaccel_submit(h, c, cmd, true);
			if (rc == 0)
				return;
			if (rc == SCSI_MLQUEUE_HOST_BUSY) {
@@ -5644,6 +5653,15 @@ static void hpsa_command_resubmit_worker(struct work_struct *work)
		}
	}
	hpsa_cmd_partial_init(c->h, c->cmdindex, c);
	/*
	 * Here we have not come in though queue_command, so we
	 * can set the retry_pending flag to true for a driver initiated
	 * retry attempt (I.E. not a SML retry).
	 * I.E. We are submitting a driver initiated retry.
	 * Note: hpsa_ciss_submit does not zero out the command fields like
	 *       ioaccel submit does.
	 */
	c->retry_pending = true;
	if (hpsa_ciss_submit(c->h, c, cmd, dev)) {
		/*
		 * If we get here, it means dma mapping failed. Try
@@ -5706,11 +5724,16 @@ static int hpsa_scsi_queue_command(struct Scsi_Host *sh, struct scsi_cmnd *cmd)
	/*
	 * Call alternate submit routine for I/O accelerated commands.
	 * Retries always go down the normal I/O path.
	 * Note: If cmd->retries is non-zero, then this is a SML
	 *       initiated retry and not a driver initiated retry.
	 *       This command has been obtained from cmd_tagged_alloc
	 *       and is therefore a brand-new command.
	 */
	if (likely(cmd->retries == 0 &&
			!blk_rq_is_passthrough(cmd->request) &&
			h->acciopath_status)) {
		rc = hpsa_ioaccel_submit(h, c, cmd);
		/* Submit with the retry_pending flag unset. */
		rc = hpsa_ioaccel_submit(h, c, cmd, false);
		if (rc == 0)
			return 0;
		if (rc == SCSI_MLQUEUE_HOST_BUSY) {
@@ -6105,6 +6128,7 @@ static int hpsa_eh_device_reset_handler(struct scsi_cmnd *scsicmd)
 * at init, and managed by cmd_tagged_alloc() and cmd_tagged_free() using the
 * block request tag as an index into a table of entries.  cmd_tagged_free() is
 * the complement, although cmd_free() may be called instead.
 * This function is only called for new requests from queue_command.
 */
static struct CommandList *cmd_tagged_alloc(struct ctlr_info *h,
					    struct scsi_cmnd *scmd)
@@ -6139,8 +6163,14 @@ static struct CommandList *cmd_tagged_alloc(struct ctlr_info *h,
	}

	atomic_inc(&c->refcount);

	hpsa_cmd_partial_init(h, idx, c);

	/*
	 * This is a new command obtained from queue_command so
	 * there have not been any driver initiated retry attempts.
	 */
	c->retry_pending = false;

	return c;
}

@@ -6208,6 +6238,13 @@ static struct CommandList *cmd_alloc(struct ctlr_info *h)
	}
	hpsa_cmd_partial_init(h, i, c);
	c->device = NULL;

	/*
	 * cmd_alloc is for "internal" commands and they are never
	 * retried.
	 */
	c->retry_pending = false;

	return c;
}

Loading