Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f09ff1de authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull SCSI fixes from James Bottomley:
 "This is a set of 12 fixes including the mpt3sas one that was causing
  hangs on ATA passthrough.

  The others are a couple of zoned block device fixes, a SAS device
  detection bug which lead to SATA drives not being matched to bays, two
  qla2xxx MSI fixes, a qla2xxx req for rsp confusion caused by cut and
  paste, and a few other minor fixes"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: mpt3sas: fix hang on ata passthrough commands
  scsi: lpfc: Set elsiocb contexts to NULL after freeing it
  scsi: sd: Ignore zoned field for host-managed devices
  scsi: sd: Fix wrong DPOFUA disable in sd_read_cache_type
  scsi: bfa: fix wrongly initialized variable in bfad_im_bsg_els_ct_request()
  scsi: ses: Fix SAS device detection in enclosure
  scsi: libfc: Fix variable name in fc_set_wwpn
  scsi: lpfc: avoid double free of resource identifiers
  scsi: qla2xxx: remove irq_affinity_notifier
  scsi: qla2xxx: fix MSI-X vector affinity
  scsi: qla2xxx: Fix apparent cut-n-paste error.
  scsi: qla2xxx: Get mutex lock before checking optrom_state
parents f8f2d4bd 9208b75e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -3363,7 +3363,7 @@ bfad_im_bsg_els_ct_request(struct bsg_job *job)
	struct bfad_fcxp    *drv_fcxp;
	struct bfad_fcxp    *drv_fcxp;
	struct bfa_fcs_lport_s *fcs_port;
	struct bfa_fcs_lport_s *fcs_port;
	struct bfa_fcs_rport_s *fcs_rport;
	struct bfa_fcs_rport_s *fcs_rport;
	struct fc_bsg_request *bsg_request = bsg_request;
	struct fc_bsg_request *bsg_request = job->request;
	struct fc_bsg_reply *bsg_reply = job->reply;
	struct fc_bsg_reply *bsg_reply = job->reply;
	uint32_t command_type = bsg_request->msgcode;
	uint32_t command_type = bsg_request->msgcode;
	unsigned long flags;
	unsigned long flags;
+2 −0
Original line number Original line Diff line number Diff line
@@ -3590,12 +3590,14 @@ lpfc_els_free_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *elsiocb)
		} else {
		} else {
			buf_ptr1 = (struct lpfc_dmabuf *) elsiocb->context2;
			buf_ptr1 = (struct lpfc_dmabuf *) elsiocb->context2;
			lpfc_els_free_data(phba, buf_ptr1);
			lpfc_els_free_data(phba, buf_ptr1);
			elsiocb->context2 = NULL;
		}
		}
	}
	}


	if (elsiocb->context3) {
	if (elsiocb->context3) {
		buf_ptr = (struct lpfc_dmabuf *) elsiocb->context3;
		buf_ptr = (struct lpfc_dmabuf *) elsiocb->context3;
		lpfc_els_free_bpl(phba, buf_ptr);
		lpfc_els_free_bpl(phba, buf_ptr);
		elsiocb->context3 = NULL;
	}
	}
	lpfc_sli_release_iocbq(phba, elsiocb);
	lpfc_sli_release_iocbq(phba, elsiocb);
	return 0;
	return 0;
+7 −0
Original line number Original line Diff line number Diff line
@@ -5954,18 +5954,25 @@ lpfc_sli4_alloc_resource_identifiers(struct lpfc_hba *phba)
 free_vfi_bmask:
 free_vfi_bmask:
	kfree(phba->sli4_hba.vfi_bmask);
	kfree(phba->sli4_hba.vfi_bmask);
	phba->sli4_hba.vfi_bmask = NULL;
 free_xri_ids:
 free_xri_ids:
	kfree(phba->sli4_hba.xri_ids);
	kfree(phba->sli4_hba.xri_ids);
	phba->sli4_hba.xri_ids = NULL;
 free_xri_bmask:
 free_xri_bmask:
	kfree(phba->sli4_hba.xri_bmask);
	kfree(phba->sli4_hba.xri_bmask);
	phba->sli4_hba.xri_bmask = NULL;
 free_vpi_ids:
 free_vpi_ids:
	kfree(phba->vpi_ids);
	kfree(phba->vpi_ids);
	phba->vpi_ids = NULL;
 free_vpi_bmask:
 free_vpi_bmask:
	kfree(phba->vpi_bmask);
	kfree(phba->vpi_bmask);
	phba->vpi_bmask = NULL;
 free_rpi_ids:
 free_rpi_ids:
	kfree(phba->sli4_hba.rpi_ids);
	kfree(phba->sli4_hba.rpi_ids);
	phba->sli4_hba.rpi_ids = NULL;
 free_rpi_bmask:
 free_rpi_bmask:
	kfree(phba->sli4_hba.rpi_bmask);
	kfree(phba->sli4_hba.rpi_bmask);
	phba->sli4_hba.rpi_bmask = NULL;
 err_exit:
 err_exit:
	return rc;
	return rc;
}
}
+12 −0
Original line number Original line Diff line number Diff line
@@ -393,6 +393,7 @@ struct MPT3SAS_TARGET {
 * @eedp_enable: eedp support enable bit
 * @eedp_enable: eedp support enable bit
 * @eedp_type: 0(type_1), 1(type_2), 2(type_3)
 * @eedp_type: 0(type_1), 1(type_2), 2(type_3)
 * @eedp_block_length: block size
 * @eedp_block_length: block size
 * @ata_command_pending: SATL passthrough outstanding for device
 */
 */
struct MPT3SAS_DEVICE {
struct MPT3SAS_DEVICE {
	struct MPT3SAS_TARGET *sas_target;
	struct MPT3SAS_TARGET *sas_target;
@@ -404,6 +405,17 @@ struct MPT3SAS_DEVICE {
	u8	ignore_delay_remove;
	u8	ignore_delay_remove;
	/* Iopriority Command Handling */
	/* Iopriority Command Handling */
	u8	ncq_prio_enable;
	u8	ncq_prio_enable;
	/*
	 * Bug workaround for SATL handling: the mpt2/3sas firmware
	 * doesn't return BUSY or TASK_SET_FULL for subsequent
	 * commands while a SATL pass through is in operation as the
	 * spec requires, it simply does nothing with them until the
	 * pass through completes, causing them possibly to timeout if
	 * the passthrough is a long executing command (like format or
	 * secure erase).  This variable allows us to do the right
	 * thing while a SATL command is pending.
	 */
	unsigned long ata_command_pending;


};
};


+26 −14
Original line number Original line Diff line number Diff line
@@ -3899,9 +3899,18 @@ _scsih_temp_threshold_events(struct MPT3SAS_ADAPTER *ioc,
	}
	}
}
}


static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd)
static int _scsih_set_satl_pending(struct scsi_cmnd *scmd, bool pending)
{
{
	return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16);
	struct MPT3SAS_DEVICE *priv = scmd->device->hostdata;

	if (scmd->cmnd[0] != ATA_12 && scmd->cmnd[0] != ATA_16)
		return 0;

	if (pending)
		return test_and_set_bit(0, &priv->ata_command_pending);

	clear_bit(0, &priv->ata_command_pending);
	return 0;
}
}


/**
/**
@@ -3925,9 +3934,7 @@ _scsih_flush_running_cmds(struct MPT3SAS_ADAPTER *ioc)
		if (!scmd)
		if (!scmd)
			continue;
			continue;
		count++;
		count++;
		if (ata_12_16_cmd(scmd))
		_scsih_set_satl_pending(scmd, false);
			scsi_internal_device_unblock(scmd->device,
							SDEV_RUNNING);
		mpt3sas_base_free_smid(ioc, smid);
		mpt3sas_base_free_smid(ioc, smid);
		scsi_dma_unmap(scmd);
		scsi_dma_unmap(scmd);
		if (ioc->pci_error_recovery)
		if (ioc->pci_error_recovery)
@@ -4063,13 +4070,6 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
	if (ioc->logging_level & MPT_DEBUG_SCSI)
	if (ioc->logging_level & MPT_DEBUG_SCSI)
		scsi_print_command(scmd);
		scsi_print_command(scmd);


	/*
	 * Lock the device for any subsequent command until command is
	 * done.
	 */
	if (ata_12_16_cmd(scmd))
		scsi_internal_device_block(scmd->device);

	sas_device_priv_data = scmd->device->hostdata;
	sas_device_priv_data = scmd->device->hostdata;
	if (!sas_device_priv_data || !sas_device_priv_data->sas_target) {
	if (!sas_device_priv_data || !sas_device_priv_data->sas_target) {
		scmd->result = DID_NO_CONNECT << 16;
		scmd->result = DID_NO_CONNECT << 16;
@@ -4083,6 +4083,19 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
		return 0;
		return 0;
	}
	}


	/*
	 * Bug work around for firmware SATL handling.  The loop
	 * is based on atomic operations and ensures consistency
	 * since we're lockless at this point
	 */
	do {
		if (test_bit(0, &sas_device_priv_data->ata_command_pending)) {
			scmd->result = SAM_STAT_BUSY;
			scmd->scsi_done(scmd);
			return 0;
		}
	} while (_scsih_set_satl_pending(scmd, true));

	sas_target_priv_data = sas_device_priv_data->sas_target;
	sas_target_priv_data = sas_device_priv_data->sas_target;


	/* invalid device handle */
	/* invalid device handle */
@@ -4650,8 +4663,7 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply)
	if (scmd == NULL)
	if (scmd == NULL)
		return 1;
		return 1;


	if (ata_12_16_cmd(scmd))
	_scsih_set_satl_pending(scmd, false);
		scsi_internal_device_unblock(scmd->device, SDEV_RUNNING);


	mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
	mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);


Loading