Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp271844pxb; Mon, 7 Feb 2022 10:56:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwjURjZv6uSO2eX78tyEm/xwLzjTWHJ/U1Ntca+2gbRjGLnsKS01qOcekOBAMHCshPDKVz X-Received: by 2002:a63:ee01:: with SMTP id e1mr627308pgi.508.1644260186828; Mon, 07 Feb 2022 10:56:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644260186; cv=none; d=google.com; s=arc-20160816; b=qjUSP2bFkQGRNMSWV4/Bz4/JMtLmovXszSZTysFLLbSKM/rzWOeuOr8U4xxoVORA5s hDFG07VmJkJu42KKjemDU0T1tdawnYitGHasa5BcaDcNaQRMzXWXwx+GHMWJx7xn6Pha MskhVIBbzmKrKivihHRsVfJUunAauCB7N5ZTUBKbY+w6ui1RO+jQ5Qoluht8T0lb5X2i PR3xJGL98322Q5J3kuS9ch87Kx/ZlZ9sCMTSEJQWKVhn3vXTa40uogc53zDOa+u4+3O9 POHtq/axADhLFNetFVwGkwNIdPrIrB/9Ur+m5K8OclFvCakl6YlZWRvCHxWpNFS3QmUD ccOw== 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=1JLOR+viYPlwEmaPZ1hYsgjxNBUKu0EA2zH81rTNhg0=; b=Jsyyl+KxFYugYYx8cdpPD2NvfTr/bbTcFNPcMS3GdYmq4Qm3qfir5aaYruCdgSJG/n 8/D2Eg/ehsLBtfA9/GZO00ryKcEn4fgjyxeJreuGEuloCseNkFs7VDBohmw7kHm9H0gr h4UrSvRomyC8mD5BwfkiGXE/+kQc8e3ph1G6SzhR65w1O2bOUpM3sE2hz6wgwl4oP/kp 7P8zNYQw/j3oImZHdJP3lT1y+NCFw/CmnCmMKLHoOe+VUweBaHciORiCCN8QIBYCByH6 eqFSWrLKZNeEVc13rX2gTd++ifz0qlez/JX7DJj9yELIfpW7phscDPjC9BzBIuWk2J8v VBgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SVMTuNYD; 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 pj6si169594pjb.63.2022.02.07.10.56.14; Mon, 07 Feb 2022 10:56:26 -0800 (PST) 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=SVMTuNYD; 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 S230239AbiBDTD0 (ORCPT + 99 others); Fri, 4 Feb 2022 14:03:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234979AbiBDTCf (ORCPT ); Fri, 4 Feb 2022 14:02:35 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8D44C061714 for ; Fri, 4 Feb 2022 11:02:34 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B068EB838D2 for ; Fri, 4 Feb 2022 19:02:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04667C004E1; Fri, 4 Feb 2022 19:02:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644001352; bh=6ngj7r3EAtDqwAjDyj6UiGc7OBQFO0jCuKHmtOkOCl8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SVMTuNYDWowP5VRdpgFPmyjoJov2uecR6KSkuYc1deoGMeHh/8ZBJXf9yaE4VrKTl zTn9q7V6gU59HhEJPg7F0y/cuIM2EOtU7cbwyMhSuJGSOQpssmJseTloB4C2eN4c6H cvxLEPsP5qj2T8N0jY1WMGkn5L6L7McFoq8wWERNMNCPGaTEWCBS1szEpaexFlMz7P UwxJUyyDKZ5NpL+lPaJVke63WGMYap1v2pWmg+GMwGOim7owbtvEU9JNyQ5Z2W4bDJ dVQ0afvjMpsJggwc3z1nxKjySBhVgbsYHWFEl3QkcrmOgNxZ8lrTiazQwfM/g7hNNU JUELHospbpZyw== Date: Fri, 4 Feb 2022 19:02:28 +0000 From: Mark Brown To: Brian Norris Cc: Peng Fan , "rafael@kernel.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx , "S.j. Wang" Subject: Re: regmap: mmio: lack of runtime_pm support for debugfs Message-ID: References: <1587620791-5279-1-git-send-email-peng.fan@nxp.com> <20200423104000.GD4808@sirena.org.uk> <20200423112244.GH4808@sirena.org.uk> <20200424103004.GB5850@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="hRRnzNzDsjG7npUH" Content-Disposition: inline In-Reply-To: X-Cookie: Torque is cheap. Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --hRRnzNzDsjG7npUH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jan 24, 2022 at 03:50:23PM -0800, Brian Norris wrote: > The only 'runtime_pm' flag I'm finding for regmap is for regmap_irq_chip > -- there isn't anything useful for other kinds of regmaps (like MMIO). > If this seems like an expected/useful feature, I'll look at adding it to > the generic 'struct regmap_config' / drivers/base/regmap/regmap.c. > This could be tricky in theory given the atomic context requirements, > but in reality, I think it would still be OK: this feature would really > be useful _only_ for otherwise-unregulated contexts, like debugfs > access (where we can sleep). For all non-debugfs accesses, we expect to > already be RPM_ACTIVE, because the driver should already be managing > runtime PM. Are you sure you wouldn't be better off with a cache here, or marking the registers as precious so they don't get read (perhaps conditionally to allow reading while the device is live)? The general idea expectation with the debugfs is that it shouldn't materially affect the device, this would mean that it could cause the power to get bounced on which feels like it might lead to surprises. If you are sending a patch adding support for this it should be debugfs specific, not a general flag so it's clear that it's not going to do power management outside of debugfs, as you say in the normal case it seems better for the driver to do power management. --hRRnzNzDsjG7npUH Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmH9eEMACgkQJNaLcl1U h9CyNAf8Dw6weMFAkpEdp9ndGZJ+cTBeYRiFEQUDD+GOjV/Sy8bsbeYNvJzCeofh q1dTYpYAlgkyT2FpqkfB77jqUK81fku/E96ibto1n2r0+qoQBeTyo5lTvwyQiv8l CoJq0ZjXfXUAg2cQuGqULkg8lfmUFtdsDtr5tUwQrfJ0saPLuibigYAtEUcaBCGM b/jh3GRypX+iHDyfSZQCEwtz2emj9l3KLp13moFieVADysxNe1JII85GM9h/wnpq Cxt8LQNEl7KhD182oAyvZrt3Qq6F/7jF4vc5HfcpI8a4DucAnKsVqTEm/yxzHza6 tKzWPT8R3/AlY3uNqIW7AgW51nTBlA== =bTdf -----END PGP SIGNATURE----- --hRRnzNzDsjG7npUH--