Commit 15cfb0f0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull SCSI fixes from James Bottomley:
 "Twelve minor fixes, all in drivers or doc.

  Most of the fixes are pretty obvious (although we had two goes to get
  the UFS sysfs doc right) and the biggest change is in the ufs driver
  which they've extensively tested"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: ibmvfc: Set default timeout to avoid crash during migration
  scsi: target: tcmu: Fix use-after-free of se_cmd->priv
  scsi: fnic: Fix memleak in vnic_dev_init_devcmd2
  scsi: libfc: Avoid invoking response handler twice if ep is already completed
  scsi: scsi_transport_srp: Don't block target in failfast state
  scsi: docs: ABI: sysfs-driver-ufs: Rectify table formatting
  scsi: ufs: Fix tm request when non-fatal error happens
  scsi: ufs: Fix livelock of ufshcd_clear_ua_wluns()
  scsi: ibmvfc: Fix missing cast of ibmvfc_event pointer to u64 handle
  scsi: ufs: ufshcd-pltfrm depends on HAS_IOMEM
  scsi: megaraid_sas: Fix MEGASAS_IOC_FIRMWARE regression
  scsi: docs: ABI: sysfs-driver-ufs: Add DeepSleep power mode
parents 929b9796 76490729
Loading
Loading
Loading
Loading
+22 −14
Original line number Diff line number Diff line
@@ -916,21 +916,25 @@ Date: September 2014
Contact:	Subhash Jadavani <subhashj@codeaurora.org>
Description:	This entry could be used to set or show the UFS device
		runtime power management level. The current driver
		implementation supports 6 levels with next target states:
		implementation supports 7 levels with next target states:

		==  ====================================================
		0   an UFS device will stay active, an UIC link will
		0   UFS device will stay active, UIC link will
		    stay active
		1   an UFS device will stay active, an UIC link will
		1   UFS device will stay active, UIC link will
		    hibernate
		2   an UFS device will moved to sleep, an UIC link will
		2   UFS device will be moved to sleep, UIC link will
		    stay active
		3   an UFS device will moved to sleep, an UIC link will
		3   UFS device will be moved to sleep, UIC link will
		    hibernate
		4   an UFS device will be powered off, an UIC link will
		4   UFS device will be powered off, UIC link will
		    hibernate
		5   an UFS device will be powered off, an UIC link will
		5   UFS device will be powered off, UIC link will
		    be powered off
		6   UFS device will be moved to deep sleep, UIC link
		    will be powered off. Note, deep sleep might not be
		    supported in which case this value will not be
		    accepted
		==  ====================================================

What:		/sys/bus/platform/drivers/ufshcd/*/rpm_target_dev_state
@@ -954,21 +958,25 @@ Date: September 2014
Contact:	Subhash Jadavani <subhashj@codeaurora.org>
Description:	This entry could be used to set or show the UFS device
		system power management level. The current driver
		implementation supports 6 levels with next target states:
		implementation supports 7 levels with next target states:

		==  ====================================================
		0   an UFS device will stay active, an UIC link will
		0   UFS device will stay active, UIC link will
		    stay active
		1   an UFS device will stay active, an UIC link will
		1   UFS device will stay active, UIC link will
		    hibernate
		2   an UFS device will moved to sleep, an UIC link will
		2   UFS device will be moved to sleep, UIC link will
		    stay active
		3   an UFS device will moved to sleep, an UIC link will
		3   UFS device will be moved to sleep, UIC link will
		    hibernate
		4   an UFS device will be powered off, an UIC link will
		4   UFS device will be powered off, UIC link will
		    hibernate
		5   an UFS device will be powered off, an UIC link will
		5   UFS device will be powered off, UIC link will
		    be powered off
		6   UFS device will be moved to deep sleep, UIC link
		    will be powered off. Note, deep sleep might not be
		    supported in which case this value will not be
		    accepted
		==  ====================================================

What:		/sys/bus/platform/drivers/ufshcd/*/spm_target_dev_state
+5 −3
Original line number Diff line number Diff line
@@ -444,7 +444,8 @@ static int vnic_dev_init_devcmd2(struct vnic_dev *vdev)
	fetch_index = ioread32(&vdev->devcmd2->wq.ctrl->fetch_index);
	if (fetch_index == 0xFFFFFFFF) { /* check for hardware gone  */
		pr_err("error in devcmd2 init");
		return -ENODEV;
		err = -ENODEV;
		goto err_free_wq;
	}

	/*
@@ -460,7 +461,7 @@ static int vnic_dev_init_devcmd2(struct vnic_dev *vdev)
	err = vnic_dev_alloc_desc_ring(vdev, &vdev->devcmd2->results_ring,
			DEVCMD2_RING_SIZE, DEVCMD2_DESC_SIZE);
	if (err)
		goto err_free_wq;
		goto err_disable_wq;

	vdev->devcmd2->result =
		(struct devcmd2_result *) vdev->devcmd2->results_ring.descs;
@@ -481,8 +482,9 @@ static int vnic_dev_init_devcmd2(struct vnic_dev *vdev)

err_free_desc_ring:
	vnic_dev_free_desc_ring(vdev, &vdev->devcmd2->results_ring);
err_free_wq:
err_disable_wq:
	vnic_wq_disable(&vdev->devcmd2->wq);
err_free_wq:
	vnic_wq_free(&vdev->devcmd2->wq);
err_free_devcmd2:
	kfree(vdev->devcmd2);
+5 −3
Original line number Diff line number Diff line
@@ -1744,7 +1744,7 @@ static int ibmvfc_queuecommand_lck(struct scsi_cmnd *cmnd,
		iu->pri_task_attr = IBMVFC_SIMPLE_TASK;
	}

	vfc_cmd->correlation = cpu_to_be64(evt);
	vfc_cmd->correlation = cpu_to_be64((u64)evt);

	if (likely(!(rc = ibmvfc_map_sg_data(cmnd, evt, vfc_cmd, vhost->dev))))
		return ibmvfc_send_event(evt, vhost, 0);
@@ -2418,7 +2418,7 @@ static int ibmvfc_abort_task_set(struct scsi_device *sdev)
		tmf->flags = cpu_to_be16((IBMVFC_NO_MEM_DESC | IBMVFC_TMF));
		evt->sync_iu = &rsp_iu;

		tmf->correlation = cpu_to_be64(evt);
		tmf->correlation = cpu_to_be64((u64)evt);

		init_completion(&evt->comp);
		rsp_rc = ibmvfc_send_event(evt, vhost, default_timeout);
@@ -3007,8 +3007,10 @@ static int ibmvfc_slave_configure(struct scsi_device *sdev)
	unsigned long flags = 0;

	spin_lock_irqsave(shost->host_lock, flags);
	if (sdev->type == TYPE_DISK)
	if (sdev->type == TYPE_DISK) {
		sdev->allow_restart = 1;
		blk_queue_rq_timeout(sdev->request_queue, 120 * HZ);
	}
	spin_unlock_irqrestore(shost->host_lock, flags);
	return 0;
}
+14 −2
Original line number Diff line number Diff line
@@ -1623,8 +1623,13 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
		rc = fc_exch_done_locked(ep);
		WARN_ON(fc_seq_exch(sp) != ep);
		spin_unlock_bh(&ep->ex_lock);
		if (!rc)
		if (!rc) {
			fc_exch_delete(ep);
		} else {
			FC_EXCH_DBG(ep, "ep is completed already,"
					"hence skip calling the resp\n");
			goto skip_resp;
		}
	}

	/*
@@ -1643,6 +1648,7 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
	if (!fc_invoke_resp(ep, sp, fp))
		fc_frame_free(fp);

skip_resp:
	fc_exch_release(ep);
	return;
rel:
@@ -1899,10 +1905,16 @@ static void fc_exch_reset(struct fc_exch *ep)

	fc_exch_hold(ep);

	if (!rc)
	if (!rc) {
		fc_exch_delete(ep);
	} else {
		FC_EXCH_DBG(ep, "ep is completed already,"
				"hence skip calling the resp\n");
		goto skip_resp;
	}

	fc_invoke_resp(ep, sp, ERR_PTR(-FC_EX_CLOSED));
skip_resp:
	fc_seq_set_resp(sp, NULL, ep->arg);
	fc_exch_release(ep);
}
+2 −4
Original line number Diff line number Diff line
@@ -8244,11 +8244,9 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
			goto out;
		}

		/* always store 64 bits regardless of addressing */
		sense_ptr = (void *)cmd->frame + ioc->sense_off;
		if (instance->consistent_mask_64bit)
		put_unaligned_le64(sense_handle, sense_ptr);
		else
			put_unaligned_le32(sense_handle, sense_ptr);
	}

	/*
Loading