public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 2/2] ARM: DT: tegra: pinctrl suspend resume hook
       [not found] ` <1366740542-26127-2-git-send-email-bbasu@nvidia.com>
@ 2013-04-26 19:49   ` Thierry Reding
       [not found]     ` <20130426194908.GA3302-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Thierry Reding @ 2013-04-26 19:49 UTC (permalink / raw)
  To: Bibek Basu
  Cc: Rafael J. Wysocki, linus.walleij, swarren, linux-tegra,
	linux-kernel, linux-pm

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

On Tue, Apr 23, 2013 at 11:39:02PM +0530, Bibek Basu wrote:
> Make pinmux as the first node of tegra DT
> so as to achieve pinctrl as last device to suspend and
> first device to resume.

I don't think this is a good idea. For one it encodes Linux specific
implementation details within the device tree. Furthermore I seem to
remember that the device tree makes no guarantees that the order of
nodes in the blob is the same as the order in the DTS.

That said I don't have a good alternative. Perhaps one solution would be
to use suspend_late() and resume_early() for the pinmux driver since
they will be called after and before the suspend() and resume()
callbacks of all other devices, respectively. Other than that I wasn't
able to find anything about forcing a particular order during suspend
and resume.

Cc'ing Rafael and the linux-pm mailing list, maybe somebody among them
knows a proper solution.

Thierry

> 
> Signed-off-by: Bibek Basu <bbasu@nvidia.com>
> ---
>  arch/arm/boot/dts/tegra114.dtsi | 12 ++++++------
>  arch/arm/boot/dts/tegra20.dtsi  | 16 ++++++++--------
>  arch/arm/boot/dts/tegra30.dtsi  | 13 +++++++------
>  3 files changed, 21 insertions(+), 20 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi
> index a58a761..36596ae 100644
> --- a/arch/arm/boot/dts/tegra114.dtsi
> +++ b/arch/arm/boot/dts/tegra114.dtsi
> @@ -11,6 +11,12 @@
>  		serial3 = &uartd;
>  	};
>  
> +	pinmux: pinmux {
> +		compatible = "nvidia,tegra114-pinmux";
> +		reg = <0x70000868 0x148		/* Pad control registers */
> +		       0x70003000 0x40c>;	/* Mux registers */
> +	};
> +
>  	host1x {
>  		compatible = "nvidia,tegra114-host1x", "simple-bus";
>  		reg = <0x50000000 0x00028000>;
> @@ -165,12 +171,6 @@
>  		interrupt-controller;
>  	};
>  
> -	pinmux: pinmux {
> -		compatible = "nvidia,tegra114-pinmux";
> -		reg = <0x70000868 0x148		/* Pad control registers */
> -		       0x70003000 0x40c>;	/* Mux registers */
> -	};
> -
>  	/*
>  	 * There are two serial driver i.e. 8250 based simple serial
>  	 * driver and APB DMA based serial driver for higher baudrate
> diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
> index a5a9615..6d8a663 100644
> --- a/arch/arm/boot/dts/tegra20.dtsi
> +++ b/arch/arm/boot/dts/tegra20.dtsi
> @@ -12,6 +12,14 @@
>  		serial4 = &uarte;
>  	};
>  
> +	pinmux: pinmux {
> +		compatible = "nvidia,tegra20-pinmux";
> +		reg = <0x70000014 0x10   /* Tri-state registers */
> +		       0x70000080 0x20   /* Mux registers */
> +		       0x700000a0 0x14   /* Pull-up/down registers */
> +		       0x70000868 0xa8>; /* Pad control registers */
> +	};
> +
>  	host1x {
>  		compatible = "nvidia,tegra20-host1x", "simple-bus";
>  		reg = <0x50000000 0x00024000>;
> @@ -196,14 +204,6 @@
>  		interrupt-controller;
>  	};
>  
> -	pinmux: pinmux {
> -		compatible = "nvidia,tegra20-pinmux";
> -		reg = <0x70000014 0x10   /* Tri-state registers */
> -		       0x70000080 0x20   /* Mux registers */
> -		       0x700000a0 0x14   /* Pull-up/down registers */
> -		       0x70000868 0xa8>; /* Pad control registers */
> -	};
> -
>  	das {
>  		compatible = "nvidia,tegra20-das";
>  		reg = <0x70000c00 0x80>;
> diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
> index 9f33086..b4b79f0 100644
> --- a/arch/arm/boot/dts/tegra30.dtsi
> +++ b/arch/arm/boot/dts/tegra30.dtsi
> @@ -12,6 +12,13 @@
>  		serial4 = &uarte;
>  	};
>  
> +	pinmux: pinmux {
> +		compatible = "nvidia,tegra30-pinmux";
> +		reg = <0x70000868 0xd4    /* Pad control registers */
> +		       0x70003000 0x3e4>; /* Mux registers */
> +	};
> +
> +
>  	host1x {
>  		compatible = "nvidia,tegra30-host1x", "simple-bus";
>  		reg = <0x50000000 0x00024000>;
> @@ -216,12 +223,6 @@
>  		interrupt-controller;
>  	};
>  
> -	pinmux: pinmux {
> -		compatible = "nvidia,tegra30-pinmux";
> -		reg = <0x70000868 0xd4    /* Pad control registers */
> -		       0x70003000 0x3e4>; /* Mux registers */
> -	};
> -
>  	/*
>  	 * There are two serial driver i.e. 8250 based simple serial
>  	 * driver and APB DMA based serial driver for higher baudrate
> -- 
> 1.8.1.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* RE: [PATCH 2/2] ARM: DT: tegra: pinctrl suspend resume hook
       [not found]     ` <20130426194908.GA3302-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
@ 2013-04-28 13:42       ` Bibek Basu
       [not found]         ` <77F7DB30C698A44DA22FB222C89DE941A6692E62BD-kdsAE/FnitNDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Bibek Basu @ 2013-04-28 13:42 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Rafael J. Wysocki,
	linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

> -----Original Message-----
> From: Thierry Reding [mailto:thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org]
> Sent: Saturday, April 27, 2013 1:19 AM
> To: Bibek Basu
> Cc: Rafael J. Wysocki; linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org; swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org;
> linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux-
> pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Subject: Re: [PATCH 2/2] ARM: DT: tegra: pinctrl suspend resume hook
> 
> * PGP Signed by an unknown key
> 
> On Tue, Apr 23, 2013 at 11:39:02PM +0530, Bibek Basu wrote:
> > Make pinmux as the first node of tegra DT so as to achieve pinctrl as
> > last device to suspend and first device to resume.
> 
> I don't think this is a good idea. For one it encodes Linux specific
> implementation details within the device tree. Furthermore I seem to
> remember that the device tree makes no guarantees that the order of nodes
> in the blob is the same as the order in the DTS.
> 
> That said I don't have a good alternative. Perhaps one solution would be to
> use suspend_late() and resume_early() for the pinmux driver since they will
> be called after and before the suspend() and resume() callbacks of all other
> devices, respectively. Other than that I wasn't able to find anything about
> forcing a particular order during suspend and resume.
> 
> Cc'ing Rafael and the linux-pm mailing list, maybe somebody among them
> knows a proper solution.
> 
Stephen actually suggested me earlier to add dummy pinmux state on all dependent devices node. And that will make sure that dependency of driver prevails.
I tried that but I was not getting the desired result.
Can anyone tell me correct syntax for adding dummy state?

Regards
Bibek

> Thierry
> 
> >
> > Signed-off-by: Bibek Basu <bbasu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> > ---
> >  arch/arm/boot/dts/tegra114.dtsi | 12 ++++++------
> > arch/arm/boot/dts/tegra20.dtsi  | 16 ++++++++--------
> > arch/arm/boot/dts/tegra30.dtsi  | 13 +++++++------
> >  3 files changed, 21 insertions(+), 20 deletions(-)
> >
> > diff --git a/arch/arm/boot/dts/tegra114.dtsi
> > b/arch/arm/boot/dts/tegra114.dtsi index a58a761..36596ae 100644
> > --- a/arch/arm/boot/dts/tegra114.dtsi
> > +++ b/arch/arm/boot/dts/tegra114.dtsi
> > @@ -11,6 +11,12 @@
> >  		serial3 = &uartd;
> >  	};
> >
> > +	pinmux: pinmux {
> > +		compatible = "nvidia,tegra114-pinmux";
> > +		reg = <0x70000868 0x148		/* Pad control
> registers */
> > +		       0x70003000 0x40c>;	/* Mux registers */
> > +	};
> > +
> >  	host1x {
> >  		compatible = "nvidia,tegra114-host1x", "simple-bus";
> >  		reg = <0x50000000 0x00028000>;
> > @@ -165,12 +171,6 @@
> >  		interrupt-controller;
> >  	};
> >
> > -	pinmux: pinmux {
> > -		compatible = "nvidia,tegra114-pinmux";
> > -		reg = <0x70000868 0x148		/* Pad control
> registers */
> > -		       0x70003000 0x40c>;	/* Mux registers */
> > -	};
> > -
> >  	/*
> >  	 * There are two serial driver i.e. 8250 based simple serial
> >  	 * driver and APB DMA based serial driver for higher baudrate diff
> > --git a/arch/arm/boot/dts/tegra20.dtsi
> > b/arch/arm/boot/dts/tegra20.dtsi index a5a9615..6d8a663 100644
> > --- a/arch/arm/boot/dts/tegra20.dtsi
> > +++ b/arch/arm/boot/dts/tegra20.dtsi
> > @@ -12,6 +12,14 @@
> >  		serial4 = &uarte;
> >  	};
> >
> > +	pinmux: pinmux {
> > +		compatible = "nvidia,tegra20-pinmux";
> > +		reg = <0x70000014 0x10   /* Tri-state registers */
> > +		       0x70000080 0x20   /* Mux registers */
> > +		       0x700000a0 0x14   /* Pull-up/down registers */
> > +		       0x70000868 0xa8>; /* Pad control registers */
> > +	};
> > +
> >  	host1x {
> >  		compatible = "nvidia,tegra20-host1x", "simple-bus";
> >  		reg = <0x50000000 0x00024000>;
> > @@ -196,14 +204,6 @@
> >  		interrupt-controller;
> >  	};
> >
> > -	pinmux: pinmux {
> > -		compatible = "nvidia,tegra20-pinmux";
> > -		reg = <0x70000014 0x10   /* Tri-state registers */
> > -		       0x70000080 0x20   /* Mux registers */
> > -		       0x700000a0 0x14   /* Pull-up/down registers */
> > -		       0x70000868 0xa8>; /* Pad control registers */
> > -	};
> > -
> >  	das {
> >  		compatible = "nvidia,tegra20-das";
> >  		reg = <0x70000c00 0x80>;
> > diff --git a/arch/arm/boot/dts/tegra30.dtsi
> > b/arch/arm/boot/dts/tegra30.dtsi index 9f33086..b4b79f0 100644
> > --- a/arch/arm/boot/dts/tegra30.dtsi
> > +++ b/arch/arm/boot/dts/tegra30.dtsi
> > @@ -12,6 +12,13 @@
> >  		serial4 = &uarte;
> >  	};
> >
> > +	pinmux: pinmux {
> > +		compatible = "nvidia,tegra30-pinmux";
> > +		reg = <0x70000868 0xd4    /* Pad control registers */
> > +		       0x70003000 0x3e4>; /* Mux registers */
> > +	};
> > +
> > +
> >  	host1x {
> >  		compatible = "nvidia,tegra30-host1x", "simple-bus";
> >  		reg = <0x50000000 0x00024000>;
> > @@ -216,12 +223,6 @@
> >  		interrupt-controller;
> >  	};
> >
> > -	pinmux: pinmux {
> > -		compatible = "nvidia,tegra30-pinmux";
> > -		reg = <0x70000868 0xd4    /* Pad control registers */
> > -		       0x70003000 0x3e4>; /* Mux registers */
> > -	};
> > -
> >  	/*
> >  	 * There are two serial driver i.e. 8250 based simple serial
> >  	 * driver and APB DMA based serial driver for higher baudrate
> > --
> > 1.8.1.5
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-tegra"
> > in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More
> majordomo
> > info at  http://vger.kernel.org/majordomo-info.html
> >
> >
> 
> * Unknown Key
> * 0x7F3EB3A1

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

* Re: [PATCH 2/2] ARM: DT: tegra: pinctrl suspend resume hook
       [not found]         ` <77F7DB30C698A44DA22FB222C89DE941A6692E62BD-kdsAE/FnitNDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
@ 2013-05-02 18:33           ` Stephen Warren
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2013-05-02 18:33 UTC (permalink / raw)
  To: Bibek Basu
  Cc: Thierry Reding, Rafael J. Wysocki,
	linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On 04/28/2013 07:42 AM, Bibek Basu wrote:
>> -----Original Message-----
>> From: Thierry Reding [mailto:thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org]
>> Sent: Saturday, April 27, 2013 1:19 AM
>> To: Bibek Basu
>> Cc: Rafael J. Wysocki; linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org; swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org;
>> linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux-
>> pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> Subject: Re: [PATCH 2/2] ARM: DT: tegra: pinctrl suspend resume hook
>>
>> * PGP Signed by an unknown key
>>
>> On Tue, Apr 23, 2013 at 11:39:02PM +0530, Bibek Basu wrote:
>>> Make pinmux as the first node of tegra DT so as to achieve pinctrl as
>>> last device to suspend and first device to resume.
>>
>> I don't think this is a good idea. For one it encodes Linux specific
>> implementation details within the device tree. Furthermore I seem to
>> remember that the device tree makes no guarantees that the order of nodes
>> in the blob is the same as the order in the DTS.
>>
>> That said I don't have a good alternative. Perhaps one solution would be to
>> use suspend_late() and resume_early() for the pinmux driver since they will
>> be called after and before the suspend() and resume() callbacks of all other
>> devices, respectively. Other than that I wasn't able to find anything about
>> forcing a particular order during suspend and resume.
>>
>> Cc'ing Rafael and the linux-pm mailing list, maybe somebody among them
>> knows a proper solution.
>
> Stephen actually suggested me earlier to add dummy pinmux state on all dependent devices node. And that will make sure that dependency of driver prevails.
> I tried that but I was not getting the desired result.
> Can anyone tell me correct syntax for adding dummy state?

I agree with Thierry that this patch is not the correct approach.

A dummy pinctrl state would look something like the following in each
affected device node:

                pinctrl-names = "default";
                pinctrl-0 = <>;

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

end of thread, other threads:[~2013-05-02 18:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1366740542-26127-1-git-send-email-bbasu@nvidia.com>
     [not found] ` <1366740542-26127-2-git-send-email-bbasu@nvidia.com>
2013-04-26 19:49   ` [PATCH 2/2] ARM: DT: tegra: pinctrl suspend resume hook Thierry Reding
     [not found]     ` <20130426194908.GA3302-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2013-04-28 13:42       ` Bibek Basu
     [not found]         ` <77F7DB30C698A44DA22FB222C89DE941A6692E62BD-kdsAE/FnitNDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2013-05-02 18:33           ` Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox