All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] watchdog: sp805: Set watchdog_device->timeout from ->set_timeout()
@ 2014-05-15  4:31 ` Viresh Kumar
  0 siblings, 0 replies; 5+ messages in thread
From: Viresh Kumar @ 2014-05-15  4:31 UTC (permalink / raw)
  To: wim; +Cc: linux-watchdog, linux-arm-kernel, arun.ramamurthy, Viresh Kumar,
	stable

Implementation of ->set_timeout() is supposed to set 'timeout' field of 'struct
watchdog_device' passed to it. sp805 was rather setting this in a local
variable. Fix it.

Cc: <stable@vger.kernel.org> # 2.6.36+
Reported-by: Arun Ramamurthy <arun.ramamurthy@broadcom.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
Greg,

This driver was introduced in 2.6.36 and WDIOC_GETTIMEOUT is broken since then.
So added it for such an old stable release. Not sure if it should only be worth
applying to 3.0+

 drivers/watchdog/sp805_wdt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
index 47629d2..c1b03f4 100644
--- a/drivers/watchdog/sp805_wdt.c
+++ b/drivers/watchdog/sp805_wdt.c
@@ -59,7 +59,6 @@
  * @adev: amba device structure of wdt
  * @status: current status of wdt
  * @load_val: load value to be set for current timeout
- * @timeout: current programmed timeout
  */
 struct sp805_wdt {
 	struct watchdog_device		wdd;
@@ -68,7 +67,6 @@ struct sp805_wdt {
 	struct clk			*clk;
 	struct amba_device		*adev;
 	unsigned int			load_val;
-	unsigned int			timeout;
 };
 
 static bool nowayout = WATCHDOG_NOWAYOUT;
@@ -98,7 +96,7 @@ static int wdt_setload(struct watchdog_device *wdd, unsigned int timeout)
 	spin_lock(&wdt->lock);
 	wdt->load_val = load;
 	/* roundup timeout to closest positive integer value */
-	wdt->timeout = div_u64((load + 1) * 2 + (rate / 2), rate);
+	wdd->timeout = div_u64((load + 1) * 2 + (rate / 2), rate);
 	spin_unlock(&wdt->lock);
 
 	return 0;
-- 
2.0.0.rc2


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

* [PATCH] watchdog: sp805: Set watchdog_device->timeout from ->set_timeout()
@ 2014-05-15  4:31 ` Viresh Kumar
  0 siblings, 0 replies; 5+ messages in thread
From: Viresh Kumar @ 2014-05-15  4:31 UTC (permalink / raw)
  To: linux-arm-kernel

Implementation of ->set_timeout() is supposed to set 'timeout' field of 'struct
watchdog_device' passed to it. sp805 was rather setting this in a local
variable. Fix it.

Cc: <stable@vger.kernel.org> # 2.6.36+
Reported-by: Arun Ramamurthy <arun.ramamurthy@broadcom.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
Greg,

This driver was introduced in 2.6.36 and WDIOC_GETTIMEOUT is broken since then.
So added it for such an old stable release. Not sure if it should only be worth
applying to 3.0+

 drivers/watchdog/sp805_wdt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
index 47629d2..c1b03f4 100644
--- a/drivers/watchdog/sp805_wdt.c
+++ b/drivers/watchdog/sp805_wdt.c
@@ -59,7 +59,6 @@
  * @adev: amba device structure of wdt
  * @status: current status of wdt
  * @load_val: load value to be set for current timeout
- * @timeout: current programmed timeout
  */
 struct sp805_wdt {
 	struct watchdog_device		wdd;
@@ -68,7 +67,6 @@ struct sp805_wdt {
 	struct clk			*clk;
 	struct amba_device		*adev;
 	unsigned int			load_val;
-	unsigned int			timeout;
 };
 
 static bool nowayout = WATCHDOG_NOWAYOUT;
@@ -98,7 +96,7 @@ static int wdt_setload(struct watchdog_device *wdd, unsigned int timeout)
 	spin_lock(&wdt->lock);
 	wdt->load_val = load;
 	/* roundup timeout to closest positive integer value */
-	wdt->timeout = div_u64((load + 1) * 2 + (rate / 2), rate);
+	wdd->timeout = div_u64((load + 1) * 2 + (rate / 2), rate);
 	spin_unlock(&wdt->lock);
 
 	return 0;
-- 
2.0.0.rc2

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

* Re: [PATCH] watchdog: sp805: Set watchdog_device->timeout from ->set_timeout()
  2014-05-15  4:31 ` Viresh Kumar
@ 2014-05-15  4:44   ` Guenter Roeck
  -1 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2014-05-15  4:44 UTC (permalink / raw)
  To: Viresh Kumar, wim
  Cc: linux-watchdog, linux-arm-kernel, arun.ramamurthy, stable

On 05/14/2014 09:31 PM, Viresh Kumar wrote:
> Implementation of ->set_timeout() is supposed to set 'timeout' field of 'struct
> watchdog_device' passed to it. sp805 was rather setting this in a local
> variable. Fix it.
>
> Cc: <stable@vger.kernel.org> # 2.6.36+
> Reported-by: Arun Ramamurthy <arun.ramamurthy@broadcom.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

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


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

* [PATCH] watchdog: sp805: Set watchdog_device->timeout from ->set_timeout()
@ 2014-05-15  4:44   ` Guenter Roeck
  0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2014-05-15  4:44 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/14/2014 09:31 PM, Viresh Kumar wrote:
> Implementation of ->set_timeout() is supposed to set 'timeout' field of 'struct
> watchdog_device' passed to it. sp805 was rather setting this in a local
> variable. Fix it.
>
> Cc: <stable@vger.kernel.org> # 2.6.36+
> Reported-by: Arun Ramamurthy <arun.ramamurthy@broadcom.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

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

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

* Re: [PATCH] watchdog: sp805: Set watchdog_device->timeout from ->set_timeout()
  2014-05-15  4:31 ` Viresh Kumar
  (?)
  (?)
@ 2014-05-26 21:10 ` Wim Van Sebroeck
  -1 siblings, 0 replies; 5+ messages in thread
From: Wim Van Sebroeck @ 2014-05-26 21:10 UTC (permalink / raw)
  To: Viresh Kumar; +Cc: linux-watchdog, linux-arm-kernel, arun.ramamurthy, stable

Hi Viresh,

> Implementation of ->set_timeout() is supposed to set 'timeout' field of 'struct
> watchdog_device' passed to it. sp805 was rather setting this in a local
> variable. Fix it.
> 
> Cc: <stable@vger.kernel.org> # 2.6.36+
> Reported-by: Arun Ramamurthy <arun.ramamurthy@broadcom.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> Greg,
> 
> This driver was introduced in 2.6.36 and WDIOC_GETTIMEOUT is broken since then.
> So added it for such an old stable release. Not sure if it should only be worth
> applying to 3.0+
> 
>  drivers/watchdog/sp805_wdt.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Patch has been added to linux-watchdog-next.

Kind regards,
Wim.


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

end of thread, other threads:[~2014-05-26 21:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-15  4:31 [PATCH] watchdog: sp805: Set watchdog_device->timeout from ->set_timeout() Viresh Kumar
2014-05-15  4:31 ` Viresh Kumar
2014-05-15  4:44 ` Guenter Roeck
2014-05-15  4:44   ` Guenter Roeck
2014-05-26 21:10 ` 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.