Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2207298iof; Tue, 7 Jun 2022 23:13:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTWAUj3zPN6vVb+C6uJhw609CSRG/PdGBU3OL9ABnxkQ8GRWbaGhRd17Lw/504lg9N2LyW X-Received: by 2002:a62:1a90:0:b0:51c:24cf:b9af with SMTP id a138-20020a621a90000000b0051c24cfb9afmr12206019pfa.7.1654668782004; Tue, 07 Jun 2022 23:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668782; cv=none; d=google.com; s=arc-20160816; b=NFC5FumBN8ENMH2JNepSFoVdh8llSJIfK9TDRxOm7MMRtHdAb22hkxLxTzodt2jPDx bW1gSe/jO1HNIoWa6jNPLNxOOqR4hd6b5J7i9bXi9hKuANpvOhNiEn++ia3hDsxfOEZP jdY4tAM6Q3Vp+a6TOMMBBy5KqY4QTM72fiXXXpWUitb6DElWkPEBfB3J34hr1htnAWEd lvIMoFD3jg3/PT6yTzKxWieN1jUpwVjFsTZhpCOnc55SB9e0h4xi52C2JRvsPzsNAO9E PjzHZIm1IWRwpPqGiQOgEO0cKlmoe51geAIMUhisHL8Jh6b9uhC9F41750Yi9OCEfsCb RvMA== 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=L+fCzW4Bos0Ez9YMpgvl01z+qvfl4QOMAB/4mjrdYV4=; b=Ln1iZJ37wqcXvbzD6AbS7QSqka7AgGsmVauApZsgZ2cBLKhHfLKMuYEFfbMdJPr6hl 9B6Miq772S2gPBmpCfOJgu9dr75u+V9/lpYaAsZyMgB4Awt3Zkip/MFCLGxcRKWbHvqj 21Ih1U/sWhQqwcobKJ6ORgzZcFtk5eLW70VjXP7VkGPD6ziPpr67Nsbd5XEtM0fmTQXe aTO7RQ+DE7eigXIklNf4fGUpx9SYBMkMslXuOG1drR6mkc6uoUvco4oICbOeVNfgJ91H BcNoQquWLnnhA+Hno8SMxj7RZlYRYzwFsdGHBDwlClVYKeZk73sL1M9zW00qqd96rKcj groQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2sDwaGWG; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k4-20020a170902c40400b00163ebcaa03fsi32226015plk.312.2022.06.07.23.13.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:13:01 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2sDwaGWG; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A2121414375; Tue, 7 Jun 2022 22:35:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244818AbiFHBsh (ORCPT + 99 others); Tue, 7 Jun 2022 21:48:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384525AbiFGWUf (ORCPT ); Tue, 7 Jun 2022 18:20:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DDB0262D6D; Tue, 7 Jun 2022 12:20:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6F4A8B8237B; Tue, 7 Jun 2022 19:20:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF753C385A2; Tue, 7 Jun 2022 19:20:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629627; bh=DM0c2gfWG1pwzChCErnHM/oPzsv1w4drrMC209VTcSY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2sDwaGWGp4AeYL4iWTsVdUMRGCiz4MRl4AecAxgkCmN5H2noU4mnKIafOtMC9v4JQ eYH0Fh4sE+upIm0vlA2WLljqmR7RdOWRH0b6Me1tpyw3uHCnbtVst65tmq2Yk6o5O/ OI9CHLQwtmQwbMtDPuFUHyI5ETLBmsSj+GkXHItE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Lorenzo Pieralisi , Bjorn Helgaas , Manivannan Sadhasivam , Stanimir Varbanov Subject: [PATCH 5.18 757/879] PCI: qcom: Fix unbalanced PHY init on probe errors Date: Tue, 7 Jun 2022 19:04:35 +0200 Message-Id: <20220607165024.836400047@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold commit 83013631f0f9961416abd812e228c8efbc2f6069 upstream. Undo the PHY initialisation (e.g. balance runtime PM) if host initialisation fails during probe. Link: https://lore.kernel.org/r/20220401133854.10421-3-johan+linaro@kernel.org Fixes: 82a823833f4e ("PCI: qcom: Add Qualcomm PCIe controller driver") Signed-off-by: Johan Hovold Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam Acked-by: Stanimir Varbanov Cc: stable@vger.kernel.org # 4.5 Signed-off-by: Greg Kroah-Hartman --- drivers/pci/controller/dwc/pcie-qcom.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -1629,11 +1629,13 @@ static int qcom_pcie_probe(struct platfo ret = dw_pcie_host_init(pp); if (ret) { dev_err(dev, "cannot initialize host\n"); - goto err_pm_runtime_put; + goto err_phy_exit; } return 0; +err_phy_exit: + phy_exit(pcie->phy); err_pm_runtime_put: pm_runtime_put(dev); pm_runtime_disable(dev);