Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4623387rwb; Tue, 8 Aug 2023 11:05:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEEYLOwTglzpqRGu2L4t3tB4Nj53qgrAEiutdObIx9wVwCvsK3t7W2cp+BGubYckEebpxZA X-Received: by 2002:a2e:86c3:0:b0:2b9:f1ad:94f5 with SMTP id n3-20020a2e86c3000000b002b9f1ad94f5mr181906ljj.40.1691517957372; Tue, 08 Aug 2023 11:05:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691517957; cv=none; d=google.com; s=arc-20160816; b=ltCPTKdQzYxd7C7ZaWWPHKe+s8wIgByPKgSZm7wT5xy2HDHdnC19/ssMzAcuKW96CP 8DjARS9BYLkuTZgzrthm3EonW/mupoMMXj4/A9F3x1S+bWvStU9hizGwj6b1eE/yfTjB 3wSu7tq4KzHHVUTCKfWe1STSfRhlkScwEw4XOj2detwV2zvnWVGadp52YsK8BlR7+0tx n3vQyG/Jj4WkKxZpemYs+mjLcl5UX9NaBh8hLZwouit3M6g6KCwdUcsjdyPtP3D/h2Cm M1+kDmaQjsQZNTcC5lMI8HH3JxzAe0Ku3oe+7NmcTHGMsABm3G/p5xYKO9srPmKi8P5I jPSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RJHRWuFHElOI9NQx6zTWTgfqW4PyZ7a+sEpLt+Sjm1M=; fh=bzimiDBODAItpB7kDMNkqHaO0F86uPv/eLaXkorfb60=; b=MrgQlKrlkxlDnq9+V00Ksm0NbOdDJv3yxa3QO9WoKHUcNK91rRpsVOCD3bhmI+R6B/ uf8nk+EAioVMFI+u6lJ25M8DsJXac38DXsYo/7Nv0TlYPhD1QMfRR/+OCqkOYCVACehe 2/JxHmLzmhK6vxDJd2Ff80cnyNSOs9MmVwRWnr0FS2h+dLK6NOE3zmMiw4u5lVDZaktr HvF3GAPGUlpDaGpiPvJGMlp7C4f1znak72/kG/VI60p53t9ZJ6SKI2u+Uz5M+iehNhyM 8eZ65EhNvPYXKT2Zh9iCIwHOQxwEqruhOXKZb9uRHQKZKzAy4kUHO7Vz/zIYUaBg1rdi 4uLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qUUbmI60; 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 bq27-20020a170906d0db00b0099cd14c38desi3933629ejb.434.2023.08.08.11.05.08; Tue, 08 Aug 2023 11:05:57 -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=qUUbmI60; 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 S234577AbjHHRZr (ORCPT + 99 others); Tue, 8 Aug 2023 13:25:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234374AbjHHRZY (ORCPT ); Tue, 8 Aug 2023 13:25:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAEF020268; Tue, 8 Aug 2023 09:10:56 -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 B1594624CB; 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230712-pci-imx-regulator-cleanup-v2-1-3b1f6e9d26bc@kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 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 >