[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB6PR0402MB2760FBCA05C1BADB27F0356488D00@DB6PR0402MB2760.eurprd04.prod.outlook.com>
Date: Fri, 24 Apr 2020 01:27:29 +0000
From: Peng Fan <peng.fan@....com>
To: Mark Brown <broonie@...nel.org>
CC: "rafael@...nel.org" <rafael@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
dl-linux-imx <linux-imx@....com>,
"S.j. Wang" <shengjiu.wang@....com>
Subject: RE: [PATCH] regmap: mmio: prepare/unprepare clk only when read/write
> Subject: Re: [PATCH] regmap: mmio: prepare/unprepare clk only when
> read/write
>
> 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.
If we not pass clk to regmap, accessing regmap registers will hang system with
Debugfs enabled.
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_unprepare
into debugfs ops open/close?
Thanks,
Peng.
Powered by blists - more mailing lists