From patchwork Sun Mar 2 08:01:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anil Gurumurthy X-Patchwork-Id: 325543 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 32D0A2C00C2 for ; Sun, 2 Mar 2014 19:01:33 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751428AbaCBIBb (ORCPT ); Sun, 2 Mar 2014 03:01:31 -0500 Received: from mx0b-0016ce01.pphosted.com ([67.231.156.153]:17968 "EHLO mx0b-0016ce01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751426AbaCBIBa (ORCPT ); Sun, 2 Mar 2014 03:01:30 -0500 Received: from pps.filterd (m0000643.ppops.net [127.0.0.1]) by mx0b-0016ce01.pphosted.com (8.14.5/8.14.5) with SMTP id s2281UVI003234; Sun, 2 Mar 2014 00:01:30 -0800 Received: from avcashub1.qlogic.com (avcashub3.qlogic.com [198.70.193.117]) by mx0b-0016ce01.pphosted.com with ESMTP id 1jbd62hkpp-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sun, 02 Mar 2014 00:01:29 -0800 Received: from AVMB2.qlogic.org ([fe80::cdfd:9ba8:5afa:475c]) by avcashub3.qlogic.org ([::1]) with mapi id 14.02.0387.000; Sun, 2 Mar 2014 00:01:27 -0800 From: Anil Gurumurthy To: Alexander Gordeev , linux-kernel CC: linux-scsi , linux-pci Subject: RE: [PATCH v2 02/23] bfa: Do not call pci_enable_msix() after it failed once Thread-Topic: [PATCH v2 02/23] bfa: Do not call pci_enable_msix() after it failed once Thread-Index: AQHPMTkBMtq8oZmQ/06+iv4oZcw6jZrNeEpA Date: Sun, 2 Mar 2014 08:01:26 +0000 Message-ID: <20B1A3CBD98F3845B3F5F56D8597EF59F7A1F7@avmb2.qlogic.org> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <20B1A3CBD98F3845B3F5F56D8597EF59F7A1F7@avmb2.qlogic.org> x-originating-ip: [10.1.4.10] MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5600 definitions=7364 signatures=668951 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1305240000 definitions=main-1403010266 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Patch look good. Acked-by: Anil Gurumurthy -----Original Message----- From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-owner@vger.kernel.org] On Behalf Of Alexander Gordeev Sent: 24 February 2014 13:32 To: linux-kernel Cc: Alexander Gordeev; Anil Gurumurthy; Vijaya Mohan Guvva; linux-scsi; linux-pci Subject: [PATCH v2 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 Cc: Anil Gurumurthy Cc: Vijaya Mohan Guvva Cc: linux-scsi@vger.kernel.org Cc: linux-pci@vger.kernel.org --- drivers/scsi/bfa/bfad.c | 48 ++++++++++++++++++++++------------------------ 1 files changed, 23 insertions(+), 25 deletions(-) -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 */