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

Commit 963b0fdd authored by Andrew Vasquez's avatar Andrew Vasquez Committed by James Bottomley
Browse files

[SCSI] qla2xxx: Move RISC-interrupt-register modifications to qla2x00_request_irqs().



There's no functional change involved with this update, instead
it simply migrates the "set cleared interrupt state" codes to a
more approprate method, qla2x00_request_irqs(), and cleans-up the
driver's probe() logic.

Signed-off-by: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 3db0652e
Loading
Loading
Loading
Loading
+22 −5
Original line number Original line Diff line number Diff line
@@ -1815,6 +1815,8 @@ int
qla2x00_request_irqs(scsi_qla_host_t *ha)
qla2x00_request_irqs(scsi_qla_host_t *ha)
{
{
	int ret;
	int ret;
	device_reg_t __iomem *reg = ha->iobase;
	unsigned long flags;


	/* If possible, enable MSI-X. */
	/* If possible, enable MSI-X. */
	if (!IS_QLA2432(ha) && !IS_QLA2532(ha))
	if (!IS_QLA2432(ha) && !IS_QLA2532(ha))
@@ -1846,7 +1848,7 @@ qla2x00_request_irqs(scsi_qla_host_t *ha)
		DEBUG2(qla_printk(KERN_INFO, ha,
		DEBUG2(qla_printk(KERN_INFO, ha,
		    "MSI-X: Enabled (0x%X, 0x%X).\n", ha->chip_revision,
		    "MSI-X: Enabled (0x%X, 0x%X).\n", ha->chip_revision,
		    ha->fw_attributes));
		    ha->fw_attributes));
		return ret;
		goto clear_risc_ints;
	}
	}
	qla_printk(KERN_WARNING, ha,
	qla_printk(KERN_WARNING, ha,
	    "MSI-X: Falling back-to INTa mode -- %d.\n", ret);
	    "MSI-X: Falling back-to INTa mode -- %d.\n", ret);
@@ -1864,15 +1866,30 @@ qla2x00_request_irqs(scsi_qla_host_t *ha)


	ret = request_irq(ha->pdev->irq, ha->isp_ops->intr_handler,
	ret = request_irq(ha->pdev->irq, ha->isp_ops->intr_handler,
	    IRQF_DISABLED|IRQF_SHARED, QLA2XXX_DRIVER_NAME, ha);
	    IRQF_DISABLED|IRQF_SHARED, QLA2XXX_DRIVER_NAME, ha);
	if (!ret) {
	if (ret) {
		ha->flags.inta_enabled = 1;
		ha->host->irq = ha->pdev->irq;
	} else {
		qla_printk(KERN_WARNING, ha,
		qla_printk(KERN_WARNING, ha,
		    "Failed to reserve interrupt %d already in use.\n",
		    "Failed to reserve interrupt %d already in use.\n",
		    ha->pdev->irq);
		    ha->pdev->irq);
		goto fail;
	}
	}
	ha->flags.inta_enabled = 1;
	ha->host->irq = ha->pdev->irq;
clear_risc_ints:

	ha->isp_ops->disable_intrs(ha);
	spin_lock_irqsave(&ha->hardware_lock, flags);
	if (IS_FWI2_CAPABLE(ha)) {
		WRT_REG_DWORD(&reg->isp24.hccr, HCCRX_CLR_HOST_INT);
		WRT_REG_DWORD(&reg->isp24.hccr, HCCRX_CLR_RISC_INT);
	} else {
		WRT_REG_WORD(&reg->isp.semaphore, 0);
		WRT_REG_WORD(&reg->isp.hccr, HCCR_CLR_RISC_INT);
		WRT_REG_WORD(&reg->isp.hccr, HCCR_CLR_HOST_INT);
	}
	spin_unlock_irqrestore(&ha->hardware_lock, flags);
	ha->isp_ops->enable_intrs(ha);


fail:
	return ret;
	return ret;
}
}


+0 −18
Original line number Original line Diff line number Diff line
@@ -1576,10 +1576,8 @@ static int __devinit
qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
{
{
	int	ret = -ENODEV;
	int	ret = -ENODEV;
	device_reg_t __iomem *reg;
	struct Scsi_Host *host;
	struct Scsi_Host *host;
	scsi_qla_host_t *ha;
	scsi_qla_host_t *ha;
	unsigned long	flags = 0;
	char pci_info[30];
	char pci_info[30];
	char fw_str[30];
	char fw_str[30];
	struct scsi_host_template *sht;
	struct scsi_host_template *sht;
@@ -1769,22 +1767,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
	DEBUG2(printk("DEBUG: detect hba %ld at address = %p\n",
	DEBUG2(printk("DEBUG: detect hba %ld at address = %p\n",
	    ha->host_no, ha));
	    ha->host_no, ha));


	ha->isp_ops->disable_intrs(ha);

	spin_lock_irqsave(&ha->hardware_lock, flags);
	reg = ha->iobase;
	if (IS_FWI2_CAPABLE(ha)) {
		WRT_REG_DWORD(&reg->isp24.hccr, HCCRX_CLR_HOST_INT);
		WRT_REG_DWORD(&reg->isp24.hccr, HCCRX_CLR_RISC_INT);
	} else {
		WRT_REG_WORD(&reg->isp.semaphore, 0);
		WRT_REG_WORD(&reg->isp.hccr, HCCR_CLR_RISC_INT);
		WRT_REG_WORD(&reg->isp.hccr, HCCR_CLR_HOST_INT);
	}
	spin_unlock_irqrestore(&ha->hardware_lock, flags);

	ha->isp_ops->enable_intrs(ha);

	pci_set_drvdata(pdev, ha);
	pci_set_drvdata(pdev, ha);


	ha->flags.init_done = 1;
	ha->flags.init_done = 1;