Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1711389ybz; Thu, 23 Apr 2020 04:24:28 -0700 (PDT) X-Google-Smtp-Source: APiQypK0PYzUzePyqomq0cNvbCmF+stDhg29uUhaBmK37zXHYT9yNk8H1V0ncOraTCZXWvWiu7kr X-Received: by 2002:a17:906:3d69:: with SMTP id r9mr2248475ejf.20.1587641068775; Thu, 23 Apr 2020 04:24:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587641068; cv=none; d=google.com; s=arc-20160816; b=C9u24cefzWa7i2qrIWhR3qWywUdOnq5ViW+W5LGOISFu9q8a5dgtKjrIf71+HNXFIc FMGGQZLxwWyYZ0FIRoqj0g9wbm7RLoqIN06961hOxzODmH/LJqpNqfT092GqyrcmfTeC NKNdNXhK6BWRlwp46Fwt73r1ie5i64Sk5PaHfmsTHL0DfoYkI24MMt51+VmocUeQG/+W TO88RUsaRCc/+QXO8VWEPRQP1MFZuJM98Zzss1Tuf//bGXz9ov8yicvb4RtKHSa/T699 R66ALt7H2Ql0c3H+IU7Pky1is8xyuEK+9kGBWIoLuaq9icG21kKJcEhuV7Ii2PWtuTVe re5Q== 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=CVYey4UVefRHLVvdtbk6QYZvAruc9GXeyyuWUJUL9fA=; b=qSWd5h85KPMyKFWd8YhI6CeQus1wNvS5eOt+RUFMHtVlIZEjG3xB5jjkCVJwZRAWR1 8keVXeyMbqDhdKlNSmsgnRsuOkRZnMeswnIOBN9fXc1nN5jWj4EukCz0zP4sKjFT2lV9 spgJgPQnv1KsMecBXoQz4mIqeqkwhgtrfeN49QDE9K3cOWjB5ZH0pC0ifCgTyQa0WMYk pGqzDvGTjF2lyaPR+WTSGgMiKxYVAKWNQNTG2+SdYOkmIWovDOvfyM1fPEy+b4X6DTP+ vmDDTpqdWqFy2GiuhpMeDXXnj2RvL5pm3FnSSue4OnITRMATDhWPIV23cBhQwFSM7zHs Jg0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FI5+FPsZ; 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 k2si1059600ejv.324.2020.04.23.04.24.05; Thu, 23 Apr 2020 04:24:28 -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=FI5+FPsZ; 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 S1728052AbgDWLWs (ORCPT + 99 others); Thu, 23 Apr 2020 07:22:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:42754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727906AbgDWLWr (ORCPT ); Thu, 23 Apr 2020 07:22:47 -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 D209E20728; Thu, 23 Apr 2020 11:22:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587640967; bh=Dx7pQDrVmQyMAWZBprtve56fnyMOnl9a9oj3FT6oQHE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FI5+FPsZ1FmhD66ETyrYkhZNgHK867H3td2EoxXUWTV4/dyuTWffaL/B01Pj3kIO0 3oPVjAJzOpIacBxufSHVnC8tJ2Bdv5XnXoj6ZwqTvmBvOV7GGV3hi/4Gt9ospB7JPL HEi7L5mlrbqNZlgvuc+YnWebDmR2ZmgFYwgSczgE= Date: Thu, 23 Apr 2020 12:22:44 +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: <20200423112244.GH4808@sirena.org.uk> References: <1587620791-5279-1-git-send-email-peng.fan@nxp.com> <20200423104000.GD4808@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0OWHXb1mYLuhj1Ox" Content-Disposition: inline In-Reply-To: X-Cookie: This unit... must... survive. 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 --0OWHXb1mYLuhj1Ox Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Apr 23, 2020 at 10:51:36AM +0000, Peng Fan wrote: > > This will mean that we're doing clk_prepare() during I/O which isn't good > > since for MMIO regmaps we support I/O operations in atomic contexts. > Ah, yes. Do you have any suggestions? If we use clk_prepare at the very > beginning, the power that binded to the clk device will be always on, > and cause power consumption high. Not really in regmap itself - I think your best bet here is to move the clock handling out of regmap and up into the driver. regmap won't do any I/O unless your driver calls it so this will work fine, this support is only there in regmap as a convenience but if it's getting in the way then you're probably going to be able to do a better job pushing this into rutime PM in the driver or just having direct clock calls. --0OWHXb1mYLuhj1Ox Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl6heoQACgkQJNaLcl1U h9CBywf/fnPhJcXY/ZcsnQ/vi7O9VXPKIUEMsFAKUwu8ovYZddm/l6F8UyHMsiC4 F2UqvKs2OQYkgFaYlFPX1Iz7/6mIh6tP/GvG62CtvCj4a1cBfnORs0bz9+N9fbiS ZPvPAkToWzpV46b11jtFNkipWF/B0/9R5p6DDmA67GkLp8lTTotLqEKPg1aAMWHr 6oyxAIE/wE+j0ZSbueHwMInY2ZDZ8tMetzOw2AEx9VIKyWq36iSXu1u+B0MVlzzR Wh/4GDgenCPocGtQLUpsjnIKP3Md2VdEShpziIDHTZd3FTW7swo582KksFKOK/jq NjoDzT5amhMVYNtmsTdgyAZ/E2vxig== =Krch -----END PGP SIGNATURE----- --0OWHXb1mYLuhj1Ox--