linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2] arm: mach-omap2: prevent UART console idle on suspend while using "no_console_suspend"
@ 2013-04-02 13:28 Sourav Poddar
  2013-04-02 13:34 ` Michael Trimarchi
  0 siblings, 1 reply; 3+ messages in thread
From: Sourav Poddar @ 2013-04-02 13:28 UTC (permalink / raw)
  To: tony, khilman, rmk+kernel, gregkh
  Cc: linux-serial, linux-kernel, linux-omap, b-cousson, michael,
	Sourav Poddar, Santosh Shilimkar, Felipe Balbi, Rajendra nayak

With dt boot, uart wakeup after suspend is non functional while using
"no_console_suspend" in the bootargs. With "no_console_suspend" used, od->flags
should be ORed with "OMAP_DEVICE_NO_IDLE_ON_SUSPEND", thereby not allowing the console
to idle in the suspend path.

Tested on omap5430evm, omap4430sdp.

Cc: Santosh Shilimkar<santosh.shilimkar@ti.com>
Cc: Felipe Balbi<balbi@ti.com>
Cc: Rajendra nayak<rnayak@ti.com>
Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
---
v1->v2
These patches were sent before as a series[1], but realised
"core_initcall(omap_serial_early_init)" in serial.c get executed
irrespective of dt or non dt boot and it will do most of the stuff
for us.
As suggested by Kevin Hilman in the previous version, this patch will
also prevent creating dependency between omap_device
(generic device-independent code) and a specific driver (UART).

[1]: http://lkml.org/lkml/2013/3/18/294

 arch/arm/mach-omap2/omap_device.c |    5 +++--
 arch/arm/mach-omap2/omap_hwmod.h  |    5 +++++
 arch/arm/mach-omap2/serial.c      |    4 +++-
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index 381be7a..89be64d 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -170,8 +170,9 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
 			r->name = dev_name(&pdev->dev);
 	}
 
-	if (of_get_property(node, "ti,no_idle_on_suspend", NULL))
-		omap_device_disable_idle_on_suspend(pdev);
+	if (oh->flags & HWMOD_DISABLE_IDLE_ON_SUSPEND ||
+		of_get_property(node, "ti,no_idle_on_suspend", NULL))
+			omap_device_disable_idle_on_suspend(pdev);
 
 	pdev->dev.pm_domain = &omap_device_pm_domain;
 
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index d43d9b6..50e6145 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -459,6 +459,10 @@ struct omap_hwmod_omap4_prcm {
  *     correctly, or this is being abused to deal with some PM latency
  *     issues -- but we're currently suffering from a shortage of
  *     folks who are able to track these issues down properly.
+ * HWMOD_DISABLE_IDLE_ON_SUSPEND: don't idle this module on suspend. This is
+ *     needed for uart controller, which requires its clock not to be cut
+ *     during suspend while using "no_console_suspend" in bootargs with
+ *     device tree boot.
  */
 #define HWMOD_SWSUP_SIDLE			(1 << 0)
 #define HWMOD_SWSUP_MSTANDBY			(1 << 1)
@@ -471,6 +475,7 @@ struct omap_hwmod_omap4_prcm {
 #define HWMOD_16BIT_REG				(1 << 8)
 #define HWMOD_EXT_OPT_MAIN_CLK			(1 << 9)
 #define HWMOD_BLOCK_WFI				(1 << 10)
+#define HWMOD_DISABLE_IDLE_ON_SUSPEND		(1 << 12)
 
 /*
  * omap_hwmod._int_flags definitions
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 8396b5b..adbafbd 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -236,8 +236,10 @@ static int __init omap_serial_early_init(void)
 					uart_name, uart->num);
 			}
 
-			if (cmdline_find_option("no_console_suspend"))
+			if (cmdline_find_option("no_console_suspend")) {
 				no_console_suspend = true;
+				oh->flags |= HWMOD_DISABLE_IDLE_ON_SUSPEND;
+			}
 
 			/*
 			 * omap-uart can be used for earlyprintk logs
-- 
1.7.1


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

* Re: [PATCHv2] arm: mach-omap2: prevent UART console idle on suspend while using "no_console_suspend"
  2013-04-02 13:28 [PATCHv2] arm: mach-omap2: prevent UART console idle on suspend while using "no_console_suspend" Sourav Poddar
@ 2013-04-02 13:34 ` Michael Trimarchi
  2013-04-02 13:43   ` Sourav Poddar
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Trimarchi @ 2013-04-02 13:34 UTC (permalink / raw)
  To: Sourav Poddar
  Cc: tony, khilman, rmk+kernel, gregkh, linux-serial, linux-kernel,
	linux-omap, b-cousson, Santosh Shilimkar, Felipe Balbi,
	Rajendra nayak

Hi

On 02/04/13 15:28, Sourav Poddar wrote:
> With dt boot, uart wakeup after suspend is non functional while using
> "no_console_suspend" in the bootargs. With "no_console_suspend" used, od->flags
> should be ORed with "OMAP_DEVICE_NO_IDLE_ON_SUSPEND", thereby not allowing the console
> to idle in the suspend path.
> 
> Tested on omap5430evm, omap4430sdp.
> 
> Cc: Santosh Shilimkar<santosh.shilimkar@ti.com>
> Cc: Felipe Balbi<balbi@ti.com>
> Cc: Rajendra nayak<rnayak@ti.com>
> Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
> ---
> v1->v2
> These patches were sent before as a series[1], but realised
> "core_initcall(omap_serial_early_init)" in serial.c get executed
> irrespective of dt or non dt boot and it will do most of the stuff
> for us.
> As suggested by Kevin Hilman in the previous version, this patch will
> also prevent creating dependency between omap_device
> (generic device-independent code) and a specific driver (UART).
> 
> [1]: http://lkml.org/lkml/2013/3/18/294
> 
>  arch/arm/mach-omap2/omap_device.c |    5 +++--
>  arch/arm/mach-omap2/omap_hwmod.h  |    5 +++++
>  arch/arm/mach-omap2/serial.c      |    4 +++-
>  3 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
> index 381be7a..89be64d 100644
> --- a/arch/arm/mach-omap2/omap_device.c
> +++ b/arch/arm/mach-omap2/omap_device.c
> @@ -170,8 +170,9 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
>  			r->name = dev_name(&pdev->dev);
>  	}
>  
> -	if (of_get_property(node, "ti,no_idle_on_suspend", NULL))
> -		omap_device_disable_idle_on_suspend(pdev);
> +	if (oh->flags & HWMOD_DISABLE_IDLE_ON_SUSPEND ||
> +		of_get_property(node, "ti,no_idle_on_suspend", NULL))
> +			omap_device_disable_idle_on_suspend(pdev);
>  
>  	pdev->dev.pm_domain = &omap_device_pm_domain;
>  
> diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
> index d43d9b6..50e6145 100644
> --- a/arch/arm/mach-omap2/omap_hwmod.h
> +++ b/arch/arm/mach-omap2/omap_hwmod.h
> @@ -459,6 +459,10 @@ struct omap_hwmod_omap4_prcm {
>   *     correctly, or this is being abused to deal with some PM latency
>   *     issues -- but we're currently suffering from a shortage of
>   *     folks who are able to track these issues down properly.
> + * HWMOD_DISABLE_IDLE_ON_SUSPEND: don't idle this module on suspend. This is
> + *     needed for uart controller, which requires its clock not to be cut
> + *     during suspend while using "no_console_suspend" in bootargs with
> + *     device tree boot.
>   */
>  #define HWMOD_SWSUP_SIDLE			(1 << 0)
>  #define HWMOD_SWSUP_MSTANDBY			(1 << 1)
> @@ -471,6 +475,7 @@ struct omap_hwmod_omap4_prcm {
>  #define HWMOD_16BIT_REG				(1 << 8)
>  #define HWMOD_EXT_OPT_MAIN_CLK			(1 << 9)
>  #define HWMOD_BLOCK_WFI				(1 << 10)
> +#define HWMOD_DISABLE_IDLE_ON_SUSPEND		(1 << 12)

Just a comment more. Why 12 and not 11?

Michael

>  
>  /*
>   * omap_hwmod._int_flags definitions
> diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
> index 8396b5b..adbafbd 100644
> --- a/arch/arm/mach-omap2/serial.c
> +++ b/arch/arm/mach-omap2/serial.c
> @@ -236,8 +236,10 @@ static int __init omap_serial_early_init(void)
>  					uart_name, uart->num);
>  			}
>  
> -			if (cmdline_find_option("no_console_suspend"))
> +			if (cmdline_find_option("no_console_suspend")) {
>  				no_console_suspend = true;
> +				oh->flags |= HWMOD_DISABLE_IDLE_ON_SUSPEND;
> +			}
>  
>  			/*
>  			 * omap-uart can be used for earlyprintk logs
> 


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

* Re: [PATCHv2] arm: mach-omap2: prevent UART console idle on suspend while using "no_console_suspend"
  2013-04-02 13:34 ` Michael Trimarchi
@ 2013-04-02 13:43   ` Sourav Poddar
  0 siblings, 0 replies; 3+ messages in thread
From: Sourav Poddar @ 2013-04-02 13:43 UTC (permalink / raw)
  To: Michael Trimarchi
  Cc: tony, khilman, rmk+kernel, gregkh, linux-serial, linux-kernel,
	linux-omap, b-cousson, Santosh Shilimkar, Felipe Balbi,
	Rajendra nayak

Hi,
On Tuesday 02 April 2013 07:04 PM, Michael Trimarchi wrote:
> Hi
>
> On 02/04/13 15:28, Sourav Poddar wrote:
>> With dt boot, uart wakeup after suspend is non functional while using
>> "no_console_suspend" in the bootargs. With "no_console_suspend" used, od->flags
>> should be ORed with "OMAP_DEVICE_NO_IDLE_ON_SUSPEND", thereby not allowing the console
>> to idle in the suspend path.
>>
>> Tested on omap5430evm, omap4430sdp.
>>
>> Cc: Santosh Shilimkar<santosh.shilimkar@ti.com>
>> Cc: Felipe Balbi<balbi@ti.com>
>> Cc: Rajendra nayak<rnayak@ti.com>
>> Signed-off-by: Sourav Poddar<sourav.poddar@ti.com>
>> ---
>> v1->v2
>> These patches were sent before as a series[1], but realised
>> "core_initcall(omap_serial_early_init)" in serial.c get executed
>> irrespective of dt or non dt boot and it will do most of the stuff
>> for us.
>> As suggested by Kevin Hilman in the previous version, this patch will
>> also prevent creating dependency between omap_device
>> (generic device-independent code) and a specific driver (UART).
>>
>> [1]: http://lkml.org/lkml/2013/3/18/294
>>
>>   arch/arm/mach-omap2/omap_device.c |    5 +++--
>>   arch/arm/mach-omap2/omap_hwmod.h  |    5 +++++
>>   arch/arm/mach-omap2/serial.c      |    4 +++-
>>   3 files changed, 11 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
>> index 381be7a..89be64d 100644
>> --- a/arch/arm/mach-omap2/omap_device.c
>> +++ b/arch/arm/mach-omap2/omap_device.c
>> @@ -170,8 +170,9 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
>>   			r->name = dev_name(&pdev->dev);
>>   	}
>>
>> -	if (of_get_property(node, "ti,no_idle_on_suspend", NULL))
>> -		omap_device_disable_idle_on_suspend(pdev);
>> +	if (oh->flags&  HWMOD_DISABLE_IDLE_ON_SUSPEND ||
>> +		of_get_property(node, "ti,no_idle_on_suspend", NULL))
>> +			omap_device_disable_idle_on_suspend(pdev);
>>
>>   	pdev->dev.pm_domain =&omap_device_pm_domain;
>>
>> diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
>> index d43d9b6..50e6145 100644
>> --- a/arch/arm/mach-omap2/omap_hwmod.h
>> +++ b/arch/arm/mach-omap2/omap_hwmod.h
>> @@ -459,6 +459,10 @@ struct omap_hwmod_omap4_prcm {
>>    *     correctly, or this is being abused to deal with some PM latency
>>    *     issues -- but we're currently suffering from a shortage of
>>    *     folks who are able to track these issues down properly.
>> + * HWMOD_DISABLE_IDLE_ON_SUSPEND: don't idle this module on suspend. This is
>> + *     needed for uart controller, which requires its clock not to be cut
>> + *     during suspend while using "no_console_suspend" in bootargs with
>> + *     device tree boot.
>>    */
>>   #define HWMOD_SWSUP_SIDLE			(1<<  0)
>>   #define HWMOD_SWSUP_MSTANDBY			(1<<  1)
>> @@ -471,6 +475,7 @@ struct omap_hwmod_omap4_prcm {
>>   #define HWMOD_16BIT_REG				(1<<  8)
>>   #define HWMOD_EXT_OPT_MAIN_CLK			(1<<  9)
>>   #define HWMOD_BLOCK_WFI				(1<<  10)
>> +#define HWMOD_DISABLE_IDLE_ON_SUSPEND		(1<<  12)
> Just a comment more. Why 12 and not 11?
>
My Bad. For testing, developed it on an internal tree where 11 was also 
occupied. While
rebasing it on 3.9-rc5, didn't realise 11 is free.
Will fix it in the next version.

Thanks,
Sourav
> Michael
>
>>
>>   /*
>>    * omap_hwmod._int_flags definitions
>> diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
>> index 8396b5b..adbafbd 100644
>> --- a/arch/arm/mach-omap2/serial.c
>> +++ b/arch/arm/mach-omap2/serial.c
>> @@ -236,8 +236,10 @@ static int __init omap_serial_early_init(void)
>>   					uart_name, uart->num);
>>   			}
>>
>> -			if (cmdline_find_option("no_console_suspend"))
>> +			if (cmdline_find_option("no_console_suspend")) {
>>   				no_console_suspend = true;
>> +				oh->flags |= HWMOD_DISABLE_IDLE_ON_SUSPEND;
>> +			}
>>
>>   			/*
>>   			 * omap-uart can be used for earlyprintk logs
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-serial" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

end of thread, other threads:[~2013-04-02 13:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-02 13:28 [PATCHv2] arm: mach-omap2: prevent UART console idle on suspend while using "no_console_suspend" Sourav Poddar
2013-04-02 13:34 ` Michael Trimarchi
2013-04-02 13:43   ` Sourav Poddar

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).