From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23B9DEEB57D for ; Sat, 9 Sep 2023 00:22:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345389AbjIIAWX (ORCPT ); Fri, 8 Sep 2023 20:22:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345380AbjIIAWX (ORCPT ); Fri, 8 Sep 2023 20:22:23 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E5041FF2; Fri, 8 Sep 2023 17:22:19 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 680C7C433BB; Sat, 9 Sep 2023 00:22:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694218938; bh=d/pO5CryywYvb1JjGDX8L3PtPe7/JEc6xSMfBRKns0E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tWoYjyAb7+mXqlPcMPRf0Xytsa43WPq5iF8pgmgY7nVe2A6BvUU7w55uBnJL1xrOR ejZUcIW1APm0MxmEVlvS3+9RrkR38PUeIhn/bgCr0J02hXchLqgrnUXV7DGl7MREQS zTqPpPJtmVmtpw+iQae50Ho0r0ghuwD2Q2Hf+A8i/4b8O76VIfKkf4+8eOeHVLjIaP 6p2pHFzJuIlmWgTH74WkPAXBSlXSnPtRDbKTDVFuY76YdSsnDFjCH7hgLQqUwcm+VP Zt88ax4ND8ZQR6Iv8RV+xPOaLmFF1sZ63Q8qjNO9dAS9U01rtAkLTsQVo1A0OLRlpI fyjkd2udwoCVQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mark Brown , Fabio Estevam , Lorenzo Pieralisi , Richard Zhu , Manivannan Sadhasivam , Sasha Levin , l.stach@pengutronix.de, kw@linux.com, bhelgaas@google.com, shawnguo@kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 6.5 06/11] PCI: dwc: Provide deinit callback for i.MX Date: Fri, 8 Sep 2023 20:21:59 -0400 Message-Id: <20230909002205.3578068-6-sashal@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230909002205.3578068-1-sashal@kernel.org> References: <20230909002205.3578068-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.5.2 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Mark Brown [ Upstream commit fc8b24c28bec19fc0621d108b9ee81ddfdedb25a ] The i.MX integration for the DesignWare PCI controller has a _host_exit() operation which undoes everything that the _host_init() operation does but does not wire this up as the host_deinit callback for the core, or call it in any path other than suspend. This means that if we ever unwind the initial probe of the device, for example because it fails, the regulator core complains that the regulators for the device were left enabled: imx6q-pcie 33800000.pcie: iATU: unroll T, 4 ob, 4 ib, align 64K, limit 16G imx6q-pcie 33800000.pcie: Phy link never came up imx6q-pcie 33800000.pcie: Phy link never came up imx6q-pcie: probe of 33800000.pcie failed with error -110 ------------[ cut here ]------------ WARNING: CPU: 2 PID: 46 at drivers/regulator/core.c:2396 _regulator_put+0x110/0x128 Wire up the callback so that the core can clean up after itself. Link: https://lore.kernel.org/r/20230731-pci-imx-regulator-cleanup-v2-1-fc8fa5c9893d@kernel.org Tested-by: Fabio Estevam Signed-off-by: Mark Brown Signed-off-by: Lorenzo Pieralisi Reviewed-by: Richard Zhu Acked-by: Manivannan Sadhasivam Signed-off-by: Sasha Levin --- drivers/pci/controller/dwc/pci-imx6.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 27aaa2a6bf391..a18c20085e940 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1040,6 +1040,7 @@ static void imx6_pcie_host_exit(struct dw_pcie_rp *pp) static const struct dw_pcie_host_ops imx6_pcie_host_ops = { .host_init = imx6_pcie_host_init, + .host_deinit = imx6_pcie_host_exit, }; static const struct dw_pcie_ops dw_pcie_ops = { -- 2.40.1