From patchwork Thu Oct 24 14:21:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 177519 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp2265409ill; Thu, 24 Oct 2019 07:24:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZ5U6QURXVUTgEODKTj7/9YK0qUU9b0Iz/iTKaZ6WMq8MxpT4PDPx5C+crJ2bgl2CWUdxF X-Received: by 2002:aa7:d714:: with SMTP id t20mr1476809edq.129.1571927094542; Thu, 24 Oct 2019 07:24:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571927094; cv=none; d=google.com; s=arc-20160816; b=Zkv0T1YkCupIa8i76rm12lGJGPG3e4qhMtVwmp3YnmpPTaV6fTuDff0nuWPh76Jw3Z +XwiK4VA1mVx1EDC47c3rONLmJucel2m4mMFoid37BdIWvmv+ZinUoY7IucIxEYMOdq6 zhsYDXFlwU/5K87H2Hix1D2fUcsXnUkCCI+W+pp29mLzABQmjlwl/fWT+S8PU6jnE2X3 bMAEQrf3xMWnWN8LBVkR/+ab1xZufh/PHOvx/cW3rNWwiRbiKGP63WSvumT8lnNjdanZ UzKmhuvb1ixEb1+NSZd+nFylftPKakWREwDQsTYQkyytb/8Q86sfu5OvTrha8LVkwmVf uswQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=aSCoNqNy3xGLxMpXwVIvvD6y1m+KCuLYrhI8jmrHN7w=; b=OsGoEhWPmwlsCVXjn3VNIHoCge5WP3D5gbq0uBn4gnap9CU7H1/q9j3+0JpTYUIX/9 QDQDMvDg427+MO5vTDjaVbJDJ4hMlKqeKWJ7YIg932HN0ayappjTKq7WNTb2jOhxOBzc Vdpmnt/3tmwGvy8tyjIGTqGaJ/ckU9/RUv7E640k+3MMA8Vhq/QpHC1rQ96yr6+AZCCS Yow6kRF6+Es2HqiSR0tbLvmzzf8K3cuJ3TtAp+PkIgvjwbfxe4d+/WV6MRL2lvR5kDPe 2t6qVk2YLN+afoqTYDKgI4z0ga+tyY9HHBAOoIdDXFwB17IOV56eItgO1FopXdrozVDu PCbw== ARC-Authentication-Results: i=1; mx.google.com; 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 jo18si15183629ejb.27.2019.10.24.07.24.54; Thu, 24 Oct 2019 07:24:54 -0700 (PDT) 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; 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 S2409416AbfJXOYx (ORCPT + 26 others); Thu, 24 Oct 2019 10:24:53 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:52470 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2409387AbfJXOYx (ORCPT ); Thu, 24 Oct 2019 10:24:53 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 6567F4D347CCF59F7DB4; Thu, 24 Oct 2019 22:24:50 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Thu, 24 Oct 2019 22:24:41 +0800 From: John Garry To: , CC: , , , , , "John Garry" Subject: [PATCH 5/6] scsi: hisi_sas: Split interrupt_init_v3_hw() Date: Thu, 24 Oct 2019 22:21:20 +0800 Message-ID: <1571926881-75524-6-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1571926881-75524-1-git-send-email-john.garry@huawei.com> References: <1571926881-75524-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To expose multiple queues to the upper layer we will need to do some interrupt initialisation earlier - that being to calculate the vectors - so split interrupt_init_v3_hw(). Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 497bbf6964f6..29119d0b27a7 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -2409,11 +2409,10 @@ static void setup_reply_map_v3_hw(struct hisi_hba *hisi_hba, int nvecs) /* Don't clean all CQ masks */ } -static int interrupt_init_v3_hw(struct hisi_hba *hisi_hba) +static int interrupt_preinit_v3_hw(struct hisi_hba *hisi_hba) { struct device *dev = hisi_hba->dev; - struct pci_dev *pdev = hisi_hba->pci_dev; - int vectors, rc, i; + int vectors; int max_msi = HISI_SAS_MSI_COUNT_V3_HW, min_msi; if (auto_affine_msi_experimental) { @@ -2445,6 +2444,14 @@ static int interrupt_init_v3_hw(struct hisi_hba *hisi_hba) } hisi_hba->cq_nvecs = vectors - BASE_VECTORS_V3_HW; + return 0; +} + +static int interrupt_init_v3_hw(struct hisi_hba *hisi_hba) +{ + struct device *dev = hisi_hba->dev; + struct pci_dev *pdev = hisi_hba->pci_dev; + int rc, i; rc = devm_request_irq(dev, pci_irq_vector(pdev, 1), int_phy_up_down_bcast_v3_hw, 0, @@ -3284,6 +3291,9 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (hisi_sas_debugfs_enable) hisi_sas_debugfs_init(hisi_hba); + rc = interrupt_preinit_v3_hw(hisi_hba); + if (rc) + goto err_out_ha; rc = scsi_add_host(shost, dev); if (rc) goto err_out_ha;