linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ARM: tegra: enforce PM requirement
@ 2019-02-26  8:25 Sameer Pujar
  2019-02-26  9:13 ` Russell King - ARM Linux admin
  2019-02-26 14:46 ` Dmitry Osipenko
  0 siblings, 2 replies; 7+ messages in thread
From: Sameer Pujar @ 2019-02-26  8:25 UTC (permalink / raw)
  To: digetx, linux, jhogan
  Cc: thierry.reding, jonathanh, linux-kernel, Sameer Pujar

The requirement for this came while adding runtime PM support for HDA
driver. There were concerns about driver explicitly handling !PM case.
In general, drivers need to handle !PM case with work arounds for
managing clocks and power explicitly, which is not really necessary
when PM support on tegra is in good shape. In fact ARM 64-bit Tegra
platforms enforce PM support and there is no reason why this cannot be
done for 32-bit.

More details with regards to above can be found in following patch,
http://patchwork.ozlabs.org/patch/1036645/

This patch selects PM unconditionally and drivers can rely on runtime
PM framework for clock and power management.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
---
 arch/arm/mach-tegra/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 7f3b83e..51a8fa3 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -10,6 +10,7 @@ menuconfig ARCH_TEGRA
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if SMP
 	select PINCTRL
+	select PM
 	select PM_OPP
 	select ARCH_HAS_RESET_CONTROLLER
 	select RESET_CONTROLLER
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] ARM: tegra: enforce PM requirement
  2019-02-26  8:25 [PATCH v2] ARM: tegra: enforce PM requirement Sameer Pujar
@ 2019-02-26  9:13 ` Russell King - ARM Linux admin
  2019-02-26 16:52   ` Dmitry Osipenko
  2019-02-27 10:41   ` Thierry Reding
  2019-02-26 14:46 ` Dmitry Osipenko
  1 sibling, 2 replies; 7+ messages in thread
From: Russell King - ARM Linux admin @ 2019-02-26  9:13 UTC (permalink / raw)
  To: Sameer Pujar; +Cc: digetx, jhogan, thierry.reding, jonathanh, linux-kernel

On Tue, Feb 26, 2019 at 01:55:37PM +0530, Sameer Pujar wrote:
> The requirement for this came while adding runtime PM support for HDA
> driver. There were concerns about driver explicitly handling !PM case.
> In general, drivers need to handle !PM case with work arounds for
> managing clocks and power explicitly, which is not really necessary
> when PM support on tegra is in good shape. In fact ARM 64-bit Tegra
> platforms enforce PM support and there is no reason why this cannot be
> done for 32-bit.
> 
> More details with regards to above can be found in following patch,
> http://patchwork.ozlabs.org/patch/1036645/
> 
> This patch selects PM unconditionally and drivers can rely on runtime
> PM framework for clock and power management.

What if the drivers are re-used on another SoC IP?  Doesn't this lead
to unexpected failures?

If you want to do this, maybe also make those drivers depend on PM as
well?

> Signed-off-by: Sameer Pujar <spujar@nvidia.com>
> Reviewed-by: Thierry Reding <treding@nvidia.com>
> Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
> ---
>  arch/arm/mach-tegra/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
> index 7f3b83e..51a8fa3 100644
> --- a/arch/arm/mach-tegra/Kconfig
> +++ b/arch/arm/mach-tegra/Kconfig
> @@ -10,6 +10,7 @@ menuconfig ARCH_TEGRA
>  	select HAVE_ARM_SCU if SMP
>  	select HAVE_ARM_TWD if SMP
>  	select PINCTRL
> +	select PM
>  	select PM_OPP
>  	select ARCH_HAS_RESET_CONTROLLER
>  	select RESET_CONTROLLER
> -- 
> 2.7.4
> 
> 

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] ARM: tegra: enforce PM requirement
  2019-02-26  8:25 [PATCH v2] ARM: tegra: enforce PM requirement Sameer Pujar
  2019-02-26  9:13 ` Russell King - ARM Linux admin
@ 2019-02-26 14:46 ` Dmitry Osipenko
  2019-02-27  6:14   ` Sameer Pujar
  1 sibling, 1 reply; 7+ messages in thread
From: Dmitry Osipenko @ 2019-02-26 14:46 UTC (permalink / raw)
  To: Sameer Pujar, linux, jhogan; +Cc: thierry.reding, jonathanh, linux-kernel

26.02.2019 11:25, Sameer Pujar пишет:
> The requirement for this came while adding runtime PM support for HDA
> driver. There were concerns about driver explicitly handling !PM case.
> In general, drivers need to handle !PM case with work arounds for
> managing clocks and power explicitly, which is not really necessary
> when PM support on tegra is in good shape. In fact ARM 64-bit Tegra
> platforms enforce PM support and there is no reason why this cannot be
> done for 32-bit.
> 
> More details with regards to above can be found in following patch,
> http://patchwork.ozlabs.org/patch/1036645/

I think you meant this: https://patchwork.ozlabs.org/patch/1031007/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] ARM: tegra: enforce PM requirement
  2019-02-26  9:13 ` Russell King - ARM Linux admin
@ 2019-02-26 16:52   ` Dmitry Osipenko
  2019-02-27  6:17     ` Sameer Pujar
  2019-02-27 10:41   ` Thierry Reding
  1 sibling, 1 reply; 7+ messages in thread
From: Dmitry Osipenko @ 2019-02-26 16:52 UTC (permalink / raw)
  To: Russell King - ARM Linux admin, Sameer Pujar
  Cc: jhogan, thierry.reding, jonathanh, linux-kernel

26.02.2019 12:13, Russell King - ARM Linux admin пишет:
> On Tue, Feb 26, 2019 at 01:55:37PM +0530, Sameer Pujar wrote:
>> The requirement for this came while adding runtime PM support for HDA
>> driver. There were concerns about driver explicitly handling !PM case.
>> In general, drivers need to handle !PM case with work arounds for
>> managing clocks and power explicitly, which is not really necessary
>> when PM support on tegra is in good shape. In fact ARM 64-bit Tegra
>> platforms enforce PM support and there is no reason why this cannot be
>> done for 32-bit.
>>
>> More details with regards to above can be found in following patch,
>> http://patchwork.ozlabs.org/patch/1036645/
>>
>> This patch selects PM unconditionally and drivers can rely on runtime
>> PM framework for clock and power management.
> 
> What if the drivers are re-used on another SoC IP?  Doesn't this lead
> to unexpected failures?
> 
> If you want to do this, maybe also make those drivers depend on PM as
> well?

The commit message is inaccurate, it is intended for the Tegra HDA driver and not for some generic driver. The overall final intent is to remove dependency on the PM availability for all of Tegra drivers to "make Tegra maintainers life easier".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] ARM: tegra: enforce PM requirement
  2019-02-26 14:46 ` Dmitry Osipenko
@ 2019-02-27  6:14   ` Sameer Pujar
  0 siblings, 0 replies; 7+ messages in thread
From: Sameer Pujar @ 2019-02-27  6:14 UTC (permalink / raw)
  To: Dmitry Osipenko, linux, jhogan; +Cc: thierry.reding, jonathanh, linux-kernel


On 2/26/2019 8:16 PM, Dmitry Osipenko wrote:
> 26.02.2019 11:25, Sameer Pujar пишет:
>> The requirement for this came while adding runtime PM support for HDA
>> driver. There were concerns about driver explicitly handling !PM case.
>> In general, drivers need to handle !PM case with work arounds for
>> managing clocks and power explicitly, which is not really necessary
>> when PM support on tegra is in good shape. In fact ARM 64-bit Tegra
>> platforms enforce PM support and there is no reason why this cannot be
>> done for 32-bit.
>>
>> More details with regards to above can be found in following patch,
>> http://patchwork.ozlabs.org/patch/1036645/
> I think you meant this: https://patchwork.ozlabs.org/patch/1031007/
my bad! Thanks for pointing.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] ARM: tegra: enforce PM requirement
  2019-02-26 16:52   ` Dmitry Osipenko
@ 2019-02-27  6:17     ` Sameer Pujar
  0 siblings, 0 replies; 7+ messages in thread
From: Sameer Pujar @ 2019-02-27  6:17 UTC (permalink / raw)
  To: Dmitry Osipenko, Russell King - ARM Linux admin
  Cc: jhogan, thierry.reding, jonathanh, linux-kernel


On 2/26/2019 10:22 PM, Dmitry Osipenko wrote:
> 26.02.2019 12:13, Russell King - ARM Linux admin пишет:
>> On Tue, Feb 26, 2019 at 01:55:37PM +0530, Sameer Pujar wrote:
>>> The requirement for this came while adding runtime PM support for HDA
>>> driver. There were concerns about driver explicitly handling !PM case.
>>> In general, drivers need to handle !PM case with work arounds for
>>> managing clocks and power explicitly, which is not really necessary
>>> when PM support on tegra is in good shape. In fact ARM 64-bit Tegra
>>> platforms enforce PM support and there is no reason why this cannot be
>>> done for 32-bit.
>>>
>>> More details with regards to above can be found in following patch,
>>> http://patchwork.ozlabs.org/patch/1036645/
>>>
>>> This patch selects PM unconditionally and drivers can rely on runtime
>>> PM framework for clock and power management.
>> What if the drivers are re-used on another SoC IP?  Doesn't this lead
>> to unexpected failures?
>>
>> If you want to do this, maybe also make those drivers depend on PM as
>> well?
> The commit message is inaccurate, it is intended for the Tegra HDA driver and not for some generic driver. The overall final intent is to remove dependency on the PM availability for all of Tegra drivers to "make Tegra maintainers life easier".
Wanted to convey that finally it would be the case for all Tegra 
drivers. I will update commit message to make it more clear.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] ARM: tegra: enforce PM requirement
  2019-02-26  9:13 ` Russell King - ARM Linux admin
  2019-02-26 16:52   ` Dmitry Osipenko
@ 2019-02-27 10:41   ` Thierry Reding
  1 sibling, 0 replies; 7+ messages in thread
From: Thierry Reding @ 2019-02-27 10:41 UTC (permalink / raw)
  To: Russell King - ARM Linux admin
  Cc: Sameer Pujar, digetx, jhogan, jonathanh, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2667 bytes --]

On Tue, Feb 26, 2019 at 09:13:08AM +0000, Russell King - ARM Linux admin wrote:
> On Tue, Feb 26, 2019 at 01:55:37PM +0530, Sameer Pujar wrote:
> > The requirement for this came while adding runtime PM support for HDA
> > driver. There were concerns about driver explicitly handling !PM case.
> > In general, drivers need to handle !PM case with work arounds for
> > managing clocks and power explicitly, which is not really necessary
> > when PM support on tegra is in good shape. In fact ARM 64-bit Tegra
> > platforms enforce PM support and there is no reason why this cannot be
> > done for 32-bit.
> > 
> > More details with regards to above can be found in following patch,
> > http://patchwork.ozlabs.org/patch/1036645/
> > 
> > This patch selects PM unconditionally and drivers can rely on runtime
> > PM framework for clock and power management.
> 
> What if the drivers are re-used on another SoC IP?  Doesn't this lead
> to unexpected failures?

I suppose it would if the configuration doesn't enable PM. In practice I
don't think this happens very often. I'm also not aware of any of the IP
blocks in Tegra being reused on other SoCs, so I think the risk of this
happening isn't very high.

> If you want to do this, maybe also make those drivers depend on PM as
> well?

That said, I think adding the dependency on PM is good documentation and
would prevent the cases that you're describing from happening, so I'll
see to it that we get it added where needed.

I think all drivers currently support running without PM, but the code
to do it is cumbersome and highly repetitive. I think we can add the PM
dependency at the same time that we remove the !PM boilerplate.

Thierry

> > Signed-off-by: Sameer Pujar <spujar@nvidia.com>
> > Reviewed-by: Thierry Reding <treding@nvidia.com>
> > Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
> > ---
> >  arch/arm/mach-tegra/Kconfig | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
> > index 7f3b83e..51a8fa3 100644
> > --- a/arch/arm/mach-tegra/Kconfig
> > +++ b/arch/arm/mach-tegra/Kconfig
> > @@ -10,6 +10,7 @@ menuconfig ARCH_TEGRA
> >  	select HAVE_ARM_SCU if SMP
> >  	select HAVE_ARM_TWD if SMP
> >  	select PINCTRL
> > +	select PM
> >  	select PM_OPP
> >  	select ARCH_HAS_RESET_CONTROLLER
> >  	select RESET_CONTROLLER
> > -- 
> > 2.7.4
> > 
> > 
> 
> -- 
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
> According to speedtest.net: 11.9Mbps down 500kbps up

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-02-27 10:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-26  8:25 [PATCH v2] ARM: tegra: enforce PM requirement Sameer Pujar
2019-02-26  9:13 ` Russell King - ARM Linux admin
2019-02-26 16:52   ` Dmitry Osipenko
2019-02-27  6:17     ` Sameer Pujar
2019-02-27 10:41   ` Thierry Reding
2019-02-26 14:46 ` Dmitry Osipenko
2019-02-27  6:14   ` Sameer Pujar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).