All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP2: UART: fix console UART mismatched runtime PM status
@ 2012-10-15 23:49 ` Kevin Hilman
  0 siblings, 0 replies; 14+ messages in thread
From: Kevin Hilman @ 2012-10-15 23:49 UTC (permalink / raw)
  To: Tony Lindgren, linux-omap
  Cc: Russell King, Paul Walmsley, linux-arm-kernel, Felipe Balbi,
	Sourav Poddar

From: Kevin Hilman <khilman@ti.com>

The runtime PM framework assumes that the hardware state of devices
when initialized is disabled.  For all omap_devices, we idle/disable
device by default.  However, the console uart uses a "no idle" option
during omap_device init in order to allow earlyprintk usage to work
seamlessly during boot.

Because the hardware is left partially enabled after init (whatever
the bootloader settings were), the omap_device should later be fully
initialized (including mux) and the runtime PM framework should be
told that the device is active, and not disabled so that the hardware
state is in sync with runtime PM state.

To fix, after the device has been created/registered, call
omap_device_enable() to finialize init and use pm_runtime_set_active()
to tell the runtime PM core the device is enabled.

Tested on 2420/n810, 3530/Overo, 3530/Beagle, 3730/OveroSTORM,
3730/Beagle-xM, 4460/PandaES.

Reported-by: Paul Walmsley <paul@pwsan.com>
Suggested-by: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
---
Applies against v3.7-rc1.
Fix targetted for v3.7.

I'm still not entirely sure why this has worked up to now on OMAP3/4
but not on OMAP2.  Even so, this fix is needed for all platforms to
ensure matching hardware state and runtime PM state.

 arch/arm/mach-omap2/serial.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 0405c81..37b5dbe 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -327,6 +327,11 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,
 	if ((console_uart_id == bdata->id) && no_console_suspend)
 		omap_device_disable_idle_on_suspend(pdev);
 
+	if (console_uart_id == bdata->id) {
+		omap_device_enable(pdev);
+		pm_runtime_set_active(&pdev->dev);
+	}
+
 	oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt);
 
 	oh->dev_attr = uart;
-- 
1.7.9.2


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

* [PATCH] ARM: OMAP2: UART: fix console UART mismatched runtime PM status
@ 2012-10-15 23:49 ` Kevin Hilman
  0 siblings, 0 replies; 14+ messages in thread
From: Kevin Hilman @ 2012-10-15 23:49 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kevin Hilman <khilman@ti.com>

The runtime PM framework assumes that the hardware state of devices
when initialized is disabled.  For all omap_devices, we idle/disable
device by default.  However, the console uart uses a "no idle" option
during omap_device init in order to allow earlyprintk usage to work
seamlessly during boot.

Because the hardware is left partially enabled after init (whatever
the bootloader settings were), the omap_device should later be fully
initialized (including mux) and the runtime PM framework should be
told that the device is active, and not disabled so that the hardware
state is in sync with runtime PM state.

To fix, after the device has been created/registered, call
omap_device_enable() to finialize init and use pm_runtime_set_active()
to tell the runtime PM core the device is enabled.

Tested on 2420/n810, 3530/Overo, 3530/Beagle, 3730/OveroSTORM,
3730/Beagle-xM, 4460/PandaES.

Reported-by: Paul Walmsley <paul@pwsan.com>
Suggested-by: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
---
Applies against v3.7-rc1.
Fix targetted for v3.7.

I'm still not entirely sure why this has worked up to now on OMAP3/4
but not on OMAP2.  Even so, this fix is needed for all platforms to
ensure matching hardware state and runtime PM state.

 arch/arm/mach-omap2/serial.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 0405c81..37b5dbe 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -327,6 +327,11 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,
 	if ((console_uart_id == bdata->id) && no_console_suspend)
 		omap_device_disable_idle_on_suspend(pdev);
 
+	if (console_uart_id == bdata->id) {
+		omap_device_enable(pdev);
+		pm_runtime_set_active(&pdev->dev);
+	}
+
 	oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt);
 
 	oh->dev_attr = uart;
-- 
1.7.9.2

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

* Re: [PATCH] ARM: OMAP2: UART: fix console UART mismatched runtime PM status
  2012-10-15 23:49 ` Kevin Hilman
@ 2012-10-16  0:01   ` Tony Lindgren
  -1 siblings, 0 replies; 14+ messages in thread
From: Tony Lindgren @ 2012-10-16  0:01 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: linux-omap, Russell King, Paul Walmsley, linux-arm-kernel,
	Felipe Balbi, Sourav Poddar

* Kevin Hilman <khilman@deeprootsystems.com> [121015 16:51]:
> From: Kevin Hilman <khilman@ti.com>
> 
> The runtime PM framework assumes that the hardware state of devices
> when initialized is disabled.  For all omap_devices, we idle/disable
> device by default.  However, the console uart uses a "no idle" option
> during omap_device init in order to allow earlyprintk usage to work
> seamlessly during boot.
> 
> Because the hardware is left partially enabled after init (whatever
> the bootloader settings were), the omap_device should later be fully
> initialized (including mux) and the runtime PM framework should be
> told that the device is active, and not disabled so that the hardware
> state is in sync with runtime PM state.
> 
> To fix, after the device has been created/registered, call
> omap_device_enable() to finialize init and use pm_runtime_set_active()
> to tell the runtime PM core the device is enabled.
> 
> Tested on 2420/n810, 3530/Overo, 3530/Beagle, 3730/OveroSTORM,
> 3730/Beagle-xM, 4460/PandaES.
> 
> Reported-by: Paul Walmsley <paul@pwsan.com>
> Suggested-by: Russell King <rmk+kernel@arm.linux.org.uk>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Sourav Poddar <sourav.poddar@ti.com>
> Signed-off-by: Kevin Hilman <khilman@ti.com>

Seems to work for my n800:

Tested-by: Tony Lindgren <tony@atomide.com>

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

* [PATCH] ARM: OMAP2: UART: fix console UART mismatched runtime PM status
@ 2012-10-16  0:01   ` Tony Lindgren
  0 siblings, 0 replies; 14+ messages in thread
From: Tony Lindgren @ 2012-10-16  0:01 UTC (permalink / raw)
  To: linux-arm-kernel

* Kevin Hilman <khilman@deeprootsystems.com> [121015 16:51]:
> From: Kevin Hilman <khilman@ti.com>
> 
> The runtime PM framework assumes that the hardware state of devices
> when initialized is disabled.  For all omap_devices, we idle/disable
> device by default.  However, the console uart uses a "no idle" option
> during omap_device init in order to allow earlyprintk usage to work
> seamlessly during boot.
> 
> Because the hardware is left partially enabled after init (whatever
> the bootloader settings were), the omap_device should later be fully
> initialized (including mux) and the runtime PM framework should be
> told that the device is active, and not disabled so that the hardware
> state is in sync with runtime PM state.
> 
> To fix, after the device has been created/registered, call
> omap_device_enable() to finialize init and use pm_runtime_set_active()
> to tell the runtime PM core the device is enabled.
> 
> Tested on 2420/n810, 3530/Overo, 3530/Beagle, 3730/OveroSTORM,
> 3730/Beagle-xM, 4460/PandaES.
> 
> Reported-by: Paul Walmsley <paul@pwsan.com>
> Suggested-by: Russell King <rmk+kernel@arm.linux.org.uk>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Sourav Poddar <sourav.poddar@ti.com>
> Signed-off-by: Kevin Hilman <khilman@ti.com>

Seems to work for my n800:

Tested-by: Tony Lindgren <tony@atomide.com>

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

* Re: [PATCH] ARM: OMAP2: UART: fix console UART mismatched runtime PM status
  2012-10-15 23:49 ` Kevin Hilman
@ 2012-10-16 10:25   ` Felipe Balbi
  -1 siblings, 0 replies; 14+ messages in thread
From: Felipe Balbi @ 2012-10-16 10:25 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Tony Lindgren, linux-omap, Russell King, Paul Walmsley,
	linux-arm-kernel, Felipe Balbi, Sourav Poddar

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

Hi,

On Mon, Oct 15, 2012 at 04:49:58PM -0700, Kevin Hilman wrote:
> From: Kevin Hilman <khilman@ti.com>
> 
> The runtime PM framework assumes that the hardware state of devices
> when initialized is disabled.  For all omap_devices, we idle/disable
> device by default.  However, the console uart uses a "no idle" option
> during omap_device init in order to allow earlyprintk usage to work
> seamlessly during boot.
> 
> Because the hardware is left partially enabled after init (whatever
> the bootloader settings were), the omap_device should later be fully
> initialized (including mux) and the runtime PM framework should be
> told that the device is active, and not disabled so that the hardware
> state is in sync with runtime PM state.
> 
> To fix, after the device has been created/registered, call
> omap_device_enable() to finialize init and use pm_runtime_set_active()
> to tell the runtime PM core the device is enabled.
> 
> Tested on 2420/n810, 3530/Overo, 3530/Beagle, 3730/OveroSTORM,
> 3730/Beagle-xM, 4460/PandaES.
> 
> Reported-by: Paul Walmsley <paul@pwsan.com>
> Suggested-by: Russell King <rmk+kernel@arm.linux.org.uk>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Sourav Poddar <sourav.poddar@ti.com>
> Signed-off-by: Kevin Hilman <khilman@ti.com>
> ---
> Applies against v3.7-rc1.
> Fix targetted for v3.7.
> 
> I'm still not entirely sure why this has worked up to now on OMAP3/4
> but not on OMAP2.  Even so, this fix is needed for all platforms to
> ensure matching hardware state and runtime PM state.
> 
>  arch/arm/mach-omap2/serial.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
> index 0405c81..37b5dbe 100644
> --- a/arch/arm/mach-omap2/serial.c
> +++ b/arch/arm/mach-omap2/serial.c
> @@ -327,6 +327,11 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,
>  	if ((console_uart_id == bdata->id) && no_console_suspend)
>  		omap_device_disable_idle_on_suspend(pdev);
>  
> +	if (console_uart_id == bdata->id) {
> +		omap_device_enable(pdev);
> +		pm_runtime_set_active(&pdev->dev);
> +	}
> +
>  	oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt);
>  
>  	oh->dev_attr = uart;

looks good to me. Even took care of doing that only for the console
UART.

Reviewed-by: Felipe Balbi <balbi@ti.com>

sorry for the issues caused.

-- 
balbi

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

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

* [PATCH] ARM: OMAP2: UART: fix console UART mismatched runtime PM status
@ 2012-10-16 10:25   ` Felipe Balbi
  0 siblings, 0 replies; 14+ messages in thread
From: Felipe Balbi @ 2012-10-16 10:25 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Mon, Oct 15, 2012 at 04:49:58PM -0700, Kevin Hilman wrote:
> From: Kevin Hilman <khilman@ti.com>
> 
> The runtime PM framework assumes that the hardware state of devices
> when initialized is disabled.  For all omap_devices, we idle/disable
> device by default.  However, the console uart uses a "no idle" option
> during omap_device init in order to allow earlyprintk usage to work
> seamlessly during boot.
> 
> Because the hardware is left partially enabled after init (whatever
> the bootloader settings were), the omap_device should later be fully
> initialized (including mux) and the runtime PM framework should be
> told that the device is active, and not disabled so that the hardware
> state is in sync with runtime PM state.
> 
> To fix, after the device has been created/registered, call
> omap_device_enable() to finialize init and use pm_runtime_set_active()
> to tell the runtime PM core the device is enabled.
> 
> Tested on 2420/n810, 3530/Overo, 3530/Beagle, 3730/OveroSTORM,
> 3730/Beagle-xM, 4460/PandaES.
> 
> Reported-by: Paul Walmsley <paul@pwsan.com>
> Suggested-by: Russell King <rmk+kernel@arm.linux.org.uk>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Sourav Poddar <sourav.poddar@ti.com>
> Signed-off-by: Kevin Hilman <khilman@ti.com>
> ---
> Applies against v3.7-rc1.
> Fix targetted for v3.7.
> 
> I'm still not entirely sure why this has worked up to now on OMAP3/4
> but not on OMAP2.  Even so, this fix is needed for all platforms to
> ensure matching hardware state and runtime PM state.
> 
>  arch/arm/mach-omap2/serial.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
> index 0405c81..37b5dbe 100644
> --- a/arch/arm/mach-omap2/serial.c
> +++ b/arch/arm/mach-omap2/serial.c
> @@ -327,6 +327,11 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,
>  	if ((console_uart_id == bdata->id) && no_console_suspend)
>  		omap_device_disable_idle_on_suspend(pdev);
>  
> +	if (console_uart_id == bdata->id) {
> +		omap_device_enable(pdev);
> +		pm_runtime_set_active(&pdev->dev);
> +	}
> +
>  	oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt);
>  
>  	oh->dev_attr = uart;

looks good to me. Even took care of doing that only for the console
UART.

Reviewed-by: Felipe Balbi <balbi@ti.com>

sorry for the issues caused.

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121016/7f249c3b/attachment.sig>

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

* Re: [PATCH] ARM: OMAP2: UART: fix console UART mismatched runtime PM status
  2012-10-16 10:25   ` Felipe Balbi
@ 2012-10-16 21:18     ` Tony Lindgren
  -1 siblings, 0 replies; 14+ messages in thread
From: Tony Lindgren @ 2012-10-16 21:18 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Kevin Hilman, linux-omap, Russell King, Paul Walmsley,
	linux-arm-kernel, Sourav Poddar

* Felipe Balbi <balbi@ti.com> [121016 03:32]:
> Hi,
> 
> On Mon, Oct 15, 2012 at 04:49:58PM -0700, Kevin Hilman wrote:
> > From: Kevin Hilman <khilman@ti.com>
> > 
> > The runtime PM framework assumes that the hardware state of devices
> > when initialized is disabled.  For all omap_devices, we idle/disable
> > device by default.  However, the console uart uses a "no idle" option
> > during omap_device init in order to allow earlyprintk usage to work
> > seamlessly during boot.
> > 
> > Because the hardware is left partially enabled after init (whatever
> > the bootloader settings were), the omap_device should later be fully
> > initialized (including mux) and the runtime PM framework should be
> > told that the device is active, and not disabled so that the hardware
> > state is in sync with runtime PM state.
> > 
> > To fix, after the device has been created/registered, call
> > omap_device_enable() to finialize init and use pm_runtime_set_active()
> > to tell the runtime PM core the device is enabled.
> > 
> > Tested on 2420/n810, 3530/Overo, 3530/Beagle, 3730/OveroSTORM,
> > 3730/Beagle-xM, 4460/PandaES.
> > 
> > Reported-by: Paul Walmsley <paul@pwsan.com>
> > Suggested-by: Russell King <rmk+kernel@arm.linux.org.uk>
> > Cc: Felipe Balbi <balbi@ti.com>
> > Cc: Sourav Poddar <sourav.poddar@ti.com>
> > Signed-off-by: Kevin Hilman <khilman@ti.com>
> > ---
> > Applies against v3.7-rc1.
> > Fix targetted for v3.7.
> > 
> > I'm still not entirely sure why this has worked up to now on OMAP3/4
> > but not on OMAP2.  Even so, this fix is needed for all platforms to
> > ensure matching hardware state and runtime PM state.
> > 
> >  arch/arm/mach-omap2/serial.c |    5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
> > index 0405c81..37b5dbe 100644
> > --- a/arch/arm/mach-omap2/serial.c
> > +++ b/arch/arm/mach-omap2/serial.c
> > @@ -327,6 +327,11 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,
> >  	if ((console_uart_id == bdata->id) && no_console_suspend)
> >  		omap_device_disable_idle_on_suspend(pdev);
> >  
> > +	if (console_uart_id == bdata->id) {
> > +		omap_device_enable(pdev);
> > +		pm_runtime_set_active(&pdev->dev);
> > +	}
> > +
> >  	oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt);
> >  
> >  	oh->dev_attr = uart;
> 
> looks good to me. Even took care of doing that only for the console
> UART.

Applying into omap-for-v3.7-rc1/fixes-take3.

Regards,

Tony

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

* [PATCH] ARM: OMAP2: UART: fix console UART mismatched runtime PM status
@ 2012-10-16 21:18     ` Tony Lindgren
  0 siblings, 0 replies; 14+ messages in thread
From: Tony Lindgren @ 2012-10-16 21:18 UTC (permalink / raw)
  To: linux-arm-kernel

* Felipe Balbi <balbi@ti.com> [121016 03:32]:
> Hi,
> 
> On Mon, Oct 15, 2012 at 04:49:58PM -0700, Kevin Hilman wrote:
> > From: Kevin Hilman <khilman@ti.com>
> > 
> > The runtime PM framework assumes that the hardware state of devices
> > when initialized is disabled.  For all omap_devices, we idle/disable
> > device by default.  However, the console uart uses a "no idle" option
> > during omap_device init in order to allow earlyprintk usage to work
> > seamlessly during boot.
> > 
> > Because the hardware is left partially enabled after init (whatever
> > the bootloader settings were), the omap_device should later be fully
> > initialized (including mux) and the runtime PM framework should be
> > told that the device is active, and not disabled so that the hardware
> > state is in sync with runtime PM state.
> > 
> > To fix, after the device has been created/registered, call
> > omap_device_enable() to finialize init and use pm_runtime_set_active()
> > to tell the runtime PM core the device is enabled.
> > 
> > Tested on 2420/n810, 3530/Overo, 3530/Beagle, 3730/OveroSTORM,
> > 3730/Beagle-xM, 4460/PandaES.
> > 
> > Reported-by: Paul Walmsley <paul@pwsan.com>
> > Suggested-by: Russell King <rmk+kernel@arm.linux.org.uk>
> > Cc: Felipe Balbi <balbi@ti.com>
> > Cc: Sourav Poddar <sourav.poddar@ti.com>
> > Signed-off-by: Kevin Hilman <khilman@ti.com>
> > ---
> > Applies against v3.7-rc1.
> > Fix targetted for v3.7.
> > 
> > I'm still not entirely sure why this has worked up to now on OMAP3/4
> > but not on OMAP2.  Even so, this fix is needed for all platforms to
> > ensure matching hardware state and runtime PM state.
> > 
> >  arch/arm/mach-omap2/serial.c |    5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
> > index 0405c81..37b5dbe 100644
> > --- a/arch/arm/mach-omap2/serial.c
> > +++ b/arch/arm/mach-omap2/serial.c
> > @@ -327,6 +327,11 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,
> >  	if ((console_uart_id == bdata->id) && no_console_suspend)
> >  		omap_device_disable_idle_on_suspend(pdev);
> >  
> > +	if (console_uart_id == bdata->id) {
> > +		omap_device_enable(pdev);
> > +		pm_runtime_set_active(&pdev->dev);
> > +	}
> > +
> >  	oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt);
> >  
> >  	oh->dev_attr = uart;
> 
> looks good to me. Even took care of doing that only for the console
> UART.

Applying into omap-for-v3.7-rc1/fixes-take3.

Regards,

Tony

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

* Re: [PATCH] ARM: OMAP2: UART: fix console UART mismatched runtime PM status
  2012-10-16 21:18     ` Tony Lindgren
@ 2012-10-17  1:03       ` Kevin Hilman
  -1 siblings, 0 replies; 14+ messages in thread
From: Kevin Hilman @ 2012-10-17  1:03 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Felipe Balbi, linux-omap, Russell King, Paul Walmsley,
	linux-arm-kernel, Sourav Poddar

Tony Lindgren <tony@atomide.com> writes:

> * Felipe Balbi <balbi@ti.com> [121016 03:32]:
>> Hi,
>> 
>> On Mon, Oct 15, 2012 at 04:49:58PM -0700, Kevin Hilman wrote:
>> > From: Kevin Hilman <khilman@ti.com>
>> > 
>> > The runtime PM framework assumes that the hardware state of devices
>> > when initialized is disabled.  For all omap_devices, we idle/disable
>> > device by default.  However, the console uart uses a "no idle" option
>> > during omap_device init in order to allow earlyprintk usage to work
>> > seamlessly during boot.
>> > 
>> > Because the hardware is left partially enabled after init (whatever
>> > the bootloader settings were), the omap_device should later be fully
>> > initialized (including mux) and the runtime PM framework should be
>> > told that the device is active, and not disabled so that the hardware
>> > state is in sync with runtime PM state.
>> > 
>> > To fix, after the device has been created/registered, call
>> > omap_device_enable() to finialize init and use pm_runtime_set_active()
>> > to tell the runtime PM core the device is enabled.
>> > 
>> > Tested on 2420/n810, 3530/Overo, 3530/Beagle, 3730/OveroSTORM,
>> > 3730/Beagle-xM, 4460/PandaES.
>> > 
>> > Reported-by: Paul Walmsley <paul@pwsan.com>
>> > Suggested-by: Russell King <rmk+kernel@arm.linux.org.uk>
>> > Cc: Felipe Balbi <balbi@ti.com>
>> > Cc: Sourav Poddar <sourav.poddar@ti.com>
>> > Signed-off-by: Kevin Hilman <khilman@ti.com>
>> > ---
>> > Applies against v3.7-rc1.
>> > Fix targetted for v3.7.
>> > 
>> > I'm still not entirely sure why this has worked up to now on OMAP3/4
>> > but not on OMAP2.  Even so, this fix is needed for all platforms to
>> > ensure matching hardware state and runtime PM state.
>> > 
>> >  arch/arm/mach-omap2/serial.c |    5 +++++
>> >  1 file changed, 5 insertions(+)
>> > 
>> > diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
>> > index 0405c81..37b5dbe 100644
>> > --- a/arch/arm/mach-omap2/serial.c
>> > +++ b/arch/arm/mach-omap2/serial.c
>> > @@ -327,6 +327,11 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,
>> >  	if ((console_uart_id == bdata->id) && no_console_suspend)
>> >  		omap_device_disable_idle_on_suspend(pdev);
>> >  
>> > +	if (console_uart_id == bdata->id) {
>> > +		omap_device_enable(pdev);
>> > +		pm_runtime_set_active(&pdev->dev);
>> > +	}
>> > +
>> >  	oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt);
>> >  
>> >  	oh->dev_attr = uart;
>> 
>> looks good to me. Even took care of doing that only for the console
>> UART.
>
> Applying into omap-for-v3.7-rc1/fixes-take3.
>

Doh, this isn't quite right yet.  Some more PM testing shows that UART
wakeups are broken, so this isn't ready for v3.7 yet.

To be continued...

Kevin


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

* [PATCH] ARM: OMAP2: UART: fix console UART mismatched runtime PM status
@ 2012-10-17  1:03       ` Kevin Hilman
  0 siblings, 0 replies; 14+ messages in thread
From: Kevin Hilman @ 2012-10-17  1:03 UTC (permalink / raw)
  To: linux-arm-kernel

Tony Lindgren <tony@atomide.com> writes:

> * Felipe Balbi <balbi@ti.com> [121016 03:32]:
>> Hi,
>> 
>> On Mon, Oct 15, 2012 at 04:49:58PM -0700, Kevin Hilman wrote:
>> > From: Kevin Hilman <khilman@ti.com>
>> > 
>> > The runtime PM framework assumes that the hardware state of devices
>> > when initialized is disabled.  For all omap_devices, we idle/disable
>> > device by default.  However, the console uart uses a "no idle" option
>> > during omap_device init in order to allow earlyprintk usage to work
>> > seamlessly during boot.
>> > 
>> > Because the hardware is left partially enabled after init (whatever
>> > the bootloader settings were), the omap_device should later be fully
>> > initialized (including mux) and the runtime PM framework should be
>> > told that the device is active, and not disabled so that the hardware
>> > state is in sync with runtime PM state.
>> > 
>> > To fix, after the device has been created/registered, call
>> > omap_device_enable() to finialize init and use pm_runtime_set_active()
>> > to tell the runtime PM core the device is enabled.
>> > 
>> > Tested on 2420/n810, 3530/Overo, 3530/Beagle, 3730/OveroSTORM,
>> > 3730/Beagle-xM, 4460/PandaES.
>> > 
>> > Reported-by: Paul Walmsley <paul@pwsan.com>
>> > Suggested-by: Russell King <rmk+kernel@arm.linux.org.uk>
>> > Cc: Felipe Balbi <balbi@ti.com>
>> > Cc: Sourav Poddar <sourav.poddar@ti.com>
>> > Signed-off-by: Kevin Hilman <khilman@ti.com>
>> > ---
>> > Applies against v3.7-rc1.
>> > Fix targetted for v3.7.
>> > 
>> > I'm still not entirely sure why this has worked up to now on OMAP3/4
>> > but not on OMAP2.  Even so, this fix is needed for all platforms to
>> > ensure matching hardware state and runtime PM state.
>> > 
>> >  arch/arm/mach-omap2/serial.c |    5 +++++
>> >  1 file changed, 5 insertions(+)
>> > 
>> > diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
>> > index 0405c81..37b5dbe 100644
>> > --- a/arch/arm/mach-omap2/serial.c
>> > +++ b/arch/arm/mach-omap2/serial.c
>> > @@ -327,6 +327,11 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,
>> >  	if ((console_uart_id == bdata->id) && no_console_suspend)
>> >  		omap_device_disable_idle_on_suspend(pdev);
>> >  
>> > +	if (console_uart_id == bdata->id) {
>> > +		omap_device_enable(pdev);
>> > +		pm_runtime_set_active(&pdev->dev);
>> > +	}
>> > +
>> >  	oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt);
>> >  
>> >  	oh->dev_attr = uart;
>> 
>> looks good to me. Even took care of doing that only for the console
>> UART.
>
> Applying into omap-for-v3.7-rc1/fixes-take3.
>

Doh, this isn't quite right yet.  Some more PM testing shows that UART
wakeups are broken, so this isn't ready for v3.7 yet.

To be continued...

Kevin

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

* Re: [PATCH] ARM: OMAP2: UART: fix console UART mismatched runtime PM status
  2012-10-17  1:03       ` Kevin Hilman
@ 2012-10-17  2:14         ` Tony Lindgren
  -1 siblings, 0 replies; 14+ messages in thread
From: Tony Lindgren @ 2012-10-17  2:14 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Felipe Balbi, linux-omap, Russell King, Paul Walmsley,
	linux-arm-kernel, Sourav Poddar

* Kevin Hilman <khilman@deeprootsystems.com> [121016 18:04]:
> 
> Doh, this isn't quite right yet.  Some more PM testing shows that UART
> wakeups are broken, so this isn't ready for v3.7 yet.

OK I'll drop it then.

Tony

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

* [PATCH] ARM: OMAP2: UART: fix console UART mismatched runtime PM status
@ 2012-10-17  2:14         ` Tony Lindgren
  0 siblings, 0 replies; 14+ messages in thread
From: Tony Lindgren @ 2012-10-17  2:14 UTC (permalink / raw)
  To: linux-arm-kernel

* Kevin Hilman <khilman@deeprootsystems.com> [121016 18:04]:
> 
> Doh, this isn't quite right yet.  Some more PM testing shows that UART
> wakeups are broken, so this isn't ready for v3.7 yet.

OK I'll drop it then.

Tony

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

* Re: [PATCH] ARM: OMAP2: UART: fix console UART mismatched runtime PM status
  2012-10-15 23:49 ` Kevin Hilman
@ 2012-10-17  8:28   ` Russell King - ARM Linux
  -1 siblings, 0 replies; 14+ messages in thread
From: Russell King - ARM Linux @ 2012-10-17  8:28 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Tony Lindgren, linux-omap, Paul Walmsley, linux-arm-kernel,
	Felipe Balbi, Sourav Poddar

On Mon, Oct 15, 2012 at 04:49:58PM -0700, Kevin Hilman wrote:
> From: Kevin Hilman <khilman@ti.com>
> 
> The runtime PM framework assumes that the hardware state of devices
> when initialized is disabled.  For all omap_devices, we idle/disable
> device by default.  However, the console uart uses a "no idle" option
> during omap_device init in order to allow earlyprintk usage to work
> seamlessly during boot.
> 
> Because the hardware is left partially enabled after init (whatever
> the bootloader settings were), the omap_device should later be fully
> initialized (including mux) and the runtime PM framework should be
> told that the device is active, and not disabled so that the hardware
> state is in sync with runtime PM state.
> 
> To fix, after the device has been created/registered, call
> omap_device_enable() to finialize init and use pm_runtime_set_active()
> to tell the runtime PM core the device is enabled.

I still believe you're better off with the approach I gave.  Why?
Because every driver you have contains virtually the same sequence of
runtime PM "initialization" which is to runtime PM enable the device
and then do a get on it.

Why not do that in bus code if all your drivers are doing the same
thing, and kill off a bunch of code in the drivers?

It's fairly easy to do with the BUS_NOTIFY_BIND_DRIVER / BUS_NOTIFY_UNBIND_DRIVER
bus level notifies, and you've already hooked the notifier list for
these callbacks in omap_device.c

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

* [PATCH] ARM: OMAP2: UART: fix console UART mismatched runtime PM status
@ 2012-10-17  8:28   ` Russell King - ARM Linux
  0 siblings, 0 replies; 14+ messages in thread
From: Russell King - ARM Linux @ 2012-10-17  8:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 15, 2012 at 04:49:58PM -0700, Kevin Hilman wrote:
> From: Kevin Hilman <khilman@ti.com>
> 
> The runtime PM framework assumes that the hardware state of devices
> when initialized is disabled.  For all omap_devices, we idle/disable
> device by default.  However, the console uart uses a "no idle" option
> during omap_device init in order to allow earlyprintk usage to work
> seamlessly during boot.
> 
> Because the hardware is left partially enabled after init (whatever
> the bootloader settings were), the omap_device should later be fully
> initialized (including mux) and the runtime PM framework should be
> told that the device is active, and not disabled so that the hardware
> state is in sync with runtime PM state.
> 
> To fix, after the device has been created/registered, call
> omap_device_enable() to finialize init and use pm_runtime_set_active()
> to tell the runtime PM core the device is enabled.

I still believe you're better off with the approach I gave.  Why?
Because every driver you have contains virtually the same sequence of
runtime PM "initialization" which is to runtime PM enable the device
and then do a get on it.

Why not do that in bus code if all your drivers are doing the same
thing, and kill off a bunch of code in the drivers?

It's fairly easy to do with the BUS_NOTIFY_BIND_DRIVER / BUS_NOTIFY_UNBIND_DRIVER
bus level notifies, and you've already hooked the notifier list for
these callbacks in omap_device.c

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

end of thread, other threads:[~2012-10-17  8:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-15 23:49 [PATCH] ARM: OMAP2: UART: fix console UART mismatched runtime PM status Kevin Hilman
2012-10-15 23:49 ` Kevin Hilman
2012-10-16  0:01 ` Tony Lindgren
2012-10-16  0:01   ` Tony Lindgren
2012-10-16 10:25 ` Felipe Balbi
2012-10-16 10:25   ` Felipe Balbi
2012-10-16 21:18   ` Tony Lindgren
2012-10-16 21:18     ` Tony Lindgren
2012-10-17  1:03     ` Kevin Hilman
2012-10-17  1:03       ` Kevin Hilman
2012-10-17  2:14       ` Tony Lindgren
2012-10-17  2:14         ` Tony Lindgren
2012-10-17  8:28 ` Russell King - ARM Linux
2012-10-17  8:28   ` Russell King - ARM Linux

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.