Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4827629ybl; Wed, 22 Jan 2020 05:29:45 -0800 (PST) X-Google-Smtp-Source: APXvYqw49UasE1ySK/C6RB/8dz9cwyMpyWxgSBq8hGCP8YRkSOtIv6KVDKE3yrkoV4FxH9M9JUZp X-Received: by 2002:aca:2b0a:: with SMTP id i10mr6919339oik.137.1579699785454; Wed, 22 Jan 2020 05:29:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699785; cv=none; d=google.com; s=arc-20160816; b=TEt97bYaQPldnaSJoSBMIVmRL0O1bM2yC+7I+HtKyGIwtDuWAUWFtc68xLtWo3JvpL VoM2EmTifPTwR1yGlz1mK6DL6fN1rp/g0Vh+bwNYRvAwDfzsrFVM8WYRQxvroiS5mbKN y9jixAJRX68q6a4IED7+HjjoLdqQdZFH/N+OuX5NsQ3bbWMGp1v4JxwT5KUA8UgnMPa9 mT6jucsofKUP5rDq7MgwaVhpfuwX6p0FaXnOUJUko/2sy6d8y06gPoofpcAeWXZ1hWga VFY1z2jjmEtFNJdz4ym9ClhEdw8e5P0D4wEQHyAlgVy7+cNH+vv/0/lRkU6zKe6RcEtG 0Ftw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eeyJjZHrLvSqWe9Fp2m2EbyxJZBGhgSvVTatrmUeqkY=; b=xKHVVacDzBMtNcUc5wgnIjWWtjtERQDk4jL8xjK9sf+2+ytE5kGrMozrMvVW9FnXjq y3lNQbwj1XN0851dBvCffWwWZcYrUHLc+dYCT+7H4iD+qTbxRMWKswvOgaTD7L4eoZMn 6Snl0wApfE1MS6enmDf/vvcgPx5An/gY7gm564BE9Jhj8mFM5NGtGRi0FXL05QVnOSLz 7OQWnV++6ibFMpSN6zg7e2emv+c4KRSMcYUrturGz5CeYnybtPXAF8vL9zDkJ2CJ6OuU aiHo4aVG5rbkru8jfbmFFiG1nbwnVQcJ7qKY4Rkkx16URrUOy9zpuddgRx+TjoqAiHnz Qc9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Njo4gzon; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w1si21243881oia.169.2020.01.22.05.29.32; Wed, 22 Jan 2020 05:29:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Njo4gzon; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729673AbgAVN1e (ORCPT + 99 others); Wed, 22 Jan 2020 08:27:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:49010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731505AbgAVN1c (ORCPT ); Wed, 22 Jan 2020 08:27:32 -0500 Received: from localhost (unknown [84.241.205.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BD24120678; Wed, 22 Jan 2020 13:27:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699652; bh=DMzQfcS5xAtCDGC66DRYfaphZBjQGtafikwUVfigmRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Njo4gzoneIQnjNWwUU1UBPjzir5xamqG6TwZd+Z7N8e9T4zSy2QZTw7E8vvnZeqhm ZVoJ3RddLmqi8usOl9mEaQKjCuYJlrPecWELDqRsJSzGfQEMMNWHPivQMGBY8N8Pk7 cZkNDBVeY8ShzwTMuNShjRZ3lbG3e7fXAB4p/nPo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Hernandez , Huacai Chen , Himanshu Madhani , "Martin K. Petersen" Subject: [PATCH 5.4 208/222] scsi: qla2xxx: Fix qla2x00_request_irqs() for MSI Date: Wed, 22 Jan 2020 10:29:54 +0100 Message-Id: <20200122092848.590628821@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Huacai Chen commit 45dc8f2d9c94ed74a5e31e63e9136a19a7e16081 upstream. Commit 4fa183455988 ("scsi: qla2xxx: Utilize pci_alloc_irq_vectors/ pci_free_irq_vectors calls.") use pci_alloc_irq_vectors() to replace pci_enable_msi() but it didn't handle the return value correctly. This bug make qla2x00 always fail to setup MSI if MSI-X fail, so fix it. BTW, improve the log message of return value in qla2x00_request_irqs() to avoid confusion. Fixes: 4fa183455988 ("scsi: qla2xxx: Utilize pci_alloc_irq_vectors/pci_free_irq_vectors calls.") Cc: Michael Hernandez Link: https://lore.kernel.org/r/1574314847-14280-1-git-send-email-chenhc@lemote.com Signed-off-by: Huacai Chen Acked-by: Himanshu Madhani Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_isr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -3625,7 +3625,7 @@ qla2x00_request_irqs(struct qla_hw_data skip_msix: ql_log(ql_log_info, vha, 0x0037, - "Falling back-to MSI mode -%d.\n", ret); + "Falling back-to MSI mode -- ret=%d.\n", ret); if (!IS_QLA24XX(ha) && !IS_QLA2532(ha) && !IS_QLA8432(ha) && !IS_QLA8001(ha) && !IS_P3P_TYPE(ha) && !IS_QLAFX00(ha) && @@ -3633,13 +3633,13 @@ skip_msix: goto skip_msi; ret = pci_alloc_irq_vectors(ha->pdev, 1, 1, PCI_IRQ_MSI); - if (!ret) { + if (ret > 0) { ql_dbg(ql_dbg_init, vha, 0x0038, "MSI: Enabled.\n"); ha->flags.msi_enabled = 1; } else ql_log(ql_log_warn, vha, 0x0039, - "Falling back-to INTa mode -- %d.\n", ret); + "Falling back-to INTa mode -- ret=%d.\n", ret); skip_msi: /* Skip INTx on ISP82xx. */