watchdog: sama5d4: make use of timeout-secs provided in devicetree
Subsystems (7)
PATCH v3 1/7 watchdog: sama5d4: make use of timeout-secs provided in devicetree
watchdog_init_timeout() will allways pick timeout_param since it defaults to a valid timeout.
Following best practice described in Documentation/watchdog/watchdog-kernel-api.txt to make use of the parameter logic.
---
Notes:
v3:
- Use wdd->timeout instead of wdt_timeout when print out timout in probe function.
drivers/watchdog/sama5d4_wdt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/watchdog/sama5d4_wdt.c +3 -3
@@ -33,7 +33,7 @@ struct sama5d4_wdt {unsigned long last_ping; }; -static int wdt_timeout =WDT_DEFAULT_TIMEOUT ; +static int wdt_timeout;static bool nowayout =WATCHDOG_NOWAYOUT ;module_param (wdt_timeout, int,0 );
@@ -212,7 +212,7 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)return -ENOMEM ; wdd = &wdt->wdd; - wdd->timeout = wdt_timeout; + wdd->timeout =WDT_DEFAULT_TIMEOUT ; wdd->info = &sama5d4_wdt_info; wdd->ops = &sama5d4_wdt_ops; wdd->min_timeout =MIN_WDT_TIMEOUT ;
@@ -273,7 +273,7 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)platform_set_drvdata (pdev, wdt);dev_info (&pdev->dev,"initialized (timeout = %d sec, nowayout = %d)\n" , - wdt_timeout, nowayout); + wdd->timeout, nowayout);return 0 ; }
Signature · 1 line
2.15.1
PATCH v3 2/7 watchdog: sunxi: allow setting timeout in devicetree
watchdog_init_timeout() will allways pick timeout_param since it defaults to a valid timeout.
By following best practice described in Documentation/watchdog/watchdog-kernel-api.txt, it also let us to set timout-sec property in devicetree.
--- Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt | 4 ++++ drivers/watchdog/sunxi_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt +4 -0
@@ -6,9 +6,13 @@ Required properties: "allwinner,sun6i-a31-wdt" - reg : Specifies base physical address and size of the registers. +Optional properties: +- timeout-sec : Contains the watchdog timeout in seconds + Example: wdt: watchdog at 1c20c90 { compatible = "allwinner,sun4i-a10-wdt"; reg = <0x01c20c90 0x10>; + timeout-sec = <10>; };
drivers/watchdog/sunxi_wdt.c +1 -1
@@ -39,7 +39,7 @@#define DRV_VERSION "1.0"static bool nowayout =WATCHDOG_NOWAYOUT ; -static unsigned int timeout =WDT_MAX_TIMEOUT ; +static unsigned int timeout;/* * This structure stores the register offsets for different variants
Signature · 1 line
2.15.1
Re: [PATCH v3 2/7] watchdog: sunxi: allow setting timeout in devicetree
Quoted 7 lines · Marcus Folkesson
watchdog_init_timeout()will allways picktimeout_paramsince it defaults to a valid timeout.By following best practice described in
Documentation/watchdog/watchdog-kernel-api.txt, it also let us to set timout-sec property in devicetree.
Quoted 6 lines
Signed-off-by Marcus Folkesson <[email protected]>Reviewed-by Guenter Roeck <[email protected]>--- Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt | 4 ++++ drivers/watchdog/sunxi_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
Chen-Yu Tsai
Reviewed-byRe: [PATCH v3 2/7] watchdog: sunxi: allow setting timeout in devicetree
Quoted 8 lines · Rob Herring
Quoted 7 lines · Marcus Folkesson
watchdog_init_timeout()will allways picktimeout_paramsince it defaults to a valid timeout.By following best practice described in
Documentation/watchdog/watchdog-kernel-api.txt, it also let us to set timout-sec property in devicetree.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Marcus Folkesson <[email protected]>Reviewed-by Guenter Roeck <[email protected]>--- Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt | 4 ++++ drivers/watchdog/sunxi_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)Reviewed-by Rob Herring <[email protected]>
PATCH v3 3/7 watchdog: sirfsoc: allow setting timeout in devicetree
In reply to Marcus Folkessonwatchdog_init_timeout() will allways pick timeout_param since it defaults to a valid timeout.
By following best practice described in Documentation/watchdog/watchdog-kernel-api.txt, it also let us to set timout-sec property in devicetree.
--- Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt | 4 ++++ drivers/watchdog/sirfsoc_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt +4 -0
@@ -5,10 +5,14 @@ Required properties: - reg: Address range of tick timer/WDT register set - interrupts: interrupt number to the cpu +Optional properties: +- timeout-sec : Contains the watchdog timeout in seconds + Example: timer at b0020000 { compatible = "sirf,prima2-tick"; reg = <0xb0020000 0x1000>; interrupts = <0>; + timeout-sec = <30>; };
drivers/watchdog/sirfsoc_wdt.c +1 -1
@@ -29,7 +29,7 @@#define SIRFSOC_WDT_MAX_TIMEOUT (10 * 60)/* 10 mins */ #define SIRFSOC_WDT_DEFAULT_TIMEOUT 30/* 30 secs */ -static unsigned int timeout =SIRFSOC_WDT_DEFAULT_TIMEOUT ; +static unsigned int timeout;static bool nowayout =WATCHDOG_NOWAYOUT ;module_param (timeout, uint,0 );
Signature · 1 line
2.15.1
Rob Herring
maintainerRe: [PATCH v3 3/7] watchdog: sirfsoc: allow setting timeout in devicetree
Quoted 6 lines · Marcus Folkesson
watchdog_init_timeout()will allways picktimeout_paramsince it defaults to a valid timeout.By following best practice described in
Documentation/watchdog/watchdog-kernel-api.txt, it also let us to set timout-sec property in devicetree.
typo
Quoted 32 lines
Signed-off-by Marcus Folkesson <[email protected]>Reviewed-by Guenter Roeck <[email protected]>--- Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt | 4 ++++ drivers/watchdog/sirfsoc_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt +4
-0@@ -5,10 +5,14 @@ Required properties: - reg: Address range of tick timer/WDT register set - interrupts: interrupt number to the cpu +Optional properties: +- timeout-sec : Contains the watchdog timeout in seconds + Example: timer at b0020000 { compatible = "sirf,prima2-tick"; reg = <0xb0020000 0x1000>; interrupts = <0>; + timeout-sec = <30>; };drivers/watchdog/sirfsoc_wdt.c +0
-0
drivers/watchdog/sirfsoc_wdt.c line 32
Quoted 5 lines
drivers/watchdog/sirfsoc_wdt.c +1
-1@@ -29,7 +29,7 @@#define SIRFSOC_WDT_MAX_TIMEOUT (10 * 60)/* 10 mins */ #define SIRFSOC_WDT_DEFAULT_TIMEOUT 30/* 30 secs */ -static unsigned int timeout =SIRFSOC_WDT_DEFAULT_TIMEOUT ; +static unsigned int timeout;
If you have an old dtb, then you still need the default.
Quoted 6 lines
drivers/watchdog/sirfsoc_wdt.c +0
-0static bool nowayout =WATCHDOG_NOWAYOUT ;module_param (timeout, uint,0 );Signature · 1 line
2.15.1
Guenter Roeck
maintainerRe: [PATCH v3 3/7] watchdog: sirfsoc: allow setting timeout in devicetree
Quoted 45 lines · Rob Herring
Quoted 6 lines · Marcus Folkesson
watchdog_init_timeout()will allways picktimeout_paramsince it defaults to a valid timeout.By following best practice described in
Documentation/watchdog/watchdog-kernel-api.txt, it also let us to set timout-sec property in devicetree.typo
Quoted 35 lines
Signed-off-by Marcus Folkesson <[email protected]>Reviewed-by Guenter Roeck <[email protected]>--- Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt | 4 ++++ drivers/watchdog/sirfsoc_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt +4
-0@@ -5,10 +5,14 @@ Required properties: - reg: Address range of tick timer/WDT register set - interrupts: interrupt number to the cpu +Optional properties: +- timeout-sec : Contains the watchdog timeout in seconds + Example: timer at b0020000 { compatible = "sirf,prima2-tick"; reg = <0xb0020000 0x1000>; interrupts = <0>; + timeout-sec = <30>; };drivers/watchdog/sirfsoc_wdt.c +0
-0@@ -29,7 +29,7 @@#define SIRFSOC_WDT_MAX_TIMEOUT (10 * 60)/* 10 mins */ #define SIRFSOC_WDT_DEFAULT_TIMEOUT 30/* 30 secs */
Quoted 5 lines
drivers/watchdog/sirfsoc_wdt.c line 32
Quoted 2 lines
drivers/watchdog/sirfsoc_wdt.c +1
-1-static unsigned int timeout =SIRFSOC_WDT_DEFAULT_TIMEOUT ; +static unsigned int timeout;If you have an old dtb, then you still need the default.
No. It is optional to start with, and the driver already has
static struct watchdog_device sirfsoc_wdd = {
.info = &sirfsoc_wdt_ident,
.ops = &sirfsoc_wdt_ops,
.timeout = SIRFSOC_WDT_DEFAULT_TIMEOUT, <------
.min_timeout = SIRFSOC_WDT_MIN_TIMEOUT,
.max_timeout = SIRFSOC_WDT_MAX_TIMEOUT,
};
Guenter
Quoted 7 lines
Quoted 6 lines
drivers/watchdog/sirfsoc_wdt.c +0
-0static bool nowayout =WATCHDOG_NOWAYOUT ;module_param (timeout, uint,0 );Signature · 1 line
2.15.1
Re: [PATCH v3 3/7] watchdog: sirfsoc: allow setting timeout in devicetree
Quoted 58 lines · Guenter Roeck
Quoted 45 lines · Rob Herring
Quoted 7 lines · Marcus Folkesson
watchdog_init_timeout()will allways picktimeout_paramsince it defaults to a valid timeout.By following best practice described in
Documentation/watchdog/watchdog-kernel-api.txt, it also let us to set timout-sec property in devicetree.typo
Quoted 32 lines
Signed-off-by Marcus Folkesson <[email protected]>Reviewed-by Guenter Roeck <[email protected]>--- Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt | 4 ++++ drivers/watchdog/sirfsoc_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt +3
-0@@ -5,10 +5,14 @@ Required properties: - reg: Address range of tick timer/WDT register set - interrupts: interrupt number to the cpu +Optional properties: +- timeout-sec : Contains the watchdog timeout in seconds + Example: timer at b0020000 { compatible = "sirf,prima2-tick"; reg = <0xb0020000 0x1000>; interrupts = <0>; + timeout-sec = <30>; };drivers/watchdog/sirfsoc_wdt.c +0
-0@@ -29,7 +29,7 @@Quoted 9 lines
Quoted 5 lines
drivers/watchdog/sirfsoc_wdt.c +0
-0#define SIRFSOC_WDT_MAX_TIMEOUT (10 * 60)/* 10 mins */
#defineSIRFSOC_WDT_DEFAULT_TIMEOUT30 /* 30 secs */
-static unsigned int timeout =SIRFSOC_WDT_DEFAULT_TIMEOUT;
+static unsigned int timeout;If you have an old dtb, then you still need the default.
No. It is optional to start with, and the driver already has
Quoted 7 lines
static struct
watchdog_devicesirfsoc_wdd= {
.info =&sirfsoc_wdt_ident,
.ops =&sirfsoc_wdt_ops,
.timeout =SIRFSOC_WDT_DEFAULT_TIMEOUT, <------
.min_timeout =SIRFSOC_WDT_MIN_TIMEOUT,
.max_timeout =SIRFSOC_WDT_MAX_TIMEOUT,
};
Okay, then:
for the lot.
Rob
PATCH v3 4/7 watchdog: pnx4008: make use of timeout-secs provided in devicetree
In reply to Marcus Folkessonwatchdog_init_timeout() will allways pick timeout_param since it defaults to a valid timeout.
Following best practice described in Documentation/watchdog/watchdog-kernel-api.txt to make use of the parameter logic.
--- drivers/watchdog/pnx4008_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/pnx4008_wdt.c +1 -1
@@ -78,7 +78,7 @@#define WDOG_COUNTER_RATE 13000000/*the counter clock is 13 MHz fixed */ static bool nowayout =WATCHDOG_NOWAYOUT ; -static unsigned int heartbeat =DEFAULT_HEARTBEAT ; +static unsigned int heartbeat;static DEFINE_SPINLOCK (io_lock);static void __iomem *wdt_base;
Signature · 1 line
2.15.1
PATCH v3 5/7 watchdog: mtk: allow setting timeout in devicetree
In reply to Marcus Folkessonwatchdog_init_timeout() will allways pick timeout_param since it defaults to a valid timeout.
By following best practice described in Documentation/watchdog/watchdog-kernel-api.txt, it also let us to set timout-sec property in devicetree.
--- Documentation/devicetree/bindings/watchdog/mtk-wdt.txt | 4 ++++ drivers/watchdog/mtk_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/watchdog/mtk-wdt.txt +4 -0
@@ -11,9 +11,13 @@ Required properties: - reg : Specifies base physical address and size of the registers. +Optional properties: +- timeout-sec: contains the watchdog timeout in seconds. + Example: wdt: watchdog at 10000000 { compatible = "mediatek,mt6589-wdt"; reg = <0x10000000 0x18>; + timeout-sec = <10>; };
drivers/watchdog/mtk_wdt.c +1 -1
@@ -57,7 +57,7 @@#define DRV_VERSION "1.0"static bool nowayout =WATCHDOG_NOWAYOUT ; -static unsigned int timeout =WDT_MAX_TIMEOUT ; +static unsigned int timeout;struct mtk_wdt_dev {struct watchdog_device wdt_dev;
Signature · 1 line
2.15.1
Rob Herring
maintainerRe: [PATCH v3 5/7] watchdog: mtk: allow setting timeout in devicetree
Quoted 6 lines · Marcus Folkesson
watchdog_init_timeout()will allways picktimeout_paramsince it defaults to a valid timeout.By following best practice described in
Documentation/watchdog/watchdog-kernel-api.txt, it also let us to set timout-sec property in devicetree.
Same problems in this one.
Quoted 7 lines
Signed-off-by Marcus Folkesson <[email protected]>Reviewed-by Guenter Roeck <[email protected]>--- Documentation/devicetree/bindings/watchdog/mtk-wdt.txt | 4 ++++ drivers/watchdog/mtk_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
Guenter Roeck
maintainerRe: [PATCH v3 5/7] watchdog: mtk: allow setting timeout in devicetree
Quoted 10 lines · Rob Herring
Quoted 6 lines · Marcus Folkesson
watchdog_init_timeout()will allways picktimeout_paramsince it defaults to a valid timeout.By following best practice described in
Documentation/watchdog/watchdog-kernel-api.txt, it also let us to set timout-sec property in devicetree.Same problems in this one.
Same answer. In the existing driver;
mtk_wdt->wdt_dev.timeout = WDT_MAX_TIMEOUT;
Guenter
Quoted 8 lines
Quoted 7 lines
Signed-off-by Marcus Folkesson <[email protected]>Reviewed-by Guenter Roeck <[email protected]>--- Documentation/devicetree/bindings/watchdog/mtk-wdt.txt | 4 ++++ drivers/watchdog/mtk_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
Re: [PATCH v3 5/7] watchdog: mtk: allow setting timeout in devicetree
In reply to Marcus FolkessonQuoted 38 lines · Marcus Folkesson
watchdog_init_timeout()will allways picktimeout_paramsince it defaults to a valid timeout.By following best practice described in
Documentation/watchdog/watchdog-kernel-api.txt, it also let us to set timout-sec property in devicetree.Signed-off-by Marcus Folkesson <[email protected]>Reviewed-by Guenter Roeck <[email protected]>--- Documentation/devicetree/bindings/watchdog/mtk-wdt.txt | 4 ++++ drivers/watchdog/mtk_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/watchdog/mtk-wdt.txt +4
-0@@ -11,9 +11,13 @@ Required properties: - reg : Specifies base physical address and size of the registers. +Optional properties: +- timeout-sec: contains the watchdog timeout in seconds. + Example: wdt: watchdog at 10000000 { compatible = "mediatek,mt6589-wdt"; reg = <0x10000000 0x18>; + timeout-sec = <10>; };drivers/watchdog/mtk_wdt.c +0
-0
drivers/watchdog/mtk_wdt.c line 63
Quoted 8 lines
drivers/watchdog/mtk_wdt.c +1
-1@@ -57,7 +57,7 @@#define DRV_VERSION "1.0"static bool nowayout =WATCHDOG_NOWAYOUT ; -static unsigned int timeout =WDT_MAX_TIMEOUT ; +static unsigned int timeout;struct mtk_wdt_dev {struct watchdog_device wdt_dev;
PATCH v3 6/7 watchdog: meson: allow setting timeout in devicetree
In reply to Marcus Folkessonwatchdog_init_timeout() will allways pick timeout_param since it defaults to a valid timeout.
By following best practice described in Documentation/watchdog/watchdog-kernel-api.txt, it also let us to set timout-sec property in devicetree.
--- Documentation/devicetree/bindings/watchdog/meson-wdt.txt | 4 ++++ drivers/watchdog/meson_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/watchdog/meson-wdt.txt +4 -0
@@ -9,9 +9,13 @@ Required properties: "amlogic,meson8m2-wdt" and "amlogic,meson8b-wdt" on Meson8m2 SoCs - reg : Specifies base physical address and size of the registers. +Optional properties: +- timeout-sec: contains the watchdog timeout in seconds. + Example: wdt: watchdog at c1109900 { compatible = "amlogic,meson6-wdt"; reg = <0xc1109900 0x8>; + timeout-sec = <10>; };
drivers/watchdog/meson_wdt.c +1 -1
@@ -36,7 +36,7 @@#define MESON_SEC_TO_TC (s, c) ((s) * (c))static bool nowayout =WATCHDOG_NOWAYOUT ; -static unsigned int timeout =MESON_WDT_TIMEOUT ; +static unsigned int timeout;struct meson_wdt_data {unsigned int enable;
Signature · 1 line
2.15.1
PATCH v3 7/7 watchdog: coh901327: make use of timeout-secs provided in devicetree
In reply to Marcus Folkessonwatchdog_init_timeout() will allways pick timeout_param since it defaults to a valid timeout.
Following best practice described in Documentation/watchdog/watchdog-kernel-api.txt to make use of the parameter logic.
---
Notes:
v3:
- Reformat and use coh901327_wdt.timeout instead of margin when print out timout in probe function.
v2:
- Set .timeout in coh901327_wdt structure declaration.
- Set .min_timeout to 1 instead of 0. I could not find a datasheet for coh901327, so I'm not sure if 0 is valid. However, 0 seems wrong to me and most driver has 1 as min value. If it should be 0, please let me know and I have to set another initial value for margin.
drivers/watchdog/coh901327_wdt.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/watchdog/coh901327_wdt.c +8 -6
@@ -67,7 +67,9 @@#define U300_WDOG_IFR_WILL_BARK_IRQ_FORCE_ENABLE 0x0001U/* Default timeout in seconds = 1 minute */ -static unsigned int margin =60 ; +#define U300_WDOG_DEFAULT_TIMEOUT 60 + +static unsigned int margin;static int irq;static void __iomem *virtbase;static struct device *parent;
@@ -235,8 +237,9 @@ static struct watchdog_device coh901327_wdt = {* timeout register is max * 0x7FFF = 327670ms ~= 327s. */ - .min_timeout = 0, + .min_timeout = 1, .max_timeout = 327, + .timeout = U300_WDOG_DEFAULT_TIMEOUT, }; static int __exit coh901327_remove(struct platform_device *pdev)
@@ -315,16 +318,15 @@ static int __init coh901327_probe(struct platform_device *pdev) goto out_no_irq; } - ret =watchdog_init_timeout (&coh901327_wdt, margin, dev); -if (ret <0 ) - coh901327_wdt.timeout =60 ; +watchdog_init_timeout (&coh901327_wdt, margin, dev); coh901327_wdt.parent = dev; ret =watchdog_register_device (&coh901327_wdt);if (ret) goto out_no_wdog; -dev_info (dev,"initialized. timer margin=%d sec\n" , margin); +dev_info (dev,"initialized. (timeout=%d sec)\n" , + coh901327_wdt.timeout);return 0 ; out_no_wdog:
Signature · 1 line
2.15.1
Re: [v3, 7/7] watchdog: coh901327: make use of timeout-secs provided in devicetree
Quoted 8 lines · Marcus Folkesson
watchdog_init_timeout()will allways picktimeout_paramsince it defaults to a valid timeout.Following best practice described in
Documentation/watchdog/watchdog-kernel-api.txtto make use of the parameter logic.Signed-off-by Marcus Folkesson <[email protected]>
Quoted 64 lines
---
Notes:
v3:
- Reformat and use coh901327_wdt.timeout instead of margin when print out timout in probe function.v2:
- Set .timeout incoh901327_wdtstructure declaration.
- Set .min_timeout to 1 instead of 0. I could not find a datasheet for coh901327, so I'm not sure if 0 is valid. However, 0 seems wrong to me and most driver has 1 as min value. If it should be 0, please let me know and I have to set another initial value for margin.drivers/watchdog/coh901327_wdt.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)drivers/watchdog/coh901327_wdt.c +8
-6@@ -67,7 +67,9 @@#define U300_WDOG_IFR_WILL_BARK_IRQ_FORCE_ENABLE 0x0001U/* Default timeout in seconds = 1 minute */ -static unsigned int margin =60 ; +#define U300_WDOG_DEFAULT_TIMEOUT 60 + +static unsigned int margin;static int irq;static void __iomem *virtbase;static struct device *parent;@@ -235,8 +237,9 @@ static struct watchdog_device coh901327_wdt = {* timeout register is max * 0x7FFF = 327670ms ~= 327s. */ - .min_timeout = 0, + .min_timeout = 1, .max_timeout = 327, + .timeout = U300_WDOG_DEFAULT_TIMEOUT, }; static int __exit coh901327_remove(struct platform_device *pdev)@@ -315,16 +318,15 @@ static int __init coh901327_probe(struct platform_device *pdev) goto out_no_irq; } - ret =watchdog_init_timeout (&coh901327_wdt, margin, dev); -if (ret <0 ) - coh901327_wdt.timeout =60 ; +watchdog_init_timeout (&coh901327_wdt, margin, dev); coh901327_wdt.parent = dev; ret =watchdog_register_device (&coh901327_wdt);if (ret) goto out_no_wdog; -dev_info (dev,"initialized. timer margin=%d sec\n" , margin); +dev_info (dev,"initialized. (timeout=%d sec)\n" , + coh901327_wdt.timeout);return 0 ; out_no_wdog:
Re: [PATCH v3 7/7] watchdog: coh901327: make use of timeout-secs provided in devicetree
In reply to Marcus FolkessonQuoted 15 lines · Marcus Folkesson
watchdog_init_timeout()will allways picktimeout_paramsince it defaults to a valid timeout.Following best practice described in
Documentation/watchdog/watchdog-kernel-api.txtto make use of the parameter logic.Signed-off-by Marcus Folkesson <[email protected]>---
Notes:
v3:
- Reformat and use coh901327_wdt.timeout instead of margin when print out timout in probe function.
Quoted 7 lines
v2:
- Set .timeout incoh901327_wdtstructure declaration.
- Set .min_timeout to 1 instead of 0. I could not find a datasheet for coh901327, so I'm not sure if 0 is valid. However, 0 seems wrong to me and most driver has 1 as min value. If it should be 0, please let me know and I have to set another initial value for margin.
Yours,
Linus Walleij
Quoted 8 lines · Marcus Folkesson
watchdog_init_timeout()will allways picktimeout_paramsince it defaults to a valid timeout.Following best practice described in
Documentation/watchdog/watchdog-kernel-api.txtto make use of the parameter logic.Signed-off-by Marcus Folkesson <[email protected]>
Quoted 41 lines
---
Notes:
v3:
- Usewdd->timeoutinstead ofwdt_timeoutwhen print out timout in probe function.drivers/watchdog/sama5d4_wdt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/watchdog/sama5d4_wdt.c +3
-3@@ -33,7 +33,7 @@ struct sama5d4_wdt {unsigned long last_ping; }; -static int wdt_timeout =WDT_DEFAULT_TIMEOUT ; +static int wdt_timeout;static bool nowayout =WATCHDOG_NOWAYOUT ;module_param (wdt_timeout, int,0 );@@ -212,7 +212,7 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)return -ENOMEM ; wdd = &wdt->wdd; - wdd->timeout = wdt_timeout; + wdd->timeout =WDT_DEFAULT_TIMEOUT ; wdd->info = &sama5d4_wdt_info; wdd->ops = &sama5d4_wdt_ops; wdd->min_timeout =MIN_WDT_TIMEOUT ;@@ -273,7 +273,7 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)platform_set_drvdata (pdev, wdt);dev_info (&pdev->dev,"initialized (timeout = %d sec, nowayout = %d)\n" , - wdt_timeout, nowayout); + wdd->timeout, nowayout);return 0 ; }
Quoted 8 lines · Marcus Folkesson
watchdog_init_timeout()will allways picktimeout_paramsince it defaults to a valid timeout.Following best practice described in
Documentation/watchdog/watchdog-kernel-api.txtto make use of the parameter logic.Signed-off-by Marcus Folkesson <[email protected]>
Thanks, best regards,
Nicolas
Quoted 42 lines
---
Notes:
v3:
- Usewdd->timeoutinstead ofwdt_timeoutwhen print out timout in probe function.drivers/watchdog/sama5d4_wdt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/watchdog/sama5d4_wdt.c +3
-3@@ -33,7 +33,7 @@ struct sama5d4_wdt {unsigned long last_ping; }; -static int wdt_timeout =WDT_DEFAULT_TIMEOUT ; +static int wdt_timeout;static bool nowayout =WATCHDOG_NOWAYOUT ;module_param (wdt_timeout, int,0 );@@ -212,7 +212,7 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)return -ENOMEM ; wdd = &wdt->wdd; - wdd->timeout = wdt_timeout; + wdd->timeout =WDT_DEFAULT_TIMEOUT ; wdd->info = &sama5d4_wdt_info; wdd->ops = &sama5d4_wdt_ops; wdd->min_timeout =MIN_WDT_TIMEOUT ;@@ -273,7 +273,7 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)platform_set_drvdata (pdev, wdt);dev_info (&pdev->dev,"initialized (timeout = %d sec, nowayout = %d)\n" , - wdt_timeout, nowayout); + wdd->timeout, nowayout);return 0 ; }
Signature · 1 line
Nicolas Ferre
Hi,
Am I supposed to do something more to make this patchset picked up?
Thanks,
Marcus Folkesson
Quoted 52 lines · Marcus Folkesson
watchdog_init_timeout()will allways picktimeout_paramsince it defaults to a valid timeout.Following best practice described in
Documentation/watchdog/watchdog-kernel-api.txtto make use of the parameter logic.Signed-off-by Marcus Folkesson <[email protected]>---
Notes:
v3:
- Usewdd->timeoutinstead ofwdt_timeoutwhen print out timout in probe function.drivers/watchdog/sama5d4_wdt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/watchdog/sama5d4_wdt.c +3
-3@@ -33,7 +33,7 @@ struct sama5d4_wdt {unsigned long last_ping; }; -static int wdt_timeout =WDT_DEFAULT_TIMEOUT ; +static int wdt_timeout;static bool nowayout =WATCHDOG_NOWAYOUT ;module_param (wdt_timeout, int,0 );@@ -212,7 +212,7 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)return -ENOMEM ; wdd = &wdt->wdd; - wdd->timeout = wdt_timeout; + wdd->timeout =WDT_DEFAULT_TIMEOUT ; wdd->info = &sama5d4_wdt_info; wdd->ops = &sama5d4_wdt_ops; wdd->min_timeout =MIN_WDT_TIMEOUT ;@@ -273,7 +273,7 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)platform_set_drvdata (pdev, wdt);dev_info (&pdev->dev,"initialized (timeout = %d sec, nowayout = %d)\n" , - wdt_timeout, nowayout); + wdd->timeout, nowayout);return 0 ; }Signature · 1 line
2.15.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-amlogic/attachments/20180316/b80ee7cb/attachment.sig>
Guenter Roeck
maintainerQuoted 4 lines · Marcus Folkesson
Hi,
Am I supposed to do something more to make this patchset picked up?
Did you check linux-next ?
Guenter
Quoted 56 lines
Thanks,
Marcus FolkessonQuoted 52 lines · Marcus Folkesson
watchdog_init_timeout()will allways picktimeout_paramsince it defaults to a valid timeout.Following best practice described in
Documentation/watchdog/watchdog-kernel-api.txtto make use of the parameter logic.Signed-off-by Marcus Folkesson <[email protected]>---
Notes:
v3:
- Usewdd->timeoutinstead ofwdt_timeoutwhen print out timout in probe function.drivers/watchdog/sama5d4_wdt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/watchdog/sama5d4_wdt.c +3
-3@@ -33,7 +33,7 @@ struct sama5d4_wdt {unsigned long last_ping; }; -static int wdt_timeout =WDT_DEFAULT_TIMEOUT ; +static int wdt_timeout;static bool nowayout =WATCHDOG_NOWAYOUT ;module_param (wdt_timeout, int,0 );@@ -212,7 +212,7 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)return -ENOMEM ; wdd = &wdt->wdd; - wdd->timeout = wdt_timeout; + wdd->timeout =WDT_DEFAULT_TIMEOUT ; wdd->info = &sama5d4_wdt_info; wdd->ops = &sama5d4_wdt_ops; wdd->min_timeout =MIN_WDT_TIMEOUT ;@@ -273,7 +273,7 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)platform_set_drvdata (pdev, wdt);dev_info (&pdev->dev,"initialized (timeout = %d sec, nowayout = %d)\n" , - wdt_timeout, nowayout); + wdd->timeout, nowayout);return 0 ; }Signature · 1 line
2.15.1
Quoted 7 lines · Guenter Roeck
Quoted 4 lines · Marcus Folkesson
Hi,
Am I supposed to do something more to make this patchset picked up?
Did you check linux-next ?
:-)
Thank you
/Marcus
Quoted 3 lines
Guenter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-amlogic/attachments/20180317/8f662ce2/attachment.sig>