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 2CE35C001DB for ; Tue, 8 Aug 2023 11:23:37 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=m+bgswivljH568NPlDGHWAaT4SAieDjU5+ZqHPVQ040=; b=nLFW2ifWZgUmIz 9nYlRKG9xqopKrSQnQOnUUJUXV0fDXhg+81BOiaPPl4aRyvY/MMXFdarjj+gleSMXhGiA1nOKqaA3 KgUyZvF3KTAlQ8WFvALH1vU3QBSf5njRBhvilLVe3XL0D9TylpWPKUckInjcyBeyTAzvVkEETJXtu qXYDtV0OE0kuJGKO7160dr3adzwS+Rnu3qq9N9j7fjpSymBmwTkcs8suZi5YlZyJ6EpXXVHPsZXC2 zGDoWZ5no1WJfvW5e/CuktoD/5GHb52G6yHk4T073Oh3/Bi5WnhlDnZ9IDzKtftW55DszZueuYLIP wwY1v4HBXOJX65VHviNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qTKnu-002SY8-0y; Tue, 08 Aug 2023 11:23:10 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qTKnr-002SXm-0k for linux-arm-kernel@lists.infradead.org; Tue, 08 Aug 2023 11:23:08 +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 B15CC624CC; Tue, 8 Aug 2023 11:23:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B46A2C433C7; Tue, 8 Aug 2023 11:23:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691493786; bh=uf47QcqVVednoTyXP/D1xitpSzvvxXjJ0RJvfi2KsoE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qUUbmI60+gD371c+d5N6y7GEIlxhTL0jSQyQgcYZy3sb7K6SacbY+7NvuHjoVNSG1 WH9DqltMiROF3+twdf6p73ddnb2Hw1KfAOzYZq7P/mUBKFcJRIHAxz5oDTRh6uRDG1 TPuI/NpY6bBziU+F/N9X+5SEFAHG9X7/3exDlA9fquqR8UEUHsaDjTl5Fd9wohD2fm VvyD37kojpCZemPC8cz1YSFCefwhsCxqSgTemzzGGFp8fFIvl22H3vYxRz5t9boOgf cMoT5j2g8ZycnSQVVbwH+GIFmJpU8n8pV+3y/uNyXtdfoy9cRqxaxjkaZBDXs2VFs2 qDtayNRcM9nIg== Date: Tue, 8 Aug 2023 13:22:59 +0200 From: Lorenzo Pieralisi To: Mark Brown Cc: Richard Zhu , Lucas Stach , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] PCI: dwc: Provide deinit callback for i.MX Message-ID: References: <20230712-pci-imx-regulator-cleanup-v2-1-3b1f6e9d26bc@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230712-pci-imx-regulator-cleanup-v2-1-3b1f6e9d26bc@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230808_042307_379555_38ED58B2 X-CRM114-Status: GOOD ( 21.58 ) 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 On Wed, Jul 12, 2023 at 12:02:57PM +0100, Mark Brown wrote: > 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(+) Applied to controller/dwc, thanks. Lorenzo > 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