Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2147201iof; Tue, 7 Jun 2022 21:19:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDVt09J3nV/VYD+fPyRQRmBjHpOa1JMafG1pgr6UFp6to0S0HIiA9xxQWJg4OILLJAhxmY X-Received: by 2002:a05:6a00:1741:b0:51b:ca1a:8563 with SMTP id j1-20020a056a00174100b0051bca1a8563mr30464864pfc.58.1654661966277; Tue, 07 Jun 2022 21:19:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654661966; cv=none; d=google.com; s=arc-20160816; b=EhuxurBhT5yBuBfv9u69CRvfJmVxUwmTN6UkGZ0sAGcAWJmGoyA2kzirBdVRkNcLkR kvyXIB+1CQgC6W443fNFcetbGjduO7J5XO85KStfGSbxkVsnHe6CN5Q+jTdhAF432g/O My4xyafkShC4SNlMSgk9T75icARt9xM9UDfPsl1O9GO3dNNfu0vihi3K6BovOtnWuFNs wCsZHvKcvIhyCe309n9wCdQ9yTi7Peg3I2LLM9ZebICaVJyyFEaJ57mOWkmFyHthKnF7 /NBXGorUzQiWHiWfgYP7WMwqCWrnLyqizo5IQokTBEWgv/ayc4iS4sIAEWdq6W0arPNZ yyYA== 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=KKKr1S+0+THAxMw8GTCJirAHJhuFl+Y3znp7EyOLnT8=; b=GCHMNX/xZQ7wN4RHZZEKXjOkRAQahpHTxb5YjXa5mIbF+XKej9ng29pdzA+hlBKl0U qSQamOx/NnvL1QFOE4FFnhoGa1cK+Lo5OKQBnpnwSNcAYrBz+wFTP0BSvvNrcgYtUq5l lrnGiR6iLr2sJcNidvp4WkVwDuO5Nph/y8sNkeMOLMy1mEDMba5+BdL70m8gC+OqArNc oPLt2h39gihiV/UcLyfO324TAizhTAfetZRz6EZb+yYPkn8qGnm+LHdxeJdhMFRAZZLm +8YSO1No3Ua3hfkxo4K1lVQblRXlCRIV9oITz9Xltckbiompx1JWbSFav+e6enW+dT77 QV5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cisCLmrl; 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 bi10-20020a170902bf0a00b0015d168a0c7fsi26563088plb.94.2022.06.07.21.19.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:19:26 -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=cisCLmrl; 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 34CCD39C138; Tue, 7 Jun 2022 20:50:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351620AbiFGSCL (ORCPT + 99 others); Tue, 7 Jun 2022 14:02:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347828AbiFGRnn (ORCPT ); Tue, 7 Jun 2022 13:43:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8060F12E31A; Tue, 7 Jun 2022 10:35:12 -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 23C97B80B66; Tue, 7 Jun 2022 17:35:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7744EC385A5; Tue, 7 Jun 2022 17:35:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654623310; bh=p6G5k0aCFRddU257f0XJhVBR0jWO4D2xjWh9swVtrnY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cisCLmrlcdFdSduEPK7nFLExORGaXsuaQuc5ksSWQFsaNG++s4/85Yhnsx6Fl6pBA nsJLoeg5JIaksa/Mb0sbpwV8EmCcGqhAGq/YN9UjF46DGTFVajLES7aWh/QVQZ899y LfJL8vAruIwAQ9IwszBVVbtYqbmY2A13UgsSCFq0= 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.10 370/452] PCI: qcom: Fix unbalanced PHY init on probe errors Date: Tue, 7 Jun 2022 19:03:47 +0200 Message-Id: <20220607164919.590818828@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@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 @@ -1451,11 +1451,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);