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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 66B7BC001DE for ; Mon, 31 Jul 2023 11:55:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id:MIME-Version:Subject: Date:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=z/HY+83N4HpkdQyWKopKkWzq6jDiPrcQfKFy4HconcQ=; b=mbsXA8YsWpLN9f DF0sh4JOsAFs81TqcsbXtDw0k4JKhnheLFgFw/L4m7NPrKLkA2nEC62DBfCBcXuSwwTvXkW16kCzx fvqrzHQhM49VlLu8PgA8a/BYMUxkORT6NSash9ywmafNKaes2O5yJhU5ig6daqTEL64/CWj+6ff34 z7RuZgGcfiAn6R2dDHPabSrFcuaGjbb568gbHBOlqWQgLqP8wnUIdXQlH3MSn/kRZ7emIUdWzp0Zm 9mazD1KMej9P0hzw5CipIrc+hYfS5+HVojSlLgKjE2fV319SY9NWkMqAXElG1M203+CcQvg7OyaAo Xr74VxFkXZ7tmxWNG0KA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQRUV-00FNm5-2N; Mon, 31 Jul 2023 11:55:11 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQRUS-00FNkB-3C for linux-arm-kernel@lists.infradead.org; Mon, 31 Jul 2023 11:55:10 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7BE436108A; Mon, 31 Jul 2023 11:55:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 018F9C433C8; Mon, 31 Jul 2023 11:55:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690804507; bh=OiQLH0Ur4QsXIAElfzydLwPQ911lsGirTGBgpfbRwNo=; h=From:Date:Subject:To:Cc:From; b=Gp8L3cIX/YchDpHcrZzplSGCO8NXaBnSbRvUxa3GZznPnFhCRO5PRqKIzdfMcsafl 0ssi9FO0gguKNjm0m1avf5B+hwol66ttDYEOKY9MshYsPb+lNhHaTAxniHyAFo+76l U4YZcunUoaFQterr8PMZbezMfOJvRZwelQpd+WU2sa96EkWfZsaMh+gkiRp/pEx7eS dg4ZfQOHvguQz7PY/mV1JwRRRWy1UYxlEq9OBumUz+m0B1i0HGAUG3bfsNIIbqeHkv DeD20tiKBAJGkSVSoDIYGeJ/JGMI0MFdhWzhl/7Sjgug/bHUeiuylQ6s1qVXP2ijtT 4U7UbQN4g1eDA== From: Mark Brown Date: Mon, 31 Jul 2023 12:55:01 +0100 Subject: [PATCH RESEND v2] PCI: dwc: Provide deinit callback for i.MX MIME-Version: 1.0 Message-Id: <20230731-pci-imx-regulator-cleanup-v2-1-fc8fa5c9893d@kernel.org> To: Richard Zhu , Lucas Stach , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.13-dev-099c9 X-Developer-Signature: v=1; a=openpgp-sha256; l=1930; i=broonie@kernel.org; h=from:subject:message-id; bh=OiQLH0Ur4QsXIAElfzydLwPQ911lsGirTGBgpfbRwNo=; b=owEBbAGT/pANAwAKASTWi3JdVIfQAcsmYgBkx6EXdxRz1dTT/OShq0p+bzBjHKJQarXXyyX7DZCP xpUHn0OJATIEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZMehFwAKCRAk1otyXVSH0Jz6B/ j7M6pqTOungd9oa6NmOq9Ps6fa/WLCmxbVm2DutkAeWjfVtQm6MWoFNnSceaavenIn8HH/DgjResM0 nQZ+NlYhtGiHe+c1aN5TNFF9iQD9/CvMXCCdTdLLIOEiiVrhHdrAYbZWg5ehxOK9GfX1kkWjkAufiX 2f/PsZtlkEuC2p4EAu6IKnWBVEx2PCLyhVa7jA91NUunHp7N7x75M1K+7FojQN77eVH2H57Tx4XaO2 ooNhdHd+eD0HuP1DZ4NmtDJaHZcb+JhjzYMO8ONSTDOY686nUxQ0zlHSYmAd4NbRBRADsxpeNUUvY4 E12cGp1MIDUKg37LH2H6omLcwUOLQ= X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230731_045509_110628_35587AE4 X-CRM114-Status: GOOD ( 12.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Reviewed-by: Richard Zhu Tested-by: Fabio Estevam Signed-off-by: Mark Brown --- Changes in v2: - Rebase onto v6.5-rc1. - Link to v1: https://lore.kernel.org/r/20230703-pci-imx-regulator-cleanup-v1-1-b6c050ae2bad@kernel.org --- 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 27aaa2a6bf39..a18c20085e94 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 = { --- base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5 change-id: 20230703-pci-imx-regulator-cleanup-a17c8fd15ec5 Best regards, -- Mark Brown _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel