Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2165297iof; Tue, 7 Jun 2022 21:55:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsWu0MZ+Ofy97uYS5dqKQcJZWbbCF3NRW4vnLOL+T4njH3OeV4DvOTC3o0g5DoPCgS7IIp X-Received: by 2002:a17:902:e5ca:b0:164:1958:c84a with SMTP id u10-20020a170902e5ca00b001641958c84amr32193644plf.72.1654664125189; Tue, 07 Jun 2022 21:55:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654664125; cv=none; d=google.com; s=arc-20160816; b=BK+fXYO+DProFzVOeq8zOOUgipIpue4KXYptN0VsUAYqRMLhTK7zyjcFeZRE6/Rpu1 v80LCEDbuOBz6+ptnmQ6T0NipFEg8qtH+/hvOzBgeaxkepb6UB0ZrL4kpB848etnXcan Jux+7prhT5omAusAHbOeRLhc5xJhaXEbbyLSU3JPlyCtz++uqN8vqHx4VxHP3XqtPM+q hOlzGZwI8Tvb86T/EEVhp5JHpWqNM+PRwOZXmo79woL1Za16O9orYmJfl+UGGVVjAhlT DGbs+LmLzBD84SxMYDx6vNeNrCK47rYHyScGLs47g4lcrv1e9ErmbSE0gpWaIJIVJ9oi Zatw== 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=TgWcsINo7YAQ8rAXbVX55R1DyLYYg4qL8nLS9jFoxVI=; b=aVTeJ50VX0GGfoIUosGUQZkJHBsj9vlNNsqMD6Ao7bNEzmz1huQV6e8xzzL0YaZdsP ZazZESCN1A5n1R1iR8Wdt+z7xpwqM4+RlAeXtpw8GJ/VD/g5UiO8qZyBY3GODH6q++l6 qWCb6JSEPrxs3OuhhaFG81kVxu+wpegqFrNwI7clOUB5NlUTSGUZ5eY9Y2JK+V8atxp0 nIc/BYAkd+GGz969dCOJdozL9Cf5OXzaX+YdzegcQ3c26B1aI2TQ6GMKmvFjhlQLdKtn PCsmqrjK2X4h4mmsGjBx1fS8N0EvM5IC6l7nlTac6PkKbpyS/EokF7GumoYroHDpTigp o4/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dssAVRKG; 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 t1-20020a17090340c100b0015eabaaa16fsi23379576pld.578.2022.06.07.21.55.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:55:25 -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=dssAVRKG; 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 64D153AD885; Tue, 7 Jun 2022 21:37:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382211AbiFGVuF (ORCPT + 99 others); Tue, 7 Jun 2022 17:50:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377274AbiFGUuc (ORCPT ); Tue, 7 Jun 2022 16:50:32 -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 7465C1F7DA5; Tue, 7 Jun 2022 11:40:04 -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 82488B82397; Tue, 7 Jun 2022 18:40:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 007E2C385A2; Tue, 7 Jun 2022 18:40:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654627201; bh=5KY1KqOZ5azV/AFdHG473I5F6Ir7SD3Kp8cmEmuqAE8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dssAVRKGBjO9VKkkptdXwBg4qZG8WRn/P4ytwOzw45wWqLz/ATrGZjzPK+hgGFBMA 94FJiRZbO2QVJFZMsco0jN7TodALIsVa9w/zlZaTlrqQj4pmFWB9fUSZLJr2rLc1Zz Ikhv/6EY0NIt4hDKAFFVXZzT5WuvtoJeqC96qB0Q= 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.17 655/772] PCI: qcom: Fix unbalanced PHY init on probe errors Date: Tue, 7 Jun 2022 19:04:07 +0200 Message-Id: <20220607165008.364957724@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164948.980838585@linuxfoundation.org> References: <20220607164948.980838585@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 @@ -1601,11 +1601,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);