Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp460359ybz; Fri, 24 Apr 2020 03:31:56 -0700 (PDT) X-Google-Smtp-Source: APiQypLSHTlqStjfc/+PeXKbq7wMo9zfytz1hd4yqCtoLdRIJvjANXJwH2YT3QJsXbW29aUWkyCc X-Received: by 2002:aa7:cd08:: with SMTP id b8mr6281354edw.96.1587724315984; Fri, 24 Apr 2020 03:31:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587724315; cv=none; d=google.com; s=arc-20160816; b=skG5W898T6K9w4GC+AmH1xOCpPbutIdCRHqIa5psEvKdjB8BfvT0zQzNLq5jFfk65k GzK4MGBKIFWVe0rXj8ddKe85lnJL4NMVMUXHSMW9IhXZ9vQeepBrIMnJ90FSl7m4Y5PK JcCjacw4lIZzD0PCq99rkr0DHRgNRCW3V/TAYjmlt9JR+SA7EYCnc+GnvdyrS+rPEu9Q Az4WhkY/YjmqonxcGwnO6tdBv5OyikxuWyyp2s10wIlZzZ/ChHyFgCyqMY2O+tGy8nPt 2uHQbgRalw5NMLNmOyEHk7gjKF/u9AhwTZ8c3DYgFYLKQnyMHporVhWmCMgMUmd3Y5+M UiXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=0cxZmnaNNAoejPo5NJIkXO59d8THc26ZMFkxREHRPUg=; b=G5LQzIuD2dPpjRtMvoXFIhmS813O11WHUOKF3ZJUHOgTiXaQnC3xE3gxhJk0Ehomaz JdJUFQkadHL6o83gL+loFEW2sFW3sfGTvx/lu40ssMctg2HNgsWklKVa1YQwu70TtU77 HeYFVCl7YU0Q4AQAvRwUDJI2SxVeDtRok3K9Age5raYR9TQqe4O7Fwq84HjWG9JcLTsV SHCcjdDJbYqHtSsV7u15ZX25r0RRicUCuBtnoQVwV9Wo7j+bVN1ilOXnle8Obh2nlOs7 YrdZsRNaSM1RYgUPhIK7ILH8i/1Ozk6p0p7Ti0pBvjr3XUN9PB37R1VjubGRmO4KNJKx koZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tB3jgjqT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d23si2846291ejt.267.2020.04.24.03.31.30; Fri, 24 Apr 2020 03:31:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tB3jgjqT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726753AbgDXKaI (ORCPT + 99 others); Fri, 24 Apr 2020 06:30:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:45500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726193AbgDXKaI (ORCPT ); Fri, 24 Apr 2020 06:30:08 -0400 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3461720736; Fri, 24 Apr 2020 10:30:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587724207; bh=+OdtIIFccCHjI9Scq9RWg/K1sKwriEJe9pYwL6WklQc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tB3jgjqTSqyeMwjFp/sCwpodyEYMHWn2ebZxkdCp+vZ4OrHZzSagHHyAW/B896CQN 9D7jMldhUHCa0mbKxI7y4rs6XZvKJq/lKCsnFFbzSPzhFrfgd8egg8sFg2DaJfaLhB t1+kC4Sk/nCYJNdcFIcedEjdPj/7XSTA8aXMjTgM= Date: Fri, 24 Apr 2020 11:30:04 +0100 From: Mark Brown To: Peng Fan Cc: "rafael@kernel.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx , "S.j. Wang" Subject: Re: [PATCH] regmap: mmio: prepare/unprepare clk only when read/write Message-ID: <20200424103004.GB5850@sirena.org.uk> References: <1587620791-5279-1-git-send-email-peng.fan@nxp.com> <20200423104000.GD4808@sirena.org.uk> <20200423112244.GH4808@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="O5XBE6gyVG5Rl6Rj" Content-Disposition: inline In-Reply-To: X-Cookie: Information is the inverse of entropy. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --O5XBE6gyVG5Rl6Rj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 24, 2020 at 01:27:29AM +0000, Peng Fan wrote: > If we not pass clk to regmap, accessing regmap registers will hang system= with > Debugfs enabled. If you're not using a cache then that'll be a problem, however there is a flag runtime_pm in the regmap config which when set should cause the device to be runtime PM enabled when it's accessed so if you do your clock management in runtime PM it should still get enabled. I *think* that interacts OK with being in an atomic context but I can't say I've verified. > If we pass clk to regmap, it will make the runtime pm power high, because > regmap mmio will call clk_prepare at the beginning. > That's why use clk_prepare_enable and clk_disable_unprepare. > Thinking about another direction, how about add clk_prepare and clk_unpre= pare > into debugfs ops open/close? Something still has to prepare the clocks for normal operation... =20 --O5XBE6gyVG5Rl6Rj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl6iv6sACgkQJNaLcl1U h9B1EQf+IpIBHjl3zQPdZQUD7pfBppcj+Dl0tgehdNFc5OK9GhSsWC8S04JOZXI/ LRccR9Xb6DjvKvPo7szhgF4ITiCYpgmI/OjjoLiXK2zpIHW9jcay7TiurUG8RehO 578eP3OZGzoMzCx+CDdf4t12uE2E7WMcwZge9ofgok6TAsBZG4cbCPNaqsvVwksb M6FoMbVJUbjcxMr/555r3whUKm6szcNnH+sZa0ZOGH/dir3B5XonCsCL1QDHRn8o BE067LLusQvrpN1+rYqIBfL01WZ1McLyDEmsRtpqoQPUOwYe+74CbtzFuHKpyF3D SFCx5uPGcEZcCudFLc9lnff/DkGkNw== =WuaN -----END PGP SIGNATURE----- --O5XBE6gyVG5Rl6Rj--