From: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
To: james.bottomley@hansenpartnership.com
Cc: dab@hp.com, martin.petersen@oracle.com,
linux-scsi@vger.kernel.org, stephenmcameron@gmail.com,
joseph.t.handzik@hp.com, thenzl@redhat.com,
michael.miller@canonical.com, scott.teel@hp.com
Subject: [PATCH 35/35] hpsa: fixup MSI-X registration
Date: Tue, 18 Feb 2014 13:58:08 -0600 [thread overview]
Message-ID: <20140218195808.15787.96741.stgit@beardog.cce.hp.com> (raw)
In-Reply-To: <20140218195251.15787.55872.stgit@beardog.cce.hp.com>
From: Hannes Reinecke <hare@suse.de>
Commit 254f796b9f22b1944c64caabc356a56caaa2facd updated
the driver to use 16 MSI-X vectors, despite the fact that
older controllers would provide only 4.
This was causing MSI-X registration to drop down to INTx
mode. But as the controller support performant mode, the
initialisation will become confused and cause the machine
to stall during boot.
This patch fixes up the MSI-X registration to re-issue
the pci_enable_msix() call with the correct number of
MSI-X vectors. With that the hpsa driver continues to
works on older controllers like the P200.
Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/scsi/hpsa.c | 31 +++++++++++++++++--------------
1 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index c8de330..9f593b9 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -744,7 +744,7 @@ static void set_performant_mode(struct ctlr_info *h, struct CommandList *c)
{
if (likely(h->transMethod & CFGTBL_Trans_Performant)) {
c->busaddr |= 1 | (h->blockFetchTable[c->Header.SGList] << 1);
- if (likely(h->msix_vector))
+ if (likely(h->msix_vector > 0))
c->Header.ReplyQueue =
raw_smp_processor_id() % h->nreply_queues;
}
@@ -5816,21 +5816,24 @@ static void hpsa_interrupt_mode(struct ctlr_info *h)
goto default_int_mode;
if (pci_find_capability(h->pdev, PCI_CAP_ID_MSIX)) {
dev_info(&h->pdev->dev, "MSIX\n");
+ h->msix_vector = MAX_REPLY_QUEUES;
err = pci_enable_msix(h->pdev, hpsa_msix_entries,
- MAX_REPLY_QUEUES);
- if (!err) {
- for (i = 0; i < MAX_REPLY_QUEUES; i++)
- h->intr[i] = hpsa_msix_entries[i].vector;
- h->msix_vector = 1;
- return;
- }
+ h->msix_vector);
if (err > 0) {
dev_warn(&h->pdev->dev, "only %d MSI-X vectors "
"available\n", err);
- goto default_int_mode;
+ h->msix_vector = err;
+ err = pci_enable_msix(h->pdev, hpsa_msix_entries,
+ h->msix_vector);
+ }
+ if (!err) {
+ for (i = 0; i < h->msix_vector; i++)
+ h->intr[i] = hpsa_msix_entries[i].vector;
+ return;
} else {
dev_warn(&h->pdev->dev, "MSI-X init failed %d\n",
err);
+ h->msix_vector = 0;
goto default_int_mode;
}
}
@@ -6276,15 +6279,15 @@ static int hpsa_request_irq(struct ctlr_info *h,
for (i = 0; i < MAX_REPLY_QUEUES; i++)
h->q[i] = (u8) i;
- if (h->intr_mode == PERF_MODE_INT && h->msix_vector) {
+ if (h->intr_mode == PERF_MODE_INT && h->msix_vector > 0) {
/* If performant mode and MSI-X, use multiple reply queues */
- for (i = 0; i < MAX_REPLY_QUEUES; i++)
+ for (i = 0; i < h->msix_vector; i++)
rc = request_irq(h->intr[i], msixhandler,
0, h->devname,
&h->q[i]);
} else {
/* Use single reply pool */
- if (h->msix_vector || h->msi_vector) {
+ if (h->msix_vector > 0 || h->msi_vector) {
rc = request_irq(h->intr[h->intr_mode],
msixhandler, 0, h->devname,
&h->q[h->intr_mode]);
@@ -6337,7 +6340,7 @@ static void free_irqs(struct ctlr_info *h)
return;
}
- for (i = 0; i < MAX_REPLY_QUEUES; i++)
+ for (i = 0; i < h->msix_vector; i++)
free_irq(h->intr[i], &h->q[i]);
}
@@ -7134,7 +7137,7 @@ static void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h)
}
/* TODO, check that this next line h->nreply_queues is correct */
- h->nreply_queues = h->msix_vector ? MAX_REPLY_QUEUES : 1;
+ h->nreply_queues = h->msix_vector > 0 ? h->msix_vector : 1;
hpsa_get_max_perf_mode_cmds(h);
/* Performant mode ring buffer and supporting data structures */
h->reply_pool_size = h->max_commands * sizeof(u64) * h->nreply_queues;
prev parent reply other threads:[~2014-02-18 19:59 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-18 19:55 [PATCH 00/35] hpsa February 2014 driver updates Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 01/35] hpsa: use extended report luns command for HP SSD SmartPath Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 02/35] hpsa: mark last scatter gather element as the last Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 03/35] hpsa: add support for 'fastpath' i/o Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 04/35] hpsa: only allow REQ_TYPE_FS to use fast path Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 05/35] hpsa: fix task management for mode-1 ioaccell path Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 06/35] hpsa: add ioaccell mode 1 RAID offload support Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 07/35] hpsa: update raid offload status on device rescan Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 08/35] hpsa: poll controller to detect device change event Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 09/35] hpsa: do not rescan controllers known to be locked up Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 10/35] hpsa: add hp_ssd_smart_path_enabled sysfs attribute Stephen M. Cameron
2014-03-13 11:28 ` James Bottomley
2014-02-18 19:55 ` [PATCH 11/35] hpsa: complain if physical or logical aborts are not supported Stephen M. Cameron
2014-02-18 19:56 ` [PATCH 12/35] hpsa: add ioaccel mode 2 structure definitions Stephen M. Cameron
2014-02-18 19:56 ` [PATCH 13/35] hpsa: Acknowledge controller events in ioaccell mode 2 as well as mode 1 Stephen M. Cameron
2014-02-18 19:56 ` [PATCH 14/35] hpsa: do ioaccel mode 2 resource allocations Stephen M. Cameron
2014-02-18 19:56 ` [PATCH 15/35] hpsa: get physical device handles for io accel mode 2 as well as mode 1 Stephen M. Cameron
2014-02-18 19:56 ` [PATCH 16/35] hpsa: initialize controller to perform io accelerator mode 2 Stephen M. Cameron
2014-02-18 19:56 ` [PATCH 17/35] hpsa: get ioaccel mode 2 i/o working Stephen M. Cameron
2014-02-18 19:56 ` [PATCH 18/35] hpsa: teach hpsa_device_reset to do either target or lun reset Stephen M. Cameron
2014-02-18 19:56 ` [PATCH 19/35] hpsa: add task management for ioaccel mode 2 Stephen M. Cameron
2014-03-26 16:09 ` Tomas Henzl
2014-02-18 19:56 ` [PATCH 20/35] hpsa: make device update copy the raid map also Stephen M. Cameron
2014-02-18 19:56 ` [PATCH 21/35] hpsa: complete the ioaccel raidmap code Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 22/35] hpsa: allow user to disable accelerated i/o path Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 23/35] hpsa: rescan devices on ioaccel2 error Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 24/35] hpsa: allow VPD page zero to be queried Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 25/35] hpsa: do not inquire for unsupported ioaccel status vpd page Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 26/35] hpsa: retry certain ioaccel error cases on the RAID path Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 27/35] hpsa: update source file copyrights Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 28/35] hpsa: add controller base data-at-rest encryption compatibility ioaccel2 Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 29/35] hpsa: when switching out of accel mode await only accel command completions Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 30/35] hpsa: only do device rescan for certain events Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 31/35] hpsa: improve error messages for driver initiated commands Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 32/35] hpsa add sysfs debug switch for raid map debugging messages Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 33/35] pci: add HP/3PAR vendor id to pci_ids.h Stephen M. Cameron
2014-02-18 19:58 ` [PATCH 34/35] hpsa: Add support for a few HP Storage controllers Stephen M. Cameron
2014-02-18 19:58 ` Stephen M. Cameron [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140218195808.15787.96741.stgit@beardog.cce.hp.com \
--to=scameron@beardog.cce.hp.com \
--cc=dab@hp.com \
--cc=james.bottomley@hansenpartnership.com \
--cc=joseph.t.handzik@hp.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=michael.miller@canonical.com \
--cc=scott.teel@hp.com \
--cc=stephenmcameron@gmail.com \
--cc=thenzl@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox