Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26445697rwd; Mon, 3 Jul 2023 09:45:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlHGrMfD6jJLk/W2kfwMXJDvAA//R6HbWShN3Jj3c+ovuEz18nllI4ExIi8Z+rMfx4CQ+dwC X-Received: by 2002:a17:902:f54a:b0:1b8:73fb:669a with SMTP id h10-20020a170902f54a00b001b873fb669amr13029079plf.31.1688402728677; Mon, 03 Jul 2023 09:45:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688402728; cv=none; d=google.com; s=arc-20160816; b=wih75MhFiLyCZcLAca6uKZVQbi+Y4Kn4gZU7152jIiMu7eo1DZ5sKBwG4jWbot2uDW mqEAd5bsnb1bwQXUyIa04p2GcPGbaHP1z4weFWz7r8khAJep88IOHTp83Fr53Eqa3EjG vTA30nec9OZsnPqyqMcFvqQf0lM/eLkdMnkFK9FciCnS0ZcXGf7mrKhReHHPt3N/x8Ty b4FFGJvXFC9GyfrrBHtSdrbF+N3ayOawheRV9nNluIF9rAFcH34hHROWLXYBjrgRAJuQ yfiy5Gsv8kHSB+IbA66Rg2CUs02iQyvkZvMZHkfAjOG64Edg2s0BTwTI/a+wPvdm41S2 jEXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=rknymOG7c1FxueK50H/I/xKGJwN0MzRJ7WhewKkvSv0=; fh=BgQ/1wAgXYFSlM43M8FR/bi8HX9Awp9/7UVjplcIl2s=; b=G1hl66jQbr5Ds4KCz+uXEl6mIxWRXKEkqyK1HYcx0jQUKtvahTLRpcbC5jVdclFwhJ 2ohKNyVGGU4hQJfEW5fRbiOss6eidXe0mghGgFr3K1qFfXmQ8bqueeLkUNuhnogS4Q01 LlDrYzJB00Tr/dyeQUTLfF+A5b0GWqHx1oZ8CSVZU0rwxW4KMs7v6lLbJdoKC0x4jd60 RsCxX2vizJpXA5kI4e8WEK1hVkCsBfKUUso1Tfzap4fs1T0AcWNgpC+ssPcdk6788wv8 DHHFE9tQGDPOUkhaOj0W5e8LmNPJxVXpO47kz/pZnvGs0QEC9CszwEX+8u5YoyamLxBm lMbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bBPtlmYX; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q15-20020a170902eb8f00b001b3d27c4f48si11651172plg.57.2023.07.03.09.45.14; Mon, 03 Jul 2023 09:45:28 -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=@kernel.org header.s=k20201202 header.b=bBPtlmYX; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231304AbjGCQaQ (ORCPT + 99 others); Mon, 3 Jul 2023 12:30:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229504AbjGCQaP (ORCPT ); Mon, 3 Jul 2023 12:30:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD6A190; Mon, 3 Jul 2023 09:30:10 -0700 (PDT) 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 485B760F7B; Mon, 3 Jul 2023 16:30:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 916BAC433C7; Mon, 3 Jul 2023 16:30:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688401809; bh=8ZJywgN7zX7HPIQiniWG85bY3ojzDG5dLyrGXUsgDdE=; h=From:Date:Subject:To:Cc:From; b=bBPtlmYXEp+MmXj+TTq77bJFmzgUBr1/B+iXmcLdcb5xZ9/a1Mv2J0O0bN+hw7UwR kcwAQcGEXSfAt/6jbyHy2OXep4xO9aKChH1y12pGV+Sg1Hv/sA3SE9rIc8zXOCBVX2 xzlPvYpGbjcJQ65OH/AMChnqdjWZLxy6VD1ovIQ7DAuYF3PiJDpzihWq79X7PqXKeK RL2OA6+4nh3ZALka3w0A5oxCwnFwXel1vs6KPGr7tY12LEYdfUcjojKBnUnLjYQyAW hHQc8CjG3hVzgTr8guGm28TB1w8d7FuGjd3GP9QBfJjjmJzQIdGHXSC7WU57lqDy4x c84iIS4ulRtUw== From: Mark Brown Date: Mon, 03 Jul 2023 17:23:09 +0100 Subject: [PATCH] PCI: dwc: Provide deinit callback for i.MX MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230703-pci-imx-regulator-cleanup-v1-1-b6c050ae2bad@kernel.org> X-B4-Tracking: v=1; b=H4sIAO31omQC/x2N0QqDMAxFf0XyvECriGO/MvYQY9Qw15Z0boL47 6t7PBfOPTtkMZUMt2oHk49mjaGAv1TAM4VJUIfCULu6cZ1rMLGivjY0mdaF3tGQF6GwJiTf8XU cfCvcQvF7yoK9UeD5fPhGe55zMhl1+yfvj+P4AXxsmEWCAAAA 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=1683; i=broonie@kernel.org; h=from:subject:message-id; bh=8ZJywgN7zX7HPIQiniWG85bY3ojzDG5dLyrGXUsgDdE=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBkoveMNRJ5ZaJVV2xDxJg/bNmgjsnBBv0SXgdm9jjz L1k3vY6JATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZKL3jAAKCRAk1otyXVSH0AWyB/ 0SUGEefHTTN8YS90X8Fn/ghC+xZkL23oIxw85nsyJ2dZgPwb1Txh3vHr/WSqrKMJhRrE7xcP5zCE/z 4Td/4VUtE8jFfpmbqiM9ZNYtpW1SjBasiwNqkvZbgd+Fd82VA9jO2ZyvR17oT01q8xJX+d1qCpW5If 2X5E9QpMGVkBbWwkhhwCe6+PK9rOalVWUNrs+ED7OeQ4PNKwAH3WccpauzRje5xx8xuLm5eU5ay5KC RcQxZ+BMMee90Qh35J79LRXvcaVk2oa7GILyGHx6HeuFtHLtddCnsRydvk+XPn+Ta/Ph4NdkGpgwCh dN9a4/iM7ZOUogL29hhzTT4xHYqVDb X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Spam-Status: No, score=-7.1 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 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. Signed-off-by: Mark Brown --- 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 52906f999f2b..e4942bd2598d 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1039,6 +1039,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: 6995e2de6891c724bfeb2db33d7b87775f913ad1 change-id: 20230703-pci-imx-regulator-cleanup-a17c8fd15ec5 Best regards, -- Mark Brown