From patchwork Fri Jan 17 16:02:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Gordeev X-Patchwork-Id: 3506221 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E374A9F169 for ; Fri, 17 Jan 2014 16:23:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E0D8D20179 for ; Fri, 17 Jan 2014 16:23:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 25FC020158 for ; Fri, 17 Jan 2014 16:23:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752636AbaAQQXf (ORCPT ); Fri, 17 Jan 2014 11:23:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56738 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752609AbaAQQXe (ORCPT ); Fri, 17 Jan 2014 11:23:34 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0HG0YLB030134 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 17 Jan 2014 11:00:35 -0500 Received: from dhcp-26-207.brq.redhat.com (dhcp-27-68.brq.redhat.com [10.34.27.68]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s0HG0L6o014424; Fri, 17 Jan 2014 11:00:31 -0500 From: Alexander Gordeev To: linux-kernel@vger.kernel.org Cc: Alexander Gordeev , Tejun Heo , linux-ide@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v2 1/9] ahci: Fix broken fallback to single MSI mode Date: Fri, 17 Jan 2014 17:02:15 +0100 Message-Id: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 7b92b4f ("PCI/MSI: Remove pci_enable_msi_block_auto()") introduced a regression - in case multiple MSIs initialization fails the code falls back to INTx rather than to single MSI. Signed-off-by: Alexander Gordeev --- drivers/ata/ahci.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 8516f4d..df24eef4 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1117,8 +1117,10 @@ int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports, nvec = rc; rc = pci_enable_msi_block(pdev, nvec); - if (rc) + if (rc < 0) goto intx; + else if (rc > 0) + goto single_msi; return nvec;