All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] watchdog: omap: don't disable runtime pm before starting device
@ 2015-12-15 10:37 Uwe Kleine-König
  2015-12-15 10:37 ` [PATCH 2/2] watchdog: omap: don't disable the timer when it should be enabled early Uwe Kleine-König
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2015-12-15 10:37 UTC (permalink / raw)
  To: Wim Van Sebroeck; +Cc: kernel, linux-watchdog, Lars Poeschel, Guenter Roeck

omap_wdt_start calls pm_runtime_get_sync so dropping a reference just
before calling omap_wdt_start doesn't make much sense. Moreover there is
no point to use the synchronous variant of pm_runtime_put because the
driver doesn't care if the clock is disabled before or after
omap_wdt_probe returns.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/watchdog/omap_wdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
index 7abd6988d94a..af8947429c91 100644
--- a/drivers/watchdog/omap_wdt.c
+++ b/drivers/watchdog/omap_wdt.c
@@ -282,11 +282,11 @@ static int omap_wdt_probe(struct platform_device *pdev)
 		readl_relaxed(wdev->base + OMAP_WATCHDOG_REV) & 0xFF,
 		wdev->wdog.timeout);
 
-	pm_runtime_put_sync(wdev->dev);
-
 	if (early_enable)
 		omap_wdt_start(&wdev->wdog);
 
+	pm_runtime_put(wdev->dev);
+
 	return 0;
 }
 
-- 
2.6.2

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

* [PATCH 2/2] watchdog: omap: don't disable the timer when it should be enabled early
  2015-12-15 10:37 [PATCH 1/2] watchdog: omap: don't disable runtime pm before starting device Uwe Kleine-König
@ 2015-12-15 10:37 ` Uwe Kleine-König
  2015-12-15 16:20   ` Guenter Roeck
  2015-12-27 20:16   ` Wim Van Sebroeck
  2015-12-15 16:20 ` [PATCH 1/2] watchdog: omap: don't disable runtime pm before starting device Guenter Roeck
  2015-12-27 20:16 ` Wim Van Sebroeck
  2 siblings, 2 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2015-12-15 10:37 UTC (permalink / raw)
  To: Wim Van Sebroeck; +Cc: kernel, linux-watchdog, Lars Poeschel, Guenter Roeck

With the early_enable module parameter the watchdog can be started
during driver probe time. If this is requested the bets are good that
the timer is already running, so to narrow the gap where the timer is
disabled only call the disable function when the timer shouldn't be
started.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/watchdog/omap_wdt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
index af8947429c91..ae673cd06aa1 100644
--- a/drivers/watchdog/omap_wdt.c
+++ b/drivers/watchdog/omap_wdt.c
@@ -270,7 +270,8 @@ static int omap_wdt_probe(struct platform_device *pdev)
 			wdev->wdog.bootstatus = WDIOF_CARDRESET;
 	}
 
-	omap_wdt_disable(wdev);
+	if (!early_enable)
+		omap_wdt_disable(wdev);
 
 	ret = watchdog_register_device(&wdev->wdog);
 	if (ret) {
-- 
2.6.2


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

* Re: [PATCH 1/2] watchdog: omap: don't disable runtime pm before starting device
  2015-12-15 10:37 [PATCH 1/2] watchdog: omap: don't disable runtime pm before starting device Uwe Kleine-König
  2015-12-15 10:37 ` [PATCH 2/2] watchdog: omap: don't disable the timer when it should be enabled early Uwe Kleine-König
@ 2015-12-15 16:20 ` Guenter Roeck
  2015-12-27 20:16 ` Wim Van Sebroeck
  2 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2015-12-15 16:20 UTC (permalink / raw)
  To: Uwe Kleine-König, Wim Van Sebroeck
  Cc: kernel, linux-watchdog, Lars Poeschel

On 12/15/2015 02:37 AM, Uwe Kleine-König wrote:
> omap_wdt_start calls pm_runtime_get_sync so dropping a reference just
> before calling omap_wdt_start doesn't make much sense. Moreover there is
> no point to use the synchronous variant of pm_runtime_put because the
> driver doesn't care if the clock is disabled before or after
> omap_wdt_probe returns.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/watchdog/omap_wdt.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
> index 7abd6988d94a..af8947429c91 100644
> --- a/drivers/watchdog/omap_wdt.c
> +++ b/drivers/watchdog/omap_wdt.c
> @@ -282,11 +282,11 @@ static int omap_wdt_probe(struct platform_device *pdev)
>   		readl_relaxed(wdev->base + OMAP_WATCHDOG_REV) & 0xFF,
>   		wdev->wdog.timeout);
>
> -	pm_runtime_put_sync(wdev->dev);
> -
>   	if (early_enable)
>   		omap_wdt_start(&wdev->wdog);
>
> +	pm_runtime_put(wdev->dev);
> +
>   	return 0;
>   }
>
>


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

* Re: [PATCH 2/2] watchdog: omap: don't disable the timer when it should be enabled early
  2015-12-15 10:37 ` [PATCH 2/2] watchdog: omap: don't disable the timer when it should be enabled early Uwe Kleine-König
@ 2015-12-15 16:20   ` Guenter Roeck
  2015-12-27 20:16   ` Wim Van Sebroeck
  1 sibling, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2015-12-15 16:20 UTC (permalink / raw)
  To: Uwe Kleine-König, Wim Van Sebroeck
  Cc: kernel, linux-watchdog, Lars Poeschel

On 12/15/2015 02:37 AM, Uwe Kleine-König wrote:
> With the early_enable module parameter the watchdog can be started
> during driver probe time. If this is requested the bets are good that
> the timer is already running, so to narrow the gap where the timer is
> disabled only call the disable function when the timer shouldn't be
> started.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/watchdog/omap_wdt.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
> index af8947429c91..ae673cd06aa1 100644
> --- a/drivers/watchdog/omap_wdt.c
> +++ b/drivers/watchdog/omap_wdt.c
> @@ -270,7 +270,8 @@ static int omap_wdt_probe(struct platform_device *pdev)
>   			wdev->wdog.bootstatus = WDIOF_CARDRESET;
>   	}
>
> -	omap_wdt_disable(wdev);
> +	if (!early_enable)
> +		omap_wdt_disable(wdev);
>
>   	ret = watchdog_register_device(&wdev->wdog);
>   	if (ret) {
>


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

* Re: [PATCH 1/2] watchdog: omap: don't disable runtime pm before starting device
  2015-12-15 10:37 [PATCH 1/2] watchdog: omap: don't disable runtime pm before starting device Uwe Kleine-König
  2015-12-15 10:37 ` [PATCH 2/2] watchdog: omap: don't disable the timer when it should be enabled early Uwe Kleine-König
  2015-12-15 16:20 ` [PATCH 1/2] watchdog: omap: don't disable runtime pm before starting device Guenter Roeck
@ 2015-12-27 20:16 ` Wim Van Sebroeck
  2 siblings, 0 replies; 6+ messages in thread
From: Wim Van Sebroeck @ 2015-12-27 20:16 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: kernel, linux-watchdog, Lars Poeschel, Guenter Roeck

Hi Uwe,

> omap_wdt_start calls pm_runtime_get_sync so dropping a reference just
> before calling omap_wdt_start doesn't make much sense. Moreover there is
> no point to use the synchronous variant of pm_runtime_put because the
> driver doesn't care if the clock is disabled before or after
> omap_wdt_probe returns.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/watchdog/omap_wdt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
> index 7abd6988d94a..af8947429c91 100644
> --- a/drivers/watchdog/omap_wdt.c
> +++ b/drivers/watchdog/omap_wdt.c
> @@ -282,11 +282,11 @@ static int omap_wdt_probe(struct platform_device *pdev)
>  		readl_relaxed(wdev->base + OMAP_WATCHDOG_REV) & 0xFF,
>  		wdev->wdog.timeout);
>  
> -	pm_runtime_put_sync(wdev->dev);
> -
>  	if (early_enable)
>  		omap_wdt_start(&wdev->wdog);
>  
> +	pm_runtime_put(wdev->dev);
> +
>  	return 0;
>  }
>  

Patch added to linux-watchdog-next.

Kind regards,
Wim.

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" 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] 6+ messages in thread

* Re: [PATCH 2/2] watchdog: omap: don't disable the timer when it should be enabled early
  2015-12-15 10:37 ` [PATCH 2/2] watchdog: omap: don't disable the timer when it should be enabled early Uwe Kleine-König
  2015-12-15 16:20   ` Guenter Roeck
@ 2015-12-27 20:16   ` Wim Van Sebroeck
  1 sibling, 0 replies; 6+ messages in thread
From: Wim Van Sebroeck @ 2015-12-27 20:16 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: kernel, linux-watchdog, Lars Poeschel, Guenter Roeck

Hi Uwe,

> With the early_enable module parameter the watchdog can be started
> during driver probe time. If this is requested the bets are good that
> the timer is already running, so to narrow the gap where the timer is
> disabled only call the disable function when the timer shouldn't be
> started.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/watchdog/omap_wdt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
> index af8947429c91..ae673cd06aa1 100644
> --- a/drivers/watchdog/omap_wdt.c
> +++ b/drivers/watchdog/omap_wdt.c
> @@ -270,7 +270,8 @@ static int omap_wdt_probe(struct platform_device *pdev)
>  			wdev->wdog.bootstatus = WDIOF_CARDRESET;
>  	}
>  
> -	omap_wdt_disable(wdev);
> +	if (!early_enable)
> +		omap_wdt_disable(wdev);
>  
>  	ret = watchdog_register_device(&wdev->wdog);
>  	if (ret) {
> -- 
> 2.6.2
> 

Patch added to linux-watchdog-next.

Kind regards,
Wim.

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" 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] 6+ messages in thread

end of thread, other threads:[~2015-12-27 20:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-15 10:37 [PATCH 1/2] watchdog: omap: don't disable runtime pm before starting device Uwe Kleine-König
2015-12-15 10:37 ` [PATCH 2/2] watchdog: omap: don't disable the timer when it should be enabled early Uwe Kleine-König
2015-12-15 16:20   ` Guenter Roeck
2015-12-27 20:16   ` Wim Van Sebroeck
2015-12-15 16:20 ` [PATCH 1/2] watchdog: omap: don't disable runtime pm before starting device Guenter Roeck
2015-12-27 20:16 ` Wim Van Sebroeck

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.