Commit 6ed92e55 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull SCSI updates from James Bottomley:
 "Updates to the usual drivers (ufs, megaraid_sas, lpfc, target, ibmvfc,
  scsi_debug) plus the usual assorted minor fixes and updates.

  The major change this time around is a prep patch for rethreading of
  the driver reset handler API not to take a scsi_cmd structure which
  starts to reduce various drivers' dependence on scsi_cmd in error
  handling"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (132 commits)
  scsi: ufs: core: Leave space for '\0' in utf8 desc string
  scsi: ufs: core: Conversion to bool not necessary
  scsi: ufs: core: Fix race between force complete and ISR
  scsi: megaraid: Fix up debug message in megaraid_abort_and_reset()
  scsi: aic79xx: Fix up NULL command in ahd_done()
  scsi: message: fusion: Initialize return value in mptfc_bus_reset()
  scsi: mpt3sas: Fix loop logic
  scsi: snic: Remove useless code in snic_dr_clean_pending_req()
  scsi: core: Add comment to target_destroy in scsi_host_template
  scsi: core: Clean up scsi_dev_queue_ready()
  scsi: pmcraid: Add missing scsi_device_put() in pmcraid_eh_target_reset_handler()
  scsi: target: core: Fix kernel-doc comment
  scsi: pmcraid: Fix kernel-doc comment
  scsi: core: Handle depopulation and restoration in progress
  scsi: ufs: core: Add support for parsing OPP
  scsi: ufs: core: Add OPP support for scaling clocks and regulators
  scsi: ufs: dt-bindings: common: Add OPP table
  scsi: scsi_debug: Add param to control sdev's allow_restart
  scsi: scsi_debug: Add debugfs interface to fail target reset
  scsi: scsi_debug: Add new error injection type: Reset LUN failed
  ...
parents 90a300dc a75a16c6
Loading
Loading
Loading
Loading
+32 −3
Original line number Diff line number Diff line
@@ -20,11 +20,25 @@ properties:
      items:
        - description: Minimum frequency for given clock in Hz
        - description: Maximum frequency for given clock in Hz
    deprecated: true
    description: |
      Preferred is operating-points-v2.

      Array of <min max> operating frequencies in Hz stored in the same order
      as the clocks property. If this property is not defined or a value in the
      array is "0" then it is assumed that the frequency is set by the parent
      clock or a fixed rate clock source.
      as the clocks property. If either this property or operating-points-v2 is
      not defined or a value in the array is "0" then it is assumed that the
      frequency is set by the parent clock or a fixed rate clock source.

  operating-points-v2:
    description:
      Preferred over freq-table-hz.
      If present, each OPP must contain array of frequencies stored in the same
      order for each clock.  If clock frequency in the array is "0" then it is
      assumed that the frequency is set by the parent clock or a fixed rate
      clock source.

  opp-table:
    type: object

  interrupts:
    maxItems: 1
@@ -75,8 +89,23 @@ properties:

dependencies:
  freq-table-hz: [ clocks ]
  operating-points-v2: [ clocks, clock-names ]

required:
  - interrupts

allOf:
  - if:
      required:
        - freq-table-hz
    then:
      properties:
        operating-points-v2: false
  - if:
      required:
        - operating-points-v2
    then:
      properties:
        freq-table-hz: false

additionalProperties: true
+1 −2
Original line number Diff line number Diff line
@@ -11221,7 +11221,6 @@ M: Sagi Grimberg <sagi@grimberg.me>
L:	linux-rdma@vger.kernel.org
L:	target-devel@vger.kernel.org
S:	Supported
W:	http://www.linux-iscsi.org
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master
F:	drivers/infiniband/ulp/isert
@@ -13623,6 +13622,7 @@ MEGARAID SCSI/SAS DRIVERS
M:	Kashyap Desai <kashyap.desai@broadcom.com>
M:	Sumit Saxena <sumit.saxena@broadcom.com>
M:	Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
M:	Chandrakanth patil <chandrakanth.patil@broadcom.com>
L:	megaraidlinux.pdl@broadcom.com
L:	linux-scsi@vger.kernel.org
S:	Maintained
@@ -19275,7 +19275,6 @@ M: "Martin K. Petersen" <martin.petersen@oracle.com>
L:	linux-scsi@vger.kernel.org
L:	target-devel@vger.kernel.org
S:	Supported
W:	http://www.linux-iscsi.org
Q:	https://patchwork.kernel.org/project/target-devel/list/
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
F:	Documentation/target/
+3 −0
Original line number Diff line number Diff line
@@ -3867,6 +3867,9 @@ static const struct target_core_fabric_ops srpt_template = {
	.tfc_discovery_attrs		= srpt_da_attrs,
	.tfc_wwn_attrs			= srpt_wwn_attrs,
	.tfc_tpg_attrib_attrs		= srpt_tpg_attrib_attrs,

	.default_submit_type		= TARGET_DIRECT_SUBMIT,
	.direct_submit_supp		= 1,
};

/**
+9 −10
Original line number Diff line number Diff line
@@ -1328,8 +1328,8 @@ mptctl_getiocinfo (MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size)

	/* Set the Version Strings.
	 */
	strncpy (karg->driverVersion, MPT_LINUX_PACKAGE_NAME, MPT_IOCTL_VERSION_LENGTH);
	karg->driverVersion[MPT_IOCTL_VERSION_LENGTH-1]='\0';
	strscpy_pad(karg->driverVersion, MPT_LINUX_PACKAGE_NAME,
		    sizeof(karg->driverVersion));

	karg->busChangeEvent = 0;
	karg->hostId = ioc->pfacts[port].PortSCSIID;
@@ -1493,10 +1493,8 @@ mptctl_readtest (MPT_ADAPTER *ioc, unsigned long arg)
#else
	karg.chip_type = ioc->pcidev->device;
#endif
	strncpy (karg.name, ioc->name, MPT_MAX_NAME);
	karg.name[MPT_MAX_NAME-1]='\0';
	strncpy (karg.product, ioc->prod_name, MPT_PRODUCT_LENGTH);
	karg.product[MPT_PRODUCT_LENGTH-1]='\0';
	strscpy_pad(karg.name, ioc->name, sizeof(karg.name));
	strscpy_pad(karg.product, ioc->prod_name, sizeof(karg.product));

	/* Copy the data from kernel memory to user memory
	 */
@@ -2394,7 +2392,7 @@ mptctl_hp_hostinfo(MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size)
	cfg.dir = 0;	/* read */
	cfg.timeout = 10;

	strncpy(karg.serial_number, " ", 24);
	strscpy_pad(karg.serial_number, " ", sizeof(karg.serial_number));
	if (mpt_config(ioc, &cfg) == 0) {
		if (cfg.cfghdr.hdr->PageLength > 0) {
			/* Issue the second config page request */
@@ -2408,8 +2406,9 @@ mptctl_hp_hostinfo(MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size)
				if (mpt_config(ioc, &cfg) == 0) {
					ManufacturingPage0_t *pdata = (ManufacturingPage0_t *) pbuf;
					if (strlen(pdata->BoardTracerNumber) > 1) {
						strscpy(karg.serial_number,
							pdata->BoardTracerNumber, 24);
						strscpy_pad(karg.serial_number,
							pdata->BoardTracerNumber,
							sizeof(karg.serial_number));
					}
				}
				dma_free_coherent(&ioc->pcidev->dev,
+65 −29
Original line number Diff line number Diff line
@@ -183,73 +183,109 @@ static struct fc_function_template mptfc_transport_functions = {
};

static int
mptfc_block_error_handler(struct scsi_cmnd *SCpnt,
			  int (*func)(struct scsi_cmnd *SCpnt),
			  const char *caller)
mptfc_block_error_handler(struct fc_rport *rport)
{
	MPT_SCSI_HOST		*hd;
	struct scsi_device	*sdev = SCpnt->device;
	struct Scsi_Host	*shost = sdev->host;
	struct fc_rport		*rport = starget_to_rport(scsi_target(sdev));
	struct Scsi_Host	*shost = rport_to_shost(rport);
	unsigned long		flags;
	int			ready;
	MPT_ADAPTER		*ioc;
	int			loops = 40;	/* seconds */

	hd = shost_priv(SCpnt->device->host);
	hd = shost_priv(shost);
	ioc = hd->ioc;
	spin_lock_irqsave(shost->host_lock, flags);
	while ((ready = fc_remote_port_chkready(rport) >> 16) == DID_IMM_RETRY
	 || (loops > 0 && ioc->active == 0)) {
		spin_unlock_irqrestore(shost->host_lock, flags);
		dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT
			"mptfc_block_error_handler.%d: %d:%llu, port status is "
			"%x, active flag %d, deferring %s recovery.\n",
			"mptfc_block_error_handler.%d: %s, port status is "
			"%x, active flag %d, deferring recovery.\n",
			ioc->name, ioc->sh->host_no,
			SCpnt->device->id, SCpnt->device->lun,
			ready, ioc->active, caller));
			dev_name(&rport->dev), ready, ioc->active));
		msleep(1000);
		spin_lock_irqsave(shost->host_lock, flags);
		loops --;
	}
	spin_unlock_irqrestore(shost->host_lock, flags);

	if (ready == DID_NO_CONNECT || !SCpnt->device->hostdata
	 || ioc->active == 0) {
	if (ready == DID_NO_CONNECT || ioc->active == 0) {
		dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT
			"%s.%d: %d:%llu, failing recovery, "
			"port state %x, active %d, vdevice %p.\n", caller,
			"mpt_block_error_handler.%d: %s, failing recovery, "
			"port state %x, active %d.\n",
			ioc->name, ioc->sh->host_no,
			SCpnt->device->id, SCpnt->device->lun, ready,
			ioc->active, SCpnt->device->hostdata));
			dev_name(&rport->dev), ready, ioc->active));
		return FAILED;
	}
	dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT
		"%s.%d: %d:%llu, executing recovery.\n", caller,
		ioc->name, ioc->sh->host_no,
		SCpnt->device->id, SCpnt->device->lun));
	return (*func)(SCpnt);
	return SUCCESS;
}

static int
mptfc_abort(struct scsi_cmnd *SCpnt)
{
	return
	    mptfc_block_error_handler(SCpnt, mptscsih_abort, __func__);
	struct Scsi_Host *shost = SCpnt->device->host;
	struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device));
	MPT_SCSI_HOST __maybe_unused *hd = shost_priv(shost);
	int rtn;

	rtn = mptfc_block_error_handler(rport);
	if (rtn == SUCCESS) {
		dfcprintk (hd->ioc, printk(MYIOC_s_DEBUG_FMT
			"%s.%d: %d:%llu, executing recovery.\n", __func__,
			hd->ioc->name, shost->host_no,
			SCpnt->device->id, SCpnt->device->lun));
		rtn = mptscsih_abort(SCpnt);
	}
	return rtn;
}

static int
mptfc_dev_reset(struct scsi_cmnd *SCpnt)
{
	return
	    mptfc_block_error_handler(SCpnt, mptscsih_dev_reset, __func__);
	struct Scsi_Host *shost = SCpnt->device->host;
	struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device));
	MPT_SCSI_HOST __maybe_unused *hd = shost_priv(shost);
	int rtn;

	rtn = mptfc_block_error_handler(rport);
	if (rtn == SUCCESS) {
		dfcprintk (hd->ioc, printk(MYIOC_s_DEBUG_FMT
			"%s.%d: %d:%llu, executing recovery.\n", __func__,
			hd->ioc->name, shost->host_no,
			SCpnt->device->id, SCpnt->device->lun));
		rtn = mptscsih_dev_reset(SCpnt);
	}
	return rtn;
}

static int
mptfc_bus_reset(struct scsi_cmnd *SCpnt)
{
	return
	    mptfc_block_error_handler(SCpnt, mptscsih_bus_reset, __func__);
	struct Scsi_Host *shost = SCpnt->device->host;
	MPT_SCSI_HOST __maybe_unused *hd = shost_priv(shost);
	int channel = SCpnt->device->channel;
	struct mptfc_rport_info *ri;
	int rtn = FAILED;

	list_for_each_entry(ri, &hd->ioc->fc_rports, list) {
		if (ri->flags & MPT_RPORT_INFO_FLAGS_REGISTERED) {
			VirtTarget *vtarget = ri->starget->hostdata;

			if (!vtarget || vtarget->channel != channel)
				continue;
			rtn = fc_block_rport(ri->rport);
			if (rtn != 0)
				break;
		}
	}
	if (rtn == 0) {
		dfcprintk (hd->ioc, printk(MYIOC_s_DEBUG_FMT
			"%s.%d: %d:%llu, executing recovery.\n", __func__,
			hd->ioc->name, shost->host_no,
			SCpnt->device->id, SCpnt->device->lun));
		rtn = mptscsih_bus_reset(SCpnt);
	}
	return rtn;
}

static void
Loading