All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frieder Schrempf <frieder.schrempf@kontron.de>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>
Cc: "kernel@pengutronix.de" <kernel@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	dl-linux-imx <linux-imx@nxp.com>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"l.stach@pengutronix.de" <l.stach@pengutronix.de>,
	"krzk@kernel.org" <krzk@kernel.org>,
	"agx@sigxcpu.org" <agx@sigxcpu.org>,
	"marex@denx.de" <marex@denx.de>,
	"andrew.smirnov@gmail.com" <andrew.smirnov@gmail.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jacky Bai <ping.bai@nxp.com>,
	"aford173@gmail.com" <aford173@gmail.com>,
	Abel Vesa <abel.vesa@nxp.com>
Subject: Re: [PATCH V2 3/4] soc: imx: Add generic blk-ctl driver
Date: Thu, 6 May 2021 09:55:57 +0200	[thread overview]
Message-ID: <682fe745-1091-fcb8-eed6-82b501f3481c@kontron.de> (raw)
In-Reply-To: <DB6PR0402MB2760169AE87307F2AF46D860885A9@DB6PR0402MB2760.eurprd04.prod.outlook.com>

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@nxp.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@nxp.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().

WARNING: multiple messages have this Message-ID (diff)
From: Frieder Schrempf <frieder.schrempf@kontron.de>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>
Cc: "kernel@pengutronix.de" <kernel@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	dl-linux-imx <linux-imx@nxp.com>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"l.stach@pengutronix.de" <l.stach@pengutronix.de>,
	"krzk@kernel.org" <krzk@kernel.org>,
	"agx@sigxcpu.org" <agx@sigxcpu.org>,
	"marex@denx.de" <marex@denx.de>,
	"andrew.smirnov@gmail.com" <andrew.smirnov@gmail.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jacky Bai <ping.bai@nxp.com>,
	"aford173@gmail.com" <aford173@gmail.com>,
	Abel Vesa <abel.vesa@nxp.com>
Subject: Re: [PATCH V2 3/4] soc: imx: Add generic blk-ctl driver
Date: Thu, 6 May 2021 09:55:57 +0200	[thread overview]
Message-ID: <682fe745-1091-fcb8-eed6-82b501f3481c@kontron.de> (raw)
In-Reply-To: <DB6PR0402MB2760169AE87307F2AF46D860885A9@DB6PR0402MB2760.eurprd04.prod.outlook.com>

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@nxp.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@nxp.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().

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-05-06  7:56 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-30  5:27 [PATCH V2 0/4] soc: imx: add i.MX BLK-CTL support Peng Fan (OSS)
2021-04-30  5:27 ` Peng Fan (OSS)
2021-04-30  5:27 ` [PATCH V2 1/4] dt-bindings: power: Add defines for i.MX8MM BLK-CTL power domains Peng Fan (OSS)
2021-04-30  5:27   ` Peng Fan (OSS)
2021-04-30  5:27 ` [PATCH V2 2/4] Documentation: bindings: clk: Add bindings for i.MX BLK_CTL Peng Fan (OSS)
2021-04-30  5:27   ` Peng Fan (OSS)
2021-05-05 23:08   ` Rob Herring
2021-05-05 23:08     ` Rob Herring
2021-05-06  0:50     ` Peng Fan (OSS)
2021-05-06  0:50       ` Peng Fan (OSS)
2021-04-30  5:27 ` [PATCH V2 3/4] soc: imx: Add generic blk-ctl driver Peng Fan (OSS)
2021-04-30  5:27   ` Peng Fan (OSS)
2021-05-04  9:47   ` Lucas Stach
2021-05-04  9:47     ` Lucas Stach
2021-05-04 10:30     ` Peng Fan (OSS)
2021-05-04 10:30       ` Peng Fan (OSS)
2021-05-04 10:16   ` Frieder Schrempf
2021-05-04 10:16     ` Frieder Schrempf
2021-05-04 11:22     ` Peng Fan (OSS)
2021-05-04 11:22       ` Peng Fan (OSS)
2021-05-06  7:55       ` Frieder Schrempf [this message]
2021-05-06  7:55         ` Frieder Schrempf
2021-04-30  5:27 ` [PATCH V2 4/4] soc: imx: Add blk-ctl driver for i.MX8MM Peng Fan (OSS)
2021-04-30  5:27   ` Peng Fan (OSS)
2021-05-04 10:25   ` Frieder Schrempf
2021-05-04 10:25     ` Frieder Schrempf
2021-05-04 11:13   ` Fabio Estevam
2021-05-04 11:13     ` Fabio Estevam
2021-05-04 11:22     ` Peng Fan
2021-05-04 11:22       ` Peng Fan
2021-04-30  6:19 ` [PATCH V2 0/4] soc: imx: add i.MX BLK-CTL support Peng Fan
2021-04-30  6:19   ` Peng Fan
2021-05-03 14:57 ` Frieder Schrempf
2021-05-03 14:57   ` Frieder Schrempf
2021-05-04  8:55   ` Frieder Schrempf
2021-05-04  8:55     ` Frieder Schrempf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=682fe745-1091-fcb8-eed6-82b501f3481c@kontron.de \
    --to=frieder.schrempf@kontron.de \
    --cc=abel.vesa@nxp.com \
    --cc=aford173@gmail.com \
    --cc=agx@sigxcpu.org \
    --cc=andrew.smirnov@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=krzk@kernel.org \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=p.zabel@pengutronix.de \
    --cc=peng.fan@oss.nxp.com \
    --cc=ping.bai@nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.