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 7D277EEB565 for ; Sat, 9 Sep 2023 00:24:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345453AbjIIAYZ (ORCPT ); Fri, 8 Sep 2023 20:24:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345451AbjIIAYX (ORCPT ); Fri, 8 Sep 2023 20:24:23 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65FBF2120; Fri, 8 Sep 2023 17:23:45 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 339EDC4339A; Sat, 9 Sep 2023 00:22:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694218967; bh=ukt6clGjIVfIPNRDcJaOAURmUDZz0nKYfhl0y7iPbOc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MV+JVyxVjAYF1yukGniNw3I7LBb2QTi6srEKLAGC1JlX+3nSkLi/oECa4O2Bh0BKd 6eLnTrMaoLQqePu2rpwhNEQw698Ba/nTPTUWXdaZdYq5hbHjet+ENHKWO2Pl4awSQw DdtWo63FnkLP/KzrBWv9C68Kr6MTDhJmf5lAyv7A8DN7I47Pxljzo/UoxD32/b4xQm xsI3rrCxCT4grFq9Bu4ovlvbNJEaXNxZ2VFtelFo1GRc9zcrVhukCd8Opwzt/Z3R7x kukn7wxqM+NOFnXPePw5OG++oKDkDsMI50lc7c7VtGTbEre4o/52gA51Y6R56N+LA5 wHTlYHBCJiylw== 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.4 06/11] PCI: dwc: Provide deinit callback for i.MX Date: Fri, 8 Sep 2023 20:22:26 -0400 Message-Id: <20230909002233.3578213-6-sashal@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230909002233.3578213-1-sashal@kernel.org> References: <20230909002233.3578213-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.4.15 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 52906f999f2bb..e4942bd2598d5 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 = { -- 2.40.1