From patchwork Tue Nov 24 08:46:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 331381 Delivered-To: patch@linaro.org Received: by 2002:a17:907:2110:0:0:0:0 with SMTP id qn16csp4193071ejb; Tue, 24 Nov 2020 00:51:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDeIBBYzB6zArwca/EHbbokY3KFY72/2Jxx43q7YTKfJ05g1GlFuIFgYfKrrEeva7Gd9i9 X-Received: by 2002:a17:906:e15:: with SMTP id l21mr3308076eji.509.1606207903943; Tue, 24 Nov 2020 00:51:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606207903; cv=none; d=google.com; s=arc-20160816; b=awOcfbiTrDcxxAa9ZomK+CNsKFhFfvsvbofA+H0wZl/NlhpruIdUY8/jHuvBW60PSy 3aeAVsRc9EVTWgq+8FD3Qc5Isrf0lvcS5iDowAVDAbsfparIkPfurxkGR4LtbRkwB/eK 77uchfelLiO2wvBE42Lp7ScFJjcilB4Fv7VPaNzfUC9zZeQJX0DUs4SGOH+Md2X39j2L 8Kkf1CWgFX+A2xG3k8j4/gN6Le0QjxbspicEgBzZSASf9Hc1O7qeBr6EzK6Xd4RpZIuh 3zAKlPQec/9wV60JjxPSgC5QdOTMIetZbjQK10mW9Q5QYTxDAI9UYiISRA6/HE03mcdB mjVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=BpB1lMb1z5WnQR5DkTcmAC6vAWaU4ChGB+ozGkwRhzg=; b=xe1GdwrcIjC8uXN5AjOAni/Y4dpiWdUaJcMuIr8ZYVzJzVYFjlUQNpr3FLo/9BfkVa Phpxf9IVcJRK7SLCiaVxmkRkR3RVFb1SPizfcemoT5AGGcFPt6pZQuKfR75foCOYUiQK wNA7fW7D2Q7NjmFkKcBED6cJnLI2gbaY0P18k6ZHfCch23tDQdWRSnv8xwDXQcqOzY+3 7yinEsHG+qrAcGhTuZzO0mEfKIglXfH5rJykG+u5x83TpBNRXc6Ssk0T+ix5e6Z7iQV+ XYzIx8Cs6tS40lDmBCzMc1jmpGhRcYo9uxUPD17dI8wdKz3XMt1RSjl9DQS1f9llEjQZ /58A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 62si8482119edc.231.2020.11.24.00.51.43 for ; Tue, 24 Nov 2020 00:51:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730857AbgKXIug (ORCPT ); Tue, 24 Nov 2020 03:50:36 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7727 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730844AbgKXIuf (ORCPT ); Tue, 24 Nov 2020 03:50:35 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CgHlc4ytyzkdNx; Tue, 24 Nov 2020 16:50:04 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Tue, 24 Nov 2020 16:50:21 +0800 From: John Garry To: , CC: , , , Xiang Chen , John Garry Subject: [PATCH v2 2/3] scsi: hisi_sas: Fix up probe error handling for v3 hw Date: Tue, 24 Nov 2020 16:46:33 +0800 Message-ID: <1606207594-196362-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1606207594-196362-1-git-send-email-john.garry@huawei.com> References: <1606207594-196362-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Xiang Chen Fix some rollbacks in function hisi_sas_v3_probe() and interrupt_init_v3_hw(). Fixes: 8d98416a55eb ("scsi: hisi_sas: Switch v3 hw to MQ") Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) -- 2.26.2 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index db409f6847bb..f6d0aa3a8c11 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -2409,8 +2409,7 @@ static int interrupt_init_v3_hw(struct hisi_hba *hisi_hba) DRV_NAME " phy", hisi_hba); if (rc) { dev_err(dev, "could not request phy interrupt, rc=%d\n", rc); - rc = -ENOENT; - goto free_irq_vectors; + return -ENOENT; } rc = devm_request_irq(dev, pci_irq_vector(pdev, 2), @@ -2418,8 +2417,7 @@ static int interrupt_init_v3_hw(struct hisi_hba *hisi_hba) DRV_NAME " channel", hisi_hba); if (rc) { dev_err(dev, "could not request chnl interrupt, rc=%d\n", rc); - rc = -ENOENT; - goto free_irq_vectors; + return -ENOENT; } rc = devm_request_irq(dev, pci_irq_vector(pdev, 11), @@ -2427,8 +2425,7 @@ static int interrupt_init_v3_hw(struct hisi_hba *hisi_hba) DRV_NAME " fatal", hisi_hba); if (rc) { dev_err(dev, "could not request fatal interrupt, rc=%d\n", rc); - rc = -ENOENT; - goto free_irq_vectors; + return -ENOENT; } if (hisi_sas_intr_conv) @@ -2449,16 +2446,11 @@ static int interrupt_init_v3_hw(struct hisi_hba *hisi_hba) if (rc) { dev_err(dev, "could not request cq%d interrupt, rc=%d\n", i, rc); - rc = -ENOENT; - goto free_irq_vectors; + return -ENOENT; } } return 0; - -free_irq_vectors: - pci_free_irq_vectors(pdev); - return rc; } static int hisi_sas_v3_init(struct hisi_hba *hisi_hba) @@ -3311,11 +3303,11 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) rc = interrupt_preinit_v3_hw(hisi_hba); if (rc) - goto err_out_ha; + goto err_out_debugfs; dev_err(dev, "%d hw queues\n", shost->nr_hw_queues); rc = scsi_add_host(shost, dev); if (rc) - goto err_out_ha; + goto err_out_free_irq_vectors; rc = sas_register_ha(sha); if (rc) @@ -3342,8 +3334,12 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) err_out_register_ha: scsi_remove_host(shost); -err_out_ha: +err_out_free_irq_vectors: + pci_free_irq_vectors(pdev); +err_out_debugfs: hisi_sas_debugfs_exit(hisi_hba); +err_out_ha: + hisi_sas_free(hisi_hba); scsi_host_put(shost); err_out_regions: pci_release_regions(pdev);