All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@xilinx.com>
To: Amit Sunil Dhamne <amit.sunil.dhamne@xilinx.com>,
	ard.biesheuvel@linaro.org, mingo@kernel.org,
	gregkh@linuxfoundation.org, matt@codeblueprint.co.uk,
	sudeep.holla@arm.com, hkallweit1@gmail.com,
	keescook@chromium.org, dmitry.torokhov@gmail.com,
	michal.simek@xilinx.com
Cc: rajanv@xilinx.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, tejasp@xilinx.com,
	jollys@xilinx.com, Rajan Vaja <rajan.vaja@xilinx.com>
Subject: Re: [PATCH] drivers: soc: xilinx: Call InitFinalize from late_initcall_sync instead of probe
Date: Thu, 30 Jul 2020 07:32:30 +0200	[thread overview]
Message-ID: <48f8ea58-ffdf-6778-cf7a-4c14d50a1e83@xilinx.com> (raw)
In-Reply-To: <20200722232551.29549-1-amit.sunil.dhamne@xilinx.com>



On 23. 07. 20 1:25, Amit Sunil Dhamne wrote:
> From: Rajan Vaja <rajan.vaja@xilinx.com>
> 
> Initially all devices are in power up state. Firmware expect that
> processor should call InitFinalize API once it have requested devices
> which are required so that it can turn off all unused devices and
> save power. From Linux, PM driver calls InitFinalize to inform the
> firmware that it can power down the unused devices. Upon
> InitFinalize() call firmware power downs all unused devices.
> 
> There are chances that PM driver is probed along with or before other
> device drivers. So in that case some of the devices may not be
> requested from firmware which is done by genpd driver. Due to that
> firmware will consider those devices as unused and firmware will power
> down those devices. Later when any device driver is probed, genpd
> driver will ask firmware to power up that device using request node
> API. So for those devices, power transition will be like on->off->on
> which creates unnecessary power glitch to those devices.
> 
> To avoid such unnecessary power transitions and as ideal behavior
> InitFinalize should be called after all drivers are probed. So call
> InitFinalize from late_initcall_sync.
> 
> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> Signed-off-by: Amit Sunil Dhamne <amit.sunil.dhamne@xilinx.com>
> ---
>  drivers/soc/xilinx/zynqmp_power.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c
> index 31ff49fcd078..fa05cf12d5f3 100644
> --- a/drivers/soc/xilinx/zynqmp_power.c
> +++ b/drivers/soc/xilinx/zynqmp_power.c
> @@ -178,7 +178,6 @@ static int zynqmp_pm_probe(struct platform_device *pdev)
>  	u32 pm_api_version;
>  	struct mbox_client *client;
>  
> -	zynqmp_pm_init_finalize();
>  	zynqmp_pm_get_api_version(&pm_api_version);
>  
>  	/* Check PM API version number */
> @@ -246,6 +245,13 @@ static int zynqmp_pm_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static int __init do_init_finalize(void)
> +{
> +	return zynqmp_pm_init_finalize();
> +}
> +
> +late_initcall_sync(do_init_finalize);
> +
>  static const struct of_device_id pm_of_match[] = {
>  	{ .compatible = "xlnx,zynqmp-power", },
>  	{ /* end of table */ },
> 

Applied.
M

WARNING: multiple messages have this Message-ID (diff)
From: Michal Simek <michal.simek@xilinx.com>
To: Amit Sunil Dhamne <amit.sunil.dhamne@xilinx.com>,
	ard.biesheuvel@linaro.org, mingo@kernel.org,
	gregkh@linuxfoundation.org, matt@codeblueprint.co.uk,
	sudeep.holla@arm.com, hkallweit1@gmail.com,
	keescook@chromium.org, dmitry.torokhov@gmail.com,
	michal.simek@xilinx.com
Cc: Rajan Vaja <rajan.vaja@xilinx.com>,
	tejasp@xilinx.com, linux-kernel@vger.kernel.org,
	jollys@xilinx.com, rajanv@xilinx.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] drivers: soc: xilinx: Call InitFinalize from late_initcall_sync instead of probe
Date: Thu, 30 Jul 2020 07:32:30 +0200	[thread overview]
Message-ID: <48f8ea58-ffdf-6778-cf7a-4c14d50a1e83@xilinx.com> (raw)
In-Reply-To: <20200722232551.29549-1-amit.sunil.dhamne@xilinx.com>



On 23. 07. 20 1:25, Amit Sunil Dhamne wrote:
> From: Rajan Vaja <rajan.vaja@xilinx.com>
> 
> Initially all devices are in power up state. Firmware expect that
> processor should call InitFinalize API once it have requested devices
> which are required so that it can turn off all unused devices and
> save power. From Linux, PM driver calls InitFinalize to inform the
> firmware that it can power down the unused devices. Upon
> InitFinalize() call firmware power downs all unused devices.
> 
> There are chances that PM driver is probed along with or before other
> device drivers. So in that case some of the devices may not be
> requested from firmware which is done by genpd driver. Due to that
> firmware will consider those devices as unused and firmware will power
> down those devices. Later when any device driver is probed, genpd
> driver will ask firmware to power up that device using request node
> API. So for those devices, power transition will be like on->off->on
> which creates unnecessary power glitch to those devices.
> 
> To avoid such unnecessary power transitions and as ideal behavior
> InitFinalize should be called after all drivers are probed. So call
> InitFinalize from late_initcall_sync.
> 
> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> Signed-off-by: Amit Sunil Dhamne <amit.sunil.dhamne@xilinx.com>
> ---
>  drivers/soc/xilinx/zynqmp_power.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c
> index 31ff49fcd078..fa05cf12d5f3 100644
> --- a/drivers/soc/xilinx/zynqmp_power.c
> +++ b/drivers/soc/xilinx/zynqmp_power.c
> @@ -178,7 +178,6 @@ static int zynqmp_pm_probe(struct platform_device *pdev)
>  	u32 pm_api_version;
>  	struct mbox_client *client;
>  
> -	zynqmp_pm_init_finalize();
>  	zynqmp_pm_get_api_version(&pm_api_version);
>  
>  	/* Check PM API version number */
> @@ -246,6 +245,13 @@ static int zynqmp_pm_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static int __init do_init_finalize(void)
> +{
> +	return zynqmp_pm_init_finalize();
> +}
> +
> +late_initcall_sync(do_init_finalize);
> +
>  static const struct of_device_id pm_of_match[] = {
>  	{ .compatible = "xlnx,zynqmp-power", },
>  	{ /* end of table */ },
> 

Applied.
M

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

  reply	other threads:[~2020-07-30  5:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22 23:25 [PATCH] drivers: soc: xilinx: Call InitFinalize from late_initcall_sync instead of probe Amit Sunil Dhamne
2020-07-22 23:25 ` Amit Sunil Dhamne
2020-07-30  5:32 ` Michal Simek [this message]
2020-07-30  5:32   ` Michal Simek

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=48f8ea58-ffdf-6778-cf7a-4c14d50a1e83@xilinx.com \
    --to=michal.simek@xilinx.com \
    --cc=amit.sunil.dhamne@xilinx.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hkallweit1@gmail.com \
    --cc=jollys@xilinx.com \
    --cc=keescook@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeblueprint.co.uk \
    --cc=mingo@kernel.org \
    --cc=rajan.vaja@xilinx.com \
    --cc=rajanv@xilinx.com \
    --cc=sudeep.holla@arm.com \
    --cc=tejasp@xilinx.com \
    /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.