Commit a68fdb3a authored by Don Brace's avatar Don Brace Committed by Martin K. Petersen

scsi: hpsa: correct simple mode

Correct issue with hpsa_simple_mode module parameter. Driver was
hanging due to incorrect interrupt setup.
Reviewed-by: default avatarJustin Lindley <justin.lindley@microsemi.com>
Reviewed-by: default avatarDave Carroll <david.carroll@microsemi.com>
Reviewed-by: default avatarScott Teel <scott.teel@microsemi.com>
Signed-off-by: default avatarDon Brace <don.brace@microsemi.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 4e3ea141
...@@ -5526,6 +5526,9 @@ static int hpsa_ioaccel_submit(struct ctlr_info *h, ...@@ -5526,6 +5526,9 @@ static int hpsa_ioaccel_submit(struct ctlr_info *h,
if (!dev) if (!dev)
return SCSI_MLQUEUE_HOST_BUSY; return SCSI_MLQUEUE_HOST_BUSY;
if (hpsa_simple_mode)
return IO_ACCEL_INELIGIBLE;
cmd->host_scribble = (unsigned char *) c; cmd->host_scribble = (unsigned char *) c;
if (dev->offload_enabled) { if (dev->offload_enabled) {
...@@ -7978,10 +7981,15 @@ static int hpsa_alloc_cmd_pool(struct ctlr_info *h) ...@@ -7978,10 +7981,15 @@ static int hpsa_alloc_cmd_pool(struct ctlr_info *h)
static void hpsa_free_irqs(struct ctlr_info *h) static void hpsa_free_irqs(struct ctlr_info *h)
{ {
int i; int i;
int irq_vector = 0;
if (hpsa_simple_mode)
irq_vector = h->intr_mode;
if (!h->msix_vectors || h->intr_mode != PERF_MODE_INT) { if (!h->msix_vectors || h->intr_mode != PERF_MODE_INT) {
/* Single reply queue, only one irq to free */ /* Single reply queue, only one irq to free */
free_irq(pci_irq_vector(h->pdev, 0), &h->q[h->intr_mode]); free_irq(pci_irq_vector(h->pdev, irq_vector),
&h->q[h->intr_mode]);
h->q[h->intr_mode] = 0; h->q[h->intr_mode] = 0;
return; return;
} }
...@@ -8000,6 +8008,10 @@ static int hpsa_request_irqs(struct ctlr_info *h, ...@@ -8000,6 +8008,10 @@ static int hpsa_request_irqs(struct ctlr_info *h,
irqreturn_t (*intxhandler)(int, void *)) irqreturn_t (*intxhandler)(int, void *))
{ {
int rc, i; int rc, i;
int irq_vector = 0;
if (hpsa_simple_mode)
irq_vector = h->intr_mode;
/* /*
* initialize h->q[x] = x so that interrupt handlers know which * initialize h->q[x] = x so that interrupt handlers know which
...@@ -8035,14 +8047,14 @@ static int hpsa_request_irqs(struct ctlr_info *h, ...@@ -8035,14 +8047,14 @@ static int hpsa_request_irqs(struct ctlr_info *h,
if (h->msix_vectors > 0 || h->pdev->msi_enabled) { if (h->msix_vectors > 0 || h->pdev->msi_enabled) {
sprintf(h->intrname[0], "%s-msi%s", h->devname, sprintf(h->intrname[0], "%s-msi%s", h->devname,
h->msix_vectors ? "x" : ""); h->msix_vectors ? "x" : "");
rc = request_irq(pci_irq_vector(h->pdev, 0), rc = request_irq(pci_irq_vector(h->pdev, irq_vector),
msixhandler, 0, msixhandler, 0,
h->intrname[0], h->intrname[0],
&h->q[h->intr_mode]); &h->q[h->intr_mode]);
} else { } else {
sprintf(h->intrname[h->intr_mode], sprintf(h->intrname[h->intr_mode],
"%s-intx", h->devname); "%s-intx", h->devname);
rc = request_irq(pci_irq_vector(h->pdev, 0), rc = request_irq(pci_irq_vector(h->pdev, irq_vector),
intxhandler, IRQF_SHARED, intxhandler, IRQF_SHARED,
h->intrname[0], h->intrname[0],
&h->q[h->intr_mode]); &h->q[h->intr_mode]);
...@@ -8050,7 +8062,7 @@ static int hpsa_request_irqs(struct ctlr_info *h, ...@@ -8050,7 +8062,7 @@ static int hpsa_request_irqs(struct ctlr_info *h,
} }
if (rc) { if (rc) {
dev_err(&h->pdev->dev, "failed to get irq %d for %s\n", dev_err(&h->pdev->dev, "failed to get irq %d for %s\n",
pci_irq_vector(h->pdev, 0), h->devname); pci_irq_vector(h->pdev, irq_vector), h->devname);
hpsa_free_irqs(h); hpsa_free_irqs(h);
return -ENODEV; return -ENODEV;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment