Commit 87f77d37 authored by Martin K. Petersen's avatar Martin K. Petersen
Browse files

Merge branch '5.16/scsi-fixes' into 5.17/scsi-staging



Pull in the 5.16 fixes branch to resolve a conflict in the UFS driver
core.

Conflicts:
	drivers/scsi/ufs/ufshcd.c

Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parents 8c2d0455 69002c8c
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -5090,14 +5090,9 @@ lpfc_cmpl_els_logo_acc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
		/* NPort Recovery mode or node is just allocated */
		if (!lpfc_nlp_not_used(ndlp)) {
			/* A LOGO is completing and the node is in NPR state.
			 * If this a fabric node that cleared its transport
			 * registration, release the rpi.
			 * Just unregister the RPI because the node is still
			 * required.
			 */
			spin_lock_irq(&ndlp->lock);
			ndlp->nlp_flag &= ~NLP_NPR_2B_DISC;
			if (phba->sli_rev == LPFC_SLI_REV4)
				ndlp->nlp_flag |= NLP_RELEASE_RPI;
			spin_unlock_irq(&ndlp->lock);
			lpfc_unreg_rpi(vport, ndlp);
		} else {
			/* Indicate the node has already released, should
+2 −2
Original line number Diff line number Diff line
@@ -639,8 +639,8 @@ static void _base_sync_drv_fw_timestamp(struct MPT3SAS_ADAPTER *ioc)
	mpi_request->IOCParameter = MPI26_SET_IOC_PARAMETER_SYNC_TIMESTAMP;
	current_time = ktime_get_real();
	TimeStamp = ktime_to_ms(current_time);
	mpi_request->Reserved7 = cpu_to_le32(TimeStamp & 0xFFFFFFFF);
	mpi_request->IOCParameterValue = cpu_to_le32(TimeStamp >> 32);
	mpi_request->Reserved7 = cpu_to_le32(TimeStamp >> 32);
	mpi_request->IOCParameterValue = cpu_to_le32(TimeStamp & 0xFFFFFFFF);
	init_completion(&ioc->scsih_cmds.done);
	ioc->put_smid_default(ioc, smid);
	dinitprintk(ioc, ioc_info(ioc,
+4 −0
Original line number Diff line number Diff line
@@ -142,6 +142,8 @@

#define MPT_MAX_CALLBACKS		32

#define MPT_MAX_HBA_NUM_PHYS		32

#define INTERNAL_CMDS_COUNT		10	/* reserved cmds */
/* reserved for issuing internally framed scsi io cmds */
#define INTERNAL_SCSIIO_CMDS_COUNT	3
@@ -798,6 +800,7 @@ struct _sas_phy {
 * @enclosure_handle: handle for this a member of an enclosure
 * @device_info: bitwise defining capabilities of this sas_host/expander
 * @responding: used in _scsih_expander_device_mark_responding
 * @nr_phys_allocated: Allocated memory for this many count phys
 * @phy: a list of phys that make up this sas_host/expander
 * @sas_port_list: list of ports attached to this sas_host/expander
 * @port: hba port entry containing node's port number info
@@ -813,6 +816,7 @@ struct _sas_node {
	u16	enclosure_handle;
	u64	enclosure_logical_id;
	u8	responding;
	u8	nr_phys_allocated;
	struct hba_port *port;
	struct	_sas_phy *phy;
	struct list_head sas_port_list;
+57 −2
Original line number Diff line number Diff line
@@ -3869,7 +3869,7 @@ _scsih_ublock_io_device(struct MPT3SAS_ADAPTER *ioc,

	shost_for_each_device(sdev, ioc->shost) {
		sas_device_priv_data = sdev->hostdata;
		if (!sas_device_priv_data)
		if (!sas_device_priv_data || !sas_device_priv_data->sas_target)
			continue;
		if (sas_device_priv_data->sas_target->sas_address
		    != sas_address)
@@ -6406,11 +6406,26 @@ _scsih_sas_port_refresh(struct MPT3SAS_ADAPTER *ioc)
	int i, j, count = 0, lcount = 0;
	int ret;
	u64 sas_addr;
	u8 num_phys;

	drsprintk(ioc, ioc_info(ioc,
	    "updating ports for sas_host(0x%016llx)\n",
	    (unsigned long long)ioc->sas_hba.sas_address));

	mpt3sas_config_get_number_hba_phys(ioc, &num_phys);
	if (!num_phys) {
		ioc_err(ioc, "failure at %s:%d/%s()!\n",
		    __FILE__, __LINE__, __func__);
		return;
	}

	if (num_phys > ioc->sas_hba.nr_phys_allocated) {
		ioc_err(ioc, "failure at %s:%d/%s()!\n",
		   __FILE__, __LINE__, __func__);
		return;
	}
	ioc->sas_hba.num_phys = num_phys;

	port_table = kcalloc(ioc->sas_hba.num_phys,
	    sizeof(struct hba_port), GFP_KERNEL);
	if (!port_table)
@@ -6611,6 +6626,30 @@ _scsih_sas_host_refresh(struct MPT3SAS_ADAPTER *ioc)
			ioc->sas_hba.phy[i].hba_vphy = 1;
		}

		/*
		 * Add new HBA phys to STL if these new phys got added as part
		 * of HBA Firmware upgrade/downgrade operation.
		 */
		if (!ioc->sas_hba.phy[i].phy) {
			if ((mpt3sas_config_get_phy_pg0(ioc, &mpi_reply,
							&phy_pg0, i))) {
				ioc_err(ioc, "failure at %s:%d/%s()!\n",
					__FILE__, __LINE__, __func__);
				continue;
			}
			ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
				MPI2_IOCSTATUS_MASK;
			if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
				ioc_err(ioc, "failure at %s:%d/%s()!\n",
					__FILE__, __LINE__, __func__);
				continue;
			}
			ioc->sas_hba.phy[i].phy_id = i;
			mpt3sas_transport_add_host_phy(ioc,
				&ioc->sas_hba.phy[i], phy_pg0,
				ioc->sas_hba.parent_dev);
			continue;
		}
		ioc->sas_hba.phy[i].handle = ioc->sas_hba.handle;
		attached_handle = le16_to_cpu(sas_iounit_pg0->PhyData[i].
		    AttachedDevHandle);
@@ -6622,6 +6661,19 @@ _scsih_sas_host_refresh(struct MPT3SAS_ADAPTER *ioc)
		    attached_handle, i, link_rate,
		    ioc->sas_hba.phy[i].port);
	}
	/*
	 * Clear the phy details if this phy got disabled as part of
	 * HBA Firmware upgrade/downgrade operation.
	 */
	for (i = ioc->sas_hba.num_phys;
	     i < ioc->sas_hba.nr_phys_allocated; i++) {
		if (ioc->sas_hba.phy[i].phy &&
		    ioc->sas_hba.phy[i].phy->negotiated_linkrate >=
		    SAS_LINK_RATE_1_5_GBPS)
			mpt3sas_transport_update_links(ioc,
				ioc->sas_hba.sas_address, 0, i,
				MPI2_SAS_NEG_LINK_RATE_PHY_DISABLED, NULL);
	}
 out:
	kfree(sas_iounit_pg0);
}
@@ -6654,7 +6706,10 @@ _scsih_sas_host_add(struct MPT3SAS_ADAPTER *ioc)
			__FILE__, __LINE__, __func__);
		return;
	}
	ioc->sas_hba.phy = kcalloc(num_phys,

	ioc->sas_hba.nr_phys_allocated = max_t(u8,
	    MPT_MAX_HBA_NUM_PHYS, num_phys);
	ioc->sas_hba.phy = kcalloc(ioc->sas_hba.nr_phys_allocated,
	    sizeof(struct _sas_phy), GFP_KERNEL);
	if (!ioc->sas_hba.phy) {
		ioc_err(ioc, "failure at %s:%d/%s()!\n",
+2 −4
Original line number Diff line number Diff line
@@ -282,12 +282,12 @@ static int pm8001_alloc(struct pm8001_hba_info *pm8001_ha,
	if (rc) {
		pm8001_dbg(pm8001_ha, FAIL,
			   "pm8001_setup_irq failed [ret: %d]\n", rc);
		goto err_out_shost;
		goto err_out;
	}
	/* Request Interrupt */
	rc = pm8001_request_irq(pm8001_ha);
	if (rc)
		goto err_out_shost;
		goto err_out;

	count = pm8001_ha->max_q_num;
	/* Queues are chosen based on the number of cores/msix availability */
@@ -423,8 +423,6 @@ static int pm8001_alloc(struct pm8001_hba_info *pm8001_ha,
	pm8001_tag_init(pm8001_ha);
	return 0;

err_out_shost:
	scsi_remove_host(pm8001_ha->shost);
err_out_nodev:
	for (i = 0; i < pm8001_ha->max_memcnt; i++) {
		if (pm8001_ha->memoryMap.region[i].virt_ptr != NULL) {
Loading