Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp447672iog; Mon, 13 Jun 2022 06:10:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxofWpvy4nJwhbMW6zBHAO3CRlZqUlI7LjyqYfqLXQK+idAYUmt32QCME8F/bVgBlfbkWdG X-Received: by 2002:a17:907:2d29:b0:70e:8b1c:c3f0 with SMTP id gs41-20020a1709072d2900b0070e8b1cc3f0mr45938763ejc.37.1655125734184; Mon, 13 Jun 2022 06:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125734; cv=none; d=google.com; s=arc-20160816; b=sPCtE6srv0rBtKHtxa/uKyGqiZ5Zis9HHepFGUyJmOyORhCb27lkuRMQ605q3imX5d i93Xv5XR4K6Z5M88JZ+MVW4jWG/sIUpQG/DYBZnxIl2ToDaLH5Sq4lvo1qj6H+2pAnDF sAin1EsLiekCMrdCKJyTTdVz/7uXNFhSu6Tx+AhdKi88u4HoNufrnaZ77+XwvQvmS+NR 62ocoQMmHiSSHI8NQ9qC28HkYWw3iQx1/3DNsfs11RdlyFq+m8q879Y0o/uzd1fmffTV me/PubIh+JWzXrlfUaL67/Ml7sDYgL0E97Hqk6e0ExspDqB79wnAOmd1l3n5tVdNCtja VK3Q== 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=gCHf08N9eSSAe6RtxMnzCWBhUQ2ZoMXHZQ7Uh7IojNQ=; b=t7+RCuzhejwyj1pP+k/t28NbXmk3lmVbCDmhYDpvk0S5t8AgK23Qfus//8OBG46mTD XGoPqJ7b0S7jI70pTRUcGQxJDra8ULPf0a8w0/vpX28B7pl0gTBCQKfKWBJItU3/qkIh BXZWhVDB1ygKD+Zk82Lz1LG6lbCc4x+xAZVTPpcnqyb+tPBoSNRkIWHq2r0dTNjZ9f+G y/W+LbYdsLmxbnvimEX9wSEZ/wldfynyDOgBo6yshpipjfqDbxoew0hB7k48Hg/siY9J vGLdIJVSF0mHcOpg9XykLszg1Cx1ZH6+1zGWjhl11XKSJfsZJ8yZOEIgZv0E2CXkZad0 lkBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kpskR6oz; 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 nb1-20020a1709071c8100b0070d4f9de56bsi8788029ejc.254.2022.06.13.06.08.26; Mon, 13 Jun 2022 06:08:54 -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=kpskR6oz; 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 S236710AbiFMKer (ORCPT + 99 others); Mon, 13 Jun 2022 06:34:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346880AbiFMKbl (ORCPT ); Mon, 13 Jun 2022 06:31:41 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B49B3275F4; Mon, 13 Jun 2022 03:21:36 -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 sin.source.kernel.org (Postfix) with ESMTPS id C0286CE1167; Mon, 13 Jun 2022 10:21:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF867C34114; Mon, 13 Jun 2022 10:21:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655115693; bh=uKnl2EJ1eFFTQAHXO15f5y/ajrIMAWXllM2S4FtiUA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kpskR6ozVvsVOgQPGrDcvx/Wd8tqJQG81ayDnZfM+EsT7d1RFBGFge2EY41fkWvZ9 cNefxYtWKmhUNS0LLsQDqX7XEVQSbcpkysWhYX3jMJXuYo8HPRabL8M1lh+jWe3aI7 iIHvwukHE4Sw+zd+qsstu0+j/lE+5+F7G2eVvdTs= 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 4.9 167/167] PCI: qcom: Fix unbalanced PHY init on probe errors Date: Mon, 13 Jun 2022 12:10:41 +0200 Message-Id: <20220613094920.173799133@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094840.720778945@linuxfoundation.org> References: <20220613094840.720778945@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/host/pcie-qcom.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/pci/host/pcie-qcom.c +++ b/drivers/pci/host/pcie-qcom.c @@ -562,10 +562,15 @@ static int qcom_pcie_probe(struct platfo ret = dw_pcie_host_init(pp); if (ret) { dev_err(dev, "cannot initialize host\n"); - return ret; + goto err_phy_exit; } return 0; + +err_phy_exit: + phy_exit(pcie->phy); + + return ret; } static const struct of_device_id qcom_pcie_match[] = {