linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] OMAP2+: PM: fix watchdog boot when runtime PM is disabled
@ 2011-07-11 23:21 Kevin Hilman
  2011-07-11 23:38 ` Hilman, Kevin
  2011-07-11 23:46 ` Santosh Shilimkar
  0 siblings, 2 replies; 5+ messages in thread
From: Kevin Hilman @ 2011-07-11 23:21 UTC (permalink / raw)
  To: linux-arm-kernel

Fix boot crash in watchdog driver when runtime PM is disabled.

When runtime PM is disabled, devices should be left enabled so that
all device accesses in drivers will succeed even though the runtime PM
get/put calls are noops.

This is already the case for all devices, but the WDT init has its
own hwmod postsetup which was not taking this into account.

This fixes a boot crash where the first device access in the WDT probe
function would crash a booting kernel.

Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
---
Tony, as this is a boot crash, it should probably be queued for v3.0.
However, since OMAP2PLUS_TYPICAL always enables runtime PM, this is
unlikely to be seen unless specifically testing with runtime PM disabled.

 arch/arm/mach-omap2/io.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 441e79d..95c08aa 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -395,7 +395,11 @@ void __init omap2_init_common_infrastructure(void)
 	 * XXX ideally we could detect whether the MPU WDT was currently
 	 * enabled here and make this conditional
 	 */
+#ifdef CONFIG_PM_RUNTIME
 	postsetup_state = _HWMOD_STATE_DISABLED;
+#else
+	postsetup_state = _HWMOD_STATE_ENABLED;
+#endif
 	omap_hwmod_for_each_by_class("wd_timer",
 				     _set_hwmod_postsetup_state,
 				     &postsetup_state);
-- 
1.7.6

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

* [PATCH] OMAP2+: PM: fix watchdog boot when runtime PM is disabled
  2011-07-11 23:21 [PATCH] OMAP2+: PM: fix watchdog boot when runtime PM is disabled Kevin Hilman
@ 2011-07-11 23:38 ` Hilman, Kevin
  2011-07-11 23:46 ` Santosh Shilimkar
  1 sibling, 0 replies; 5+ messages in thread
From: Hilman, Kevin @ 2011-07-11 23:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 11, 2011 at 4:21 PM, Kevin Hilman <khilman@ti.com> wrote:
> Fix boot crash in watchdog driver when runtime PM is disabled.
>
> When runtime PM is disabled, devices should be left enabled so that
> all device accesses in drivers will succeed even though the runtime PM
> get/put calls are noops.
>
> This is already the case for all devices, but the WDT init has its
> own hwmod postsetup which was not taking this into account.
>
> This fixes a boot crash where the first device access in the WDT probe
> function would crash a booting kernel.
>
> Cc: Paul Walmsley <paul@pwsan.com>
> Signed-off-by: Kevin Hilman <khilman@ti.com>
> ---
> Tony, as this is a boot crash, it should probably be queued for v3.0.
> However, since OMAP2PLUS_TYPICAL always enables runtime PM, this is
> unlikely to be seen unless specifically testing with runtime PM disabled.

I forgot to mention that I added this fix to my for_3.0/pm-fixes-3 branch.

Kevin

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

* [PATCH] OMAP2+: PM: fix watchdog boot when runtime PM is disabled
  2011-07-11 23:21 [PATCH] OMAP2+: PM: fix watchdog boot when runtime PM is disabled Kevin Hilman
  2011-07-11 23:38 ` Hilman, Kevin
@ 2011-07-11 23:46 ` Santosh Shilimkar
  2011-07-12 14:55   ` Kevin Hilman
  1 sibling, 1 reply; 5+ messages in thread
From: Santosh Shilimkar @ 2011-07-11 23:46 UTC (permalink / raw)
  To: linux-arm-kernel

On 7/11/2011 4:21 PM, Kevin Hilman wrote:
> Fix boot crash in watchdog driver when runtime PM is disabled.
>
> When runtime PM is disabled, devices should be left enabled so that
> all device accesses in drivers will succeed even though the runtime PM
> get/put calls are noops.
>
> This is already the case for all devices, but the WDT init has its
> own hwmod postsetup which was not taking this into account.
>
> This fixes a boot crash where the first device access in the WDT probe
> function would crash a booting kernel.
>
> Cc: Paul Walmsley<paul@pwsan.com>
> Signed-off-by: Kevin Hilman<khilman@ti.com>
> ---
> Tony, as this is a boot crash, it should probably be queued for v3.0.
> However, since OMAP2PLUS_TYPICAL always enables runtime PM, this is
> unlikely to be seen unless specifically testing with runtime PM disabled.
>
This patch is exactly same as the one I submitted on Jan 5, 2011 for
the same issue. Here is the patchwork link for the same.

https://patchwork.kernel.org/patch/453481/

Paul had a valid concern about the boot-loader leaving the watchdog
enabled. More on this in below thread.

http://www.spinics.net/lists/arm-kernel/msg110937.html


>   arch/arm/mach-omap2/io.c |    4 ++++
>   1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
> index 441e79d..95c08aa 100644
> --- a/arch/arm/mach-omap2/io.c
> +++ b/arch/arm/mach-omap2/io.c
> @@ -395,7 +395,11 @@ void __init omap2_init_common_infrastructure(void)
>   	 * XXX ideally we could detect whether the MPU WDT was currently
>   	 * enabled here and make this conditional
>   	 */
> +#ifdef CONFIG_PM_RUNTIME
>   	postsetup_state = _HWMOD_STATE_DISABLED;
> +#else
> +	postsetup_state = _HWMOD_STATE_ENABLED;
> +#endif
>   	omap_hwmod_for_each_by_class("wd_timer",
>   				     _set_hwmod_postsetup_state,
>   				&postsetup_state);

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

* [PATCH] OMAP2+: PM: fix watchdog boot when runtime PM is disabled
  2011-07-11 23:46 ` Santosh Shilimkar
@ 2011-07-12 14:55   ` Kevin Hilman
  2011-07-13  7:54     ` Paul Walmsley
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Hilman @ 2011-07-12 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

Santosh Shilimkar <santosh.shilimkar@ti.com> writes:

> On 7/11/2011 4:21 PM, Kevin Hilman wrote:
>> Fix boot crash in watchdog driver when runtime PM is disabled.
>>
>> When runtime PM is disabled, devices should be left enabled so that
>> all device accesses in drivers will succeed even though the runtime PM
>> get/put calls are noops.
>>
>> This is already the case for all devices, but the WDT init has its
>> own hwmod postsetup which was not taking this into account.
>>
>> This fixes a boot crash where the first device access in the WDT probe
>> function would crash a booting kernel.
>>
>> Cc: Paul Walmsley<paul@pwsan.com>
>> Signed-off-by: Kevin Hilman<khilman@ti.com>
>> ---
>> Tony, as this is a boot crash, it should probably be queued for v3.0.
>> However, since OMAP2PLUS_TYPICAL always enables runtime PM, this is
>> unlikely to be seen unless specifically testing with runtime PM disabled.
>>
> This patch is exactly same as the one I submitted on Jan 5, 2011 for
> the same issue. Here is the patchwork link for the same.
>
> https://patchwork.kernel.org/patch/453481/
>
> Paul had a valid concern about the boot-loader leaving the watchdog
> enabled. More on this in below thread.
>
> http://www.spinics.net/lists/arm-kernel/msg110937.html
>

Paul's concern is valid, and could be addressed by making that init code
actually check if the WDT is currently active (as suggested by the
comment there.)

In the mean time, this simple fix should be applied to prevent a boot
crash, IMO.

Kevin

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

* [PATCH] OMAP2+: PM: fix watchdog boot when runtime PM is disabled
  2011-07-12 14:55   ` Kevin Hilman
@ 2011-07-13  7:54     ` Paul Walmsley
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Walmsley @ 2011-07-13  7:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 12 Jul 2011, Kevin Hilman wrote:

> Paul's concern is valid, and could be addressed by making that init code
> actually check if the WDT is currently active (as suggested by the
> comment there.)
> 
> In the mean time, this simple fix should be applied to prevent a boot
> crash, IMO.

Thing is, applying this fix will cause crashes if the bootloader enables 
the watchdog, but the kernel does not.  It just trades one source of 
crashes for another.

The root cause of this problem is that the drivers are incorrectly relying 
on runtime PM to "enable" devices.  My personal opinion is that we should 
be doing what SSB, PCI, etc. do, and have a omap_device_enable() that is 
called by the driver.  Basically, we need a real omap_bus/omap_device.

Meanwhile, switching to lazy device reset as Tony suggested should mask 
the issue.  The patches for this are 95% done; the intention is to post 
them for early 3.2.  Or if people are really gung-ho, 3.1 rc.


- Paul

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

end of thread, other threads:[~2011-07-13  7:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-11 23:21 [PATCH] OMAP2+: PM: fix watchdog boot when runtime PM is disabled Kevin Hilman
2011-07-11 23:38 ` Hilman, Kevin
2011-07-11 23:46 ` Santosh Shilimkar
2011-07-12 14:55   ` Kevin Hilman
2011-07-13  7:54     ` Paul Walmsley

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