Commit fe764a75 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull SCSI fixes and updates from James Bottomley:
 "Fully half this pull is updates to lpfc and qla2xxx which got
  committed just as the merge window opened. A sizeable fraction of the
  driver updates are simple bug fixes (and lock reworks for bug fixes in
  the case of lpfc), so rather than splitting the few actual
  enhancements out, we're just adding the drivers to the -rc1 pull.

  The enhancements for lpfc are log message removals, copyright updates
  and three patches redefining types. For qla2xxx it's just removing a
  debug message on module removal and the manufacturer detail update.

  The two major fixes are the sg teardown race and a core error leg
  problem with the procfs directory not being removed if we destroy a
  created host that never got to the running state. The rest are minor
  fixes and constifications"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (41 commits)
  scsi: bnx2fc: Remove spin_lock_bh while releasing resources after upload
  scsi: core: Fix unremoved procfs host directory regression
  scsi: mpi3mr: Avoid memcpy field-spanning write WARNING
  scsi: sd: Fix TCG OPAL unlock on system resume
  scsi: sg: Avoid sg device teardown race
  scsi: lpfc: Copyright updates for 14.4.0.1 patches
  scsi: lpfc: Update lpfc version to 14.4.0.1
  scsi: lpfc: Define types in a union for generic void *context3 ptr
  scsi: lpfc: Define lpfc_dmabuf type for ctx_buf ptr
  scsi: lpfc: Define lpfc_nodelist type for ctx_ndlp ptr
  scsi: lpfc: Use a dedicated lock for ras_fwlog state
  scsi: lpfc: Release hbalock before calling lpfc_worker_wake_up()
  scsi: lpfc: Replace hbalock with ndlp lock in lpfc_nvme_unregister_port()
  scsi: lpfc: Update lpfc_ramp_down_queue_handler() logic
  scsi: lpfc: Remove IRQF_ONESHOT flag from threaded IRQ handling
  scsi: lpfc: Move NPIV's transport unregistration to after resource clean up
  scsi: lpfc: Remove unnecessary log message in queuecommand path
  scsi: qla2xxx: Update version to 10.02.09.200-k
  scsi: qla2xxx: Delay I/O Abort on PCI error
  scsi: qla2xxx: Change debug message during driver unload
  ...
parents ac672718 c214ed2a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -712,10 +712,12 @@ void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap)
				ehc->saved_ncq_enabled |= 1 << devno;

			/* If we are resuming, wake up the device */
			if (ap->pflags & ATA_PFLAG_RESUMING)
			if (ap->pflags & ATA_PFLAG_RESUMING) {
				dev->flags |= ATA_DFLAG_RESUMING;
				ehc->i.dev_action[devno] |= ATA_EH_SET_ACTIVE;
			}
		}
	}

	ap->pflags |= ATA_PFLAG_EH_IN_PROGRESS;
	ap->pflags &= ~ATA_PFLAG_EH_PENDING;
@@ -3169,6 +3171,7 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link,
	return 0;

 err:
	dev->flags &= ~ATA_DFLAG_RESUMING;
	*r_failed_dev = dev;
	return rc;
}
+9 −0
Original line number Diff line number Diff line
@@ -4730,6 +4730,7 @@ void ata_scsi_dev_rescan(struct work_struct *work)
	struct ata_link *link;
	struct ata_device *dev;
	unsigned long flags;
	bool do_resume;
	int ret = 0;

	mutex_lock(&ap->scsi_scan_mutex);
@@ -4751,7 +4752,15 @@ void ata_scsi_dev_rescan(struct work_struct *work)
			if (scsi_device_get(sdev))
				continue;

			do_resume = dev->flags & ATA_DFLAG_RESUMING;

			spin_unlock_irqrestore(ap->lock, flags);
			if (do_resume) {
				ret = scsi_resume_device(sdev);
				if (ret == -EWOULDBLOCK)
					goto unlock;
				dev->flags &= ~ATA_DFLAG_RESUMING;
			}
			ret = scsi_rescan_device(sdev);
			scsi_device_put(sdev);
			spin_lock_irqsave(ap->lock, flags);
+0 −2
Original line number Diff line number Diff line
@@ -833,7 +833,6 @@ static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba,

	BNX2FC_TGT_DBG(tgt, "Freeing up session resources\n");

	spin_lock_bh(&tgt->cq_lock);
	ctx_base_ptr = tgt->ctx_base;
	tgt->ctx_base = NULL;

@@ -889,7 +888,6 @@ static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba,
				    tgt->sq, tgt->sq_dma);
		tgt->sq = NULL;
	}
	spin_unlock_bh(&tgt->cq_lock);

	if (ctx_base_ptr)
		iounmap(ctx_base_ptr);
+10 −10
Original line number Diff line number Diff line
@@ -102,7 +102,9 @@ do { \

#define MAX_RETRIES   1

static struct class * ch_sysfs_class;
static const struct class ch_sysfs_class = {
	.name = "scsi_changer",
};

typedef struct {
	struct kref         ref;
@@ -930,7 +932,7 @@ static int ch_probe(struct device *dev)
	mutex_init(&ch->lock);
	kref_init(&ch->ref);
	ch->device = sd;
	class_dev = device_create(ch_sysfs_class, dev,
	class_dev = device_create(&ch_sysfs_class, dev,
				  MKDEV(SCSI_CHANGER_MAJOR, ch->minor), ch,
				  "s%s", ch->name);
	if (IS_ERR(class_dev)) {
@@ -955,7 +957,7 @@ static int ch_probe(struct device *dev)

	return 0;
destroy_dev:
	device_destroy(ch_sysfs_class, MKDEV(SCSI_CHANGER_MAJOR, ch->minor));
	device_destroy(&ch_sysfs_class, MKDEV(SCSI_CHANGER_MAJOR, ch->minor));
put_device:
	scsi_device_put(sd);
remove_idr:
@@ -974,7 +976,7 @@ static int ch_remove(struct device *dev)
	dev_set_drvdata(dev, NULL);
	spin_unlock(&ch_index_lock);

	device_destroy(ch_sysfs_class, MKDEV(SCSI_CHANGER_MAJOR,ch->minor));
	device_destroy(&ch_sysfs_class, MKDEV(SCSI_CHANGER_MAJOR, ch->minor));
	scsi_device_put(ch->device);
	kref_put(&ch->ref, ch_destroy);
	return 0;
@@ -1003,11 +1005,9 @@ static int __init init_ch_module(void)
	int rc;

	printk(KERN_INFO "SCSI Media Changer driver v" VERSION " \n");
        ch_sysfs_class = class_create("scsi_changer");
        if (IS_ERR(ch_sysfs_class)) {
		rc = PTR_ERR(ch_sysfs_class);
	rc = class_register(&ch_sysfs_class);
	if (rc)
		return rc;
        }
	rc = register_chrdev(SCSI_CHANGER_MAJOR,"ch",&changer_fops);
	if (rc < 0) {
		printk("Unable to get major %d for SCSI-Changer\n",
@@ -1022,7 +1022,7 @@ static int __init init_ch_module(void)
 fail2:
	unregister_chrdev(SCSI_CHANGER_MAJOR, "ch");
 fail1:
	class_destroy(ch_sysfs_class);
	class_unregister(&ch_sysfs_class);
	return rc;
}

@@ -1030,7 +1030,7 @@ static void __exit exit_ch_module(void)
{
	scsi_unregister_driver(&ch_template.gendrv);
	unregister_chrdev(SCSI_CHANGER_MAJOR, "ch");
	class_destroy(ch_sysfs_class);
	class_unregister(&ch_sysfs_class);
	idr_destroy(&ch_index_idr);
}

+10 −7
Original line number Diff line number Diff line
@@ -28,7 +28,12 @@ MODULE_AUTHOR("Manoj N. Kumar <manoj@linux.vnet.ibm.com>");
MODULE_AUTHOR("Matthew R. Ochs <mrochs@linux.vnet.ibm.com>");
MODULE_LICENSE("GPL");

static struct class *cxlflash_class;
static char *cxlflash_devnode(const struct device *dev, umode_t *mode);
static const struct class cxlflash_class = {
	.name = "cxlflash",
	.devnode = cxlflash_devnode,
};

static u32 cxlflash_major;
static DECLARE_BITMAP(cxlflash_minor, CXLFLASH_MAX_ADAPTERS);

@@ -3602,7 +3607,7 @@ static int init_chrdev(struct cxlflash_cfg *cfg)
		goto err1;
	}

	char_dev = device_create(cxlflash_class, NULL, devno,
	char_dev = device_create(&cxlflash_class, NULL, devno,
				 NULL, "cxlflash%d", minor);
	if (IS_ERR(char_dev)) {
		rc = PTR_ERR(char_dev);
@@ -3880,14 +3885,12 @@ static int cxlflash_class_init(void)

	cxlflash_major = MAJOR(devno);

	cxlflash_class = class_create("cxlflash");
	if (IS_ERR(cxlflash_class)) {
		rc = PTR_ERR(cxlflash_class);
	rc = class_register(&cxlflash_class);
	if (rc) {
		pr_err("%s: class_create failed rc=%d\n", __func__, rc);
		goto err;
	}

	cxlflash_class->devnode = cxlflash_devnode;
out:
	pr_debug("%s: returning rc=%d\n", __func__, rc);
	return rc;
@@ -3903,7 +3906,7 @@ static void cxlflash_class_exit(void)
{
	dev_t devno = MKDEV(cxlflash_major, 0);

	class_destroy(cxlflash_class);
	class_unregister(&cxlflash_class);
	unregister_chrdev_region(devno, CXLFLASH_MAX_ADAPTERS);
}

Loading