Commit 7308e927 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull SCSI fixes from James Bottomley:
 "Eleven small fixes, ten in drivers.

  Of the two fixes marked core, one is in the raid helper class (used by
  some raid device drivers) and the other one is the /proc/scsi/scsi
  parsing fix for potential reads beyond the end of the buffer"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: qedf: Fix firmware halt over suspend and resume
  scsi: qedi: Fix firmware halt over suspend and resume
  scsi: qedi: Fix potential deadlock on &qedi_percpu->p_work_lock
  scsi: lpfc: Remove reftag check in DIF paths
  scsi: ufs: renesas: Fix private allocation
  scsi: snic: Fix possible memory leak if device_add() fails
  scsi: core: Fix possible memory leak if device_add() fails
  scsi: core: Fix legacy /proc parsing buffer overflow
  scsi: 53c700: Check that command slot is not NULL
  scsi: fnic: Replace return codes in fnic_clean_pending_aborts()
  scsi: storvsc: Fix handling of virtual Fibre Channel timeouts
parents a785fd28 ef222f55
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1598,7 +1598,7 @@ NCR_700_intr(int irq, void *dev_id)
				printk("scsi%d (%d:%d) PHASE MISMATCH IN SEND MESSAGE %d remain, return %p[%04x], phase %s\n", host->host_no, pun, lun, count, (void *)temp, temp - hostdata->pScript, sbcl_to_string(NCR_700_readb(host, SBCL_REG)));
#endif
				resume_offset = hostdata->pScript + Ent_SendMessagePhaseMismatch;
			} else if(dsp >= to32bit(&slot->pSG[0].ins) &&
			} else if (slot && dsp >= to32bit(&slot->pSG[0].ins) &&
				  dsp <= to32bit(&slot->pSG[NCR_700_SG_SEGMENTS].ins)) {
				int data_transfer = NCR_700_readl(host, DBC_REG) & 0xffffff;
				int SGcount = (dsp - to32bit(&slot->pSG[0].ins))/sizeof(struct NCR_700_SG_List);
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@

#define DRV_NAME		"fnic"
#define DRV_DESCRIPTION		"Cisco FCoE HBA Driver"
#define DRV_VERSION		"1.6.0.54"
#define DRV_VERSION		"1.6.0.55"
#define PFX			DRV_NAME ": "
#define DFX                     DRV_NAME "%d: "

+4 −2
Original line number Diff line number Diff line
@@ -2139,7 +2139,7 @@ static int fnic_clean_pending_aborts(struct fnic *fnic,
				     bool new_sc)

{
	int ret = SUCCESS;
	int ret = 0;
	struct fnic_pending_aborts_iter_data iter_data = {
		.fnic = fnic,
		.lun_dev = lr_sc->device,
@@ -2159,9 +2159,11 @@ static int fnic_clean_pending_aborts(struct fnic *fnic,

	/* walk again to check, if IOs are still pending in fw */
	if (fnic_is_abts_pending(fnic, lr_sc))
		ret = FAILED;
		ret = 1;

clean_pending_aborts_end:
	FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host,
			"%s: exit status: %d\n", __func__, ret);
	return ret;
}

+3 −17
Original line number Diff line number Diff line
@@ -109,8 +109,6 @@ lpfc_sli4_set_rsp_sgl_last(struct lpfc_hba *phba,
	}
}

#define LPFC_INVALID_REFTAG ((u32)-1)

/**
 * lpfc_rampdown_queue_depth - Post RAMP_DOWN_QUEUE event to worker thread
 * @phba: The Hba for which this call is being executed.
@@ -978,8 +976,6 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc,

	sgpe = scsi_prot_sglist(sc);
	lba = scsi_prot_ref_tag(sc);
	if (lba == LPFC_INVALID_REFTAG)
		return 0;

	/* First check if we need to match the LBA */
	if (phba->lpfc_injerr_lba != LPFC_INJERR_LBA_OFF) {
@@ -1560,8 +1556,6 @@ lpfc_bg_setup_bpl(struct lpfc_hba *phba, struct scsi_cmnd *sc,

	/* extract some info from the scsi command for pde*/
	reftag = scsi_prot_ref_tag(sc);
	if (reftag == LPFC_INVALID_REFTAG)
		goto out;

#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
	rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1);
@@ -1723,8 +1717,6 @@ lpfc_bg_setup_bpl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc,
	/* extract some info from the scsi command */
	blksize = scsi_prot_interval(sc);
	reftag = scsi_prot_ref_tag(sc);
	if (reftag == LPFC_INVALID_REFTAG)
		goto out;

#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
	rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1);
@@ -1953,8 +1945,6 @@ lpfc_bg_setup_sgl(struct lpfc_hba *phba, struct scsi_cmnd *sc,

	/* extract some info from the scsi command for pde*/
	reftag = scsi_prot_ref_tag(sc);
	if (reftag == LPFC_INVALID_REFTAG)
		goto out;

#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
	rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1);
@@ -2154,8 +2144,6 @@ lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc,
	/* extract some info from the scsi command */
	blksize = scsi_prot_interval(sc);
	reftag = scsi_prot_ref_tag(sc);
	if (reftag == LPFC_INVALID_REFTAG)
		goto out;

#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
	rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1);
@@ -2746,8 +2734,6 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd)

		src = (struct scsi_dif_tuple *)sg_virt(sgpe);
		start_ref_tag = scsi_prot_ref_tag(cmd);
		if (start_ref_tag == LPFC_INVALID_REFTAG)
			goto out;
		start_app_tag = src->app_tag;
		len = sgpe->length;
		while (src && protsegcnt) {
@@ -3494,10 +3480,10 @@ lpfc_bg_scsi_prep_dma_buf_s4(struct lpfc_hba *phba,

	lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
			"9084 Cannot setup S/G List for HBA "
			"IO segs %d/%d SGL %d SCSI %d: %d %d\n",
			"IO segs %d/%d SGL %d SCSI %d: %d %d %d\n",
			lpfc_cmd->seg_cnt, lpfc_cmd->prot_seg_cnt,
			phba->cfg_total_seg_cnt, phba->cfg_sg_seg_cnt,
			prot_group_type, num_sge);
			prot_group_type, num_sge, ret);

	lpfc_cmd->seg_cnt = 0;
	lpfc_cmd->prot_seg_cnt = 0;
+18 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ static void qedf_remove(struct pci_dev *pdev);
static void qedf_shutdown(struct pci_dev *pdev);
static void qedf_schedule_recovery_handler(void *dev);
static void qedf_recovery_handler(struct work_struct *work);
static int qedf_suspend(struct pci_dev *pdev, pm_message_t state);

/*
 * Driver module parameters.
@@ -3271,6 +3272,7 @@ static struct pci_driver qedf_pci_driver = {
	.probe = qedf_probe,
	.remove = qedf_remove,
	.shutdown = qedf_shutdown,
	.suspend = qedf_suspend,
};

static int __qedf_probe(struct pci_dev *pdev, int mode)
@@ -4000,6 +4002,22 @@ static void qedf_shutdown(struct pci_dev *pdev)
	__qedf_remove(pdev, QEDF_MODE_NORMAL);
}

static int qedf_suspend(struct pci_dev *pdev, pm_message_t state)
{
	struct qedf_ctx *qedf;

	if (!pdev) {
		QEDF_ERR(NULL, "pdev is NULL.\n");
		return -ENODEV;
	}

	qedf = pci_get_drvdata(pdev);

	QEDF_ERR(&qedf->dbg_ctx, "%s: Device does not support suspend operation\n", __func__);

	return -EPERM;
}

/*
 * Recovery handler code
 */
Loading