Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9398279pxu; Mon, 28 Dec 2020 15:11:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxg/696nL6ulXqW29FTlmvlQvQiZUrOaddA8EH2OE83dlUxGlPJf19pV0b+Qnaf6oeRR/m X-Received: by 2002:a50:d491:: with SMTP id s17mr43172246edi.169.1609197080004; Mon, 28 Dec 2020 15:11:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609197079; cv=none; d=google.com; s=arc-20160816; b=F7tPxlcHs+yN0TGgOnTMlyJuI+NxSBaO6cNDiHiYi+S5axdzs0zNT/wQx2t6P6o2Yd Wz6B46FBfOcNCNAj6A6fEJVudKBLKwcZtZAt+2+Cf8185yVJ3Pi1igWf3o2e/mZVWWdk M8R6dtNLmcqH8x35toQEX48uho8pQP8fMgO20x8whj8iMzolT3NHKxuMrCL7JJLL7njU oxjzV2F8rcJEyWSGKhQjjFIHxUxxw8P2t8v4+pSLOMT+yJdUk01WfZTL5q/p5f51pGFA 0AOfruRO/jjtyTYOUszAYooL2ap+IWLwdxhUJEuc8ha/zCfON6qbBY7ctFSdtRA8LBz/ TmYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8JAdlxV9LYrvpi+jB6R+r8X0W9lghTuF0bTJK2n3E1I=; b=b09JDf9duzCs3MzreX1iucyQ925LntfCIimeMxQ6o0ImNW6lhwtGkubGuCHOnAFKWB um6HegowayXvMDuzq/cYbFX7U96w64MM5m89X73IxUqoOuAmKBReto6fxVmrDyA3/Q70 tzeRzBfchCDJpC7pDUp0TEWYExCRkxee8EPvWEcwEYIBZFtLKqcyHPPmOQdpcLDIOG1x /Q+M4SYZiXGYsOHFJt23Fp5OLSv2OhaM3WdYekVgmQ/EySN366u5a9L44DMhxZMr/eaU 1w5im6Zg9/KBv7DZqSFelbWs3zlNeZre41bV6m+gT2aA7xoSsUveJ4YNAxIPE6nzFHIv uYog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ly61r5u5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m5si22049050edb.242.2020.12.28.15.10.53; Mon, 28 Dec 2020 15:11:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ly61r5u5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439922AbgL1OMm (ORCPT + 99 others); Mon, 28 Dec 2020 09:12:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:46760 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439876AbgL1OM2 (ORCPT ); Mon, 28 Dec 2020 09:12:28 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D17D620731; Mon, 28 Dec 2020 14:12:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164733; bh=VJeCSk2OcPWhoWvyAv2BOS9dluNOfHJJX4tTZ0+pxPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ly61r5u5MzvGcWKYyOMDYvuLWLEZFuW+0W1enGQeeQCGYReF3x2PKJ4vBH9J+sxoh As31LlgYk6ZU+SDnDgckaqNH+jN0N9t3PH10QuKC8RLDp7+gJWR6Ur/BkTjw12lmfX g39rOcaNQOzeb+CgK8E+S6Pb0yT7uLMkPBoDmMtM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiang Chen , John Garry , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.10 247/717] scsi: hisi_sas: Fix up probe error handling for v3 hw Date: Mon, 28 Dec 2020 13:44:05 +0100 Message-Id: <20201228125032.820369419@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiang Chen [ Upstream commit 2ebde94f2ea4cffd812ece2f318c2f4922239b1d ] Fix some rollbacks in function hisi_sas_v3_probe() and interrupt_init_v3_hw(). Link: https://lore.kernel.org/r/1606207594-196362-3-git-send-email-john.garry@huawei.com Fixes: 8d98416a55eb ("scsi: hisi_sas: Switch v3 hw to MQ") Signed-off-by: Xiang Chen Signed-off-by: John Garry Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 960de375ce699..2cbd8a524edab 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,8 +2446,7 @@ 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; } cq->irq_mask = pci_irq_get_affinity(pdev, i + BASE_VECTORS_V3_HW); if (!cq->irq_mask) { @@ -2460,10 +2456,6 @@ static int interrupt_init_v3_hw(struct hisi_hba *hisi_hba) } return 0; - -free_irq_vectors: - pci_free_irq_vectors(pdev); - return rc; } static int hisi_sas_v3_init(struct hisi_hba *hisi_hba) @@ -3317,11 +3309,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) @@ -3348,8 +3340,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); -- 2.27.0