lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 16 Apr 2014 09:03:47 +0000
From:	Anil Gurumurthy <Anil.Gurumurthy@...gic.com>
To:	Alexander Gordeev <agordeev@...hat.com>,
	linux-kernel <linux-kernel@...r.kernel.org>
CC:	linux-scsi <linux-scsi@...r.kernel.org>,
	linux-pci <linux-pci@...r.kernel.org>
Subject: RE: [PATCH v2 RESEND 02/23] bfa: Do not call pci_enable_msix()
 after it failed once

Patch look good.
Acked-by: Anil Gurumurthy <anil.gurumurthy@...gic.com>

-----Original Message-----
From: linux-scsi-owner@...r.kernel.org [mailto:linux-scsi-owner@...r.kernel.org] On Behalf Of Alexander Gordeev
Sent: 14 April 2014 13:35
To: linux-kernel
Cc: Alexander Gordeev; Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; linux-pci
Subject: [PATCH v2 RESEND 02/23] bfa: Do not call pci_enable_msix() after it failed once

Function pci_enable_msix() should not be called in case it threw a negative errno from a previous call.

Signed-off-by: Alexander Gordeev <agordeev@...hat.com>
Cc: Anil Gurumurthy <agurumur@...cade.com>
Cc: Vijaya Mohan Guvva <vmohan@...cade.com>
Cc: linux-scsi@...r.kernel.org
Cc: linux-pci@...r.kernel.org
Acked-by: Anil Gurumurthy <anil.gurumurthy@...gic.com>
---
 drivers/scsi/bfa/bfad.c |   48 ++++++++++++++++++++++------------------------
 1 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index cc0fbcd..972ff8d 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1235,33 +1235,31 @@ bfad_setup_intr(struct bfad_s *bfad)
           (bfa_asic_id_cb(pdev->device) && !msix_disable_cb)) {

                error = pci_enable_msix(bfad->pcidev, msix_entries, bfad->nvec);
-               if (error) {
-                       /* In CT1 & CT2, try to allocate just one vector */
-                       if (bfa_asic_id_ctc(pdev->device)) {
-                               printk(KERN_WARNING "bfa %s: trying one msix "
-                                      "vector failed to allocate %d[%d]\n",
-                                      bfad->pci_name, bfad->nvec, error);
-                               bfad->nvec = 1;
-                               error = pci_enable_msix(bfad->pcidev,
+               /* In CT1 & CT2, try to allocate just one vector */
+               if (error > 0 && bfa_asic_id_ctc(pdev->device)) {
+                       printk(KERN_WARNING "bfa %s: trying one msix "
+                              "vector failed to allocate %d[%d]\n",
+                              bfad->pci_name, bfad->nvec, error);
+                       bfad->nvec = 1;
+                       error = pci_enable_msix(bfad->pcidev,
                                                msix_entries, bfad->nvec);
-                       }
+               }

-                       /*
-                        * Only error number of vector is available.
-                        * We don't have a mechanism to map multiple
-                        * interrupts into one vector, so even if we
-                        * can try to request less vectors, we don't
-                        * know how to associate interrupt events to
-                        *  vectors. Linux doesn't duplicate vectors
-                        * in the MSIX table for this case.
-                        */
-                       if (error) {
-                               printk(KERN_WARNING "bfad%d: "
-                                      "pci_enable_msix failed (%d), "
-                                      "use line based.\n",
-                                       bfad->inst_no, error);
-                               goto line_based;
-                       }
+               /*
+                * Only error number of vector is available.
+                * We don't have a mechanism to map multiple
+                * interrupts into one vector, so even if we
+                * can try to request less vectors, we don't
+                * know how to associate interrupt events to
+                *  vectors. Linux doesn't duplicate vectors
+                * in the MSIX table for this case.
+                */
+               if (error) {
+                       printk(KERN_WARNING "bfad%d: "
+                              "pci_enable_msix failed (%d), "
+                              "use line based.\n",
+                               bfad->inst_no, error);
+                       goto line_based;
                }

                /* Disable INTX in MSI-X mode */
--
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@...r.kernel.org More majordomo info at  http://vger.kernel.org/majordomo-info.html

________________________________

This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ