From: Jiang Liu <jiang.liu@linux.intel.com>
To: Neela Syam Kolli <megaraidlinux@lsi.com>,
"James E.J. Bottomley" <JBottomley@parallels.com>
Cc: Jiang Liu <jiang.liu@linux.intel.com>,
Alexander Gordeev <agordeev@redhat.com>,
linux-pci@vger.kernel.org, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] megaraid_sas : Fix bug in handling return value of pci_enable_msix_range()
Date: Mon, 3 Nov 2014 20:44:20 +0800 [thread overview]
Message-ID: <1415018660-30775-1-git-send-email-jiang.liu@linux.intel.com> (raw)
Function pci_enable_msix_range() may return negative values for error
conditions. So it's a bug by checking (pci_enable_msix_range() != 0)
for success and causes failure to megaraid driver when MSI is disabled.
[ 16.487267] megaraid_sas 0000:02:00.0: Controller type: iMR
[ 16.487275] genirq: Flags mismatch irq 0. 00000000 (megasas) vs. 00015a00 (tii
mer)
[ 16.487347] megasas: Failed to register IRQ for vector 0.
Fixes: 8ae80ed1734b "megaraid: Use pci_enable_msix_range() instead of pci_enable_msix()"
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Alexander Gordeev <agordeev@redhat.com>
Cc: "Bjorn Helgaas <bhelgaas@google.com>"
Cc: linux-pci@vger.kernel.org
Cc: <stable@vger.kernel.org> # 3.17
---
drivers/scsi/megaraid/megaraid_sas_base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index f6a69a3b1b3f..5640ad1c8214 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -4453,7 +4453,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
instance->msixentry[i].entry = i;
i = pci_enable_msix_range(instance->pdev, instance->msixentry,
1, instance->msix_vectors);
- if (i)
+ if (i > 0)
instance->msix_vectors = i;
else
instance->msix_vectors = 0;
--
1.7.10.4
next reply other threads:[~2014-11-03 12:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-03 12:44 Jiang Liu [this message]
2014-11-04 10:36 ` [PATCH] megaraid_sas : Fix bug in handling return value of pci_enable_msix_range() Sumit Saxena
2014-11-06 16:51 ` Christoph Hellwig
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=1415018660-30775-1-git-send-email-jiang.liu@linux.intel.com \
--to=jiang.liu@linux.intel.com \
--cc=JBottomley@parallels.com \
--cc=agordeev@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=megaraidlinux@lsi.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;
as well as URLs for NNTP newsgroup(s).