[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <682fe745-1091-fcb8-eed6-82b501f3481c@kontron.de>
Date: Thu, 6 May 2021 09:55:57 +0200
From: Frieder Schrempf <frieder.schrempf@...tron.de>
To: "Peng Fan (OSS)" <peng.fan@....nxp.com>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"shawnguo@...nel.org" <shawnguo@...nel.org>,
"s.hauer@...gutronix.de" <s.hauer@...gutronix.de>
Cc: "kernel@...gutronix.de" <kernel@...gutronix.de>,
"festevam@...il.com" <festevam@...il.com>,
dl-linux-imx <linux-imx@....com>,
"p.zabel@...gutronix.de" <p.zabel@...gutronix.de>,
"l.stach@...gutronix.de" <l.stach@...gutronix.de>,
"krzk@...nel.org" <krzk@...nel.org>,
"agx@...xcpu.org" <agx@...xcpu.org>,
"marex@...x.de" <marex@...x.de>,
"andrew.smirnov@...il.com" <andrew.smirnov@...il.com>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Jacky Bai <ping.bai@....com>,
"aford173@...il.com" <aford173@...il.com>,
Abel Vesa <abel.vesa@....com>
Subject: Re: [PATCH V2 3/4] soc: imx: Add generic blk-ctl driver
On 04.05.21 13:22, Peng Fan (OSS) wrote:
>> Subject: Re: [PATCH V2 3/4] soc: imx: Add generic blk-ctl driver
>>
>> On 30.04.21 07:27, Peng Fan (OSS) wrote:
>>> From: Peng Fan <peng.fan@....com>
>>>
>>> The i.MX8MM introduces an IP named BLK_CTL and usually is comprised of
>>> some GPRs.
>>>
>>> The GPRs has some clock bits and reset bits, but here we take it as
>>> virtual PDs, because of the clock and power domain A/B lock issue when
>>> taking it as a clock controller.
>>>
>>> For some bits, it might be good to also make it as a reset controller,
>>> but to i.MX8MM, we not add that support for now.
>>>
>>> Signed-off-by: Peng Fan <peng.fan@....com>
>>> ---
>>> drivers/soc/imx/Makefile | 2 +-
>>> drivers/soc/imx/blk-ctl.c | 303
>> ++++++++++++++++++++++++++++++++++++++
>>> drivers/soc/imx/blk-ctl.h | 76 ++++++++++
>>> 3 files changed, 380 insertions(+), 1 deletion(-)
>>> create mode 100644 drivers/soc/imx/blk-ctl.c
>>> create mode 100644 drivers/soc/imx/blk-ctl.h
[...]
>>> +
>>> +static int imx_blk_ctl_attach_pd(struct device *dev, struct device **devs,
>> char **pd_names,
>>> + u32 num_pds)
>>> +{
>>> + int i, ret;
>>> +
>>> + if (!pd_names)
>>> + return 0;
>>> +
>>> + if (dev->pm_domain) {
>>> + devs[0] = dev;
>>> + pm_runtime_enable(dev);
>>> + return 0;
>>> + }
>>> +
>>> + for (i = 0; i < num_pds; i++) {
>>> + devs[i] = dev_pm_domain_attach_by_name(dev, pd_names[i]);
>>> + if (IS_ERR_OR_NULL(devs[i])) {
>>> + ret = PTR_ERR(devs[i]) ? : -ENODATA;
>>> + goto detach_pm;
>>> + }
>>> + }
>>> +
>>> + return 0;
>>> +
>>> +detach_pm:
>>> + for (i--; i >= 0; i--)
>>> + dev_pm_domain_detach(devs[i], false);
>>
>> It looks like you should add pm_runtime_disable() in this error path to not
>> leave the pm_runtime_enable() unmatched.
>
> I might need to remove pm runtime, since no the ops callback here does nothing.
Anyway, my comment is nonsense as you return success right after pm_runtime_enable().
Powered by blists - more mailing lists