Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp438695iog; Mon, 13 Jun 2022 06:02:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOfH+SThESRP44wlzGuyIKJHeK66UuM79uj72yFBDENuDjP0ZKcm2GoV3VFMpoeKUN+lmX X-Received: by 2002:a17:902:dac3:b0:164:13b2:4914 with SMTP id q3-20020a170902dac300b0016413b24914mr58458406plx.135.1655125373755; Mon, 13 Jun 2022 06:02:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125373; cv=none; d=google.com; s=arc-20160816; b=wfC1VvYQl5Fco8PXvNvjeX4uZcaPYCmPL4ErYZEUcKA8rD98DKgJ3Qg6pcd0jjfpOY 2Zkbm3CV3p1EBUJGggQPK2NTmczuRL5zJNER9vwvQhuGhiLwRV6grrUf4RFj08JldNyi aSYXNEXmY3n1GnHAO7PY+HdV1m4nTthykM6rct3AMlLCDsyKdvx9HhPMLVCxSXlzyZd9 k1pXVqi/IovfYY4HVr3h8nHjw+Yl1jdw4IcvMokDI2h+GhNu3cAYPBsOLYNaYnEVXFAx KOiT+onHs3/MEjOeOJD+56Y5ppORPtXoIvT7kfMCeOwdcXxqCDxwHiQNcpnbI/faK5Di iT+g== 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=i4B1ymKOIWxlaLzmiamVu3iMoZ3bsEmaGGAUIWPctcE=; b=GEcGSD9hp+n7swqHJg+7lwiQb50KkkfQaqDCLZGD8behkqhc5f5EdS8nXWvu9AgMUk 1thw1oDLHAxWKM91fD6hEPR5eSrmZi4XLJvYvmMcXcQYlkSuZY+hpswuF/jGCCN0hfv2 UZKNRoLsmbY/q7GzpXKx+QYd4YcN+eI6znR0nFN8Q2arbhCyMfQoIdnEgIS4vqHH+3AV 6W0AQKkch7aGGE4upsOJRHnXzJWxn7WV+tw6uAdS5Iz7CPQrBbyDHFuBqb+52TFgUjMi ii5YZIxDUjhrvmFLaK2ArNTUsuFu9uR64HAPL4U/MHk63eS0+CjsvwRwEzcEjqH52+CA /Tpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=z9eR81LL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d126-20020a621d84000000b0051b85fb65b9si7821703pfd.244.2022.06.13.06.02.39; Mon, 13 Jun 2022 06:02:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=z9eR81LL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1355233AbiFMLa4 (ORCPT + 99 others); Mon, 13 Jun 2022 07:30:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353953AbiFMLUT (ORCPT ); Mon, 13 Jun 2022 07:20:19 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65BB53BBFB; Mon, 13 Jun 2022 03:42:00 -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 B20E1B80E94; Mon, 13 Jun 2022 10:41:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06AB9C34114; Mon, 13 Jun 2022 10:41:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655116917; bh=XIh2g1nuffDH/ZtwYf71FH0zjt5fA2pQREW7lsH2zU0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z9eR81LLH/vtDBe59OGicUn1afzL9MgsjlL6b1G3MwQSAEGEU27AoDfWCwVaNj+0p CUlDFOe2u2pRcHKnnqfLPljNqO9Oul37Z9R2L/CSCnnRPVrQTk5VXvfzpuR4phTQoe EL1kRo/rlYzBsFG/WbWXQHsUUu/FnBcx6SyPFJb4= 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.4 232/411] PCI: qcom: Fix unbalanced PHY init on probe errors Date: Mon, 13 Jun 2022 12:08:25 +0200 Message-Id: <20220613094935.743751300@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@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=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 @@ -1351,11 +1351,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);