Re: [PATCH v3 1/6] watchdog: davinci: change driver to use WDT core
On 11/27/2013 09:04 AM, Guenter Roeck wrote: On 11/26/2013 08:31 PM, Sekhar Nori wrote: On Monday 25 November 2013 07:34 PM, Ivan Khoronzhuk wrote: To reduce code duplicate and increase code readability use WDT core code to handle WDT interface. Remove io_lock as the WDT core uses mutex to lock each wdt device. Remove wdt_state as the WDT core tracks state with its own variable. The watchdog_init_timeout() can read timeout value from timeout-sec property if the passed value is out of bounds. The heartbeat is initialized in next way. If heartbeat is not set thought module parameter, try to read it's value from WDT node timeout-sec property. If node has no one, use default value. The heartbeat is hold in wdd->timeout by WDT core, so use it in order to set timeout period. Signed-off-by: Ivan Khoronzhuk Acked-by: Santosh Shilimkar Reviewed-by: Guenter Roeck So this still causes a regression because the clk_get() fails due to the changed device name. Please fold this patch in (tested on DM365, compiled on rest). Also, the change in device name (while needed) does not seem to be related to usage of wdt core. Can you may be split that change into a separate patch? Given all the trouble with it, I think that would be a good idea. Guenter Ok, I'll split it for convenience. -- Regards, Ivan Khoronzhuk -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 1/6] watchdog: davinci: change driver to use WDT core
On 11/27/2013 09:04 AM, Guenter Roeck wrote: On 11/26/2013 08:31 PM, Sekhar Nori wrote: On Monday 25 November 2013 07:34 PM, Ivan Khoronzhuk wrote: To reduce code duplicate and increase code readability use WDT core code to handle WDT interface. Remove io_lock as the WDT core uses mutex to lock each wdt device. Remove wdt_state as the WDT core tracks state with its own variable. The watchdog_init_timeout() can read timeout value from timeout-sec property if the passed value is out of bounds. The heartbeat is initialized in next way. If heartbeat is not set thought module parameter, try to read it's value from WDT node timeout-sec property. If node has no one, use default value. The heartbeat is hold in wdd-timeout by WDT core, so use it in order to set timeout period. Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com Acked-by: Santosh Shilimkar santosh.shilim...@ti.com Reviewed-by: Guenter Roeck li...@roeck-us.net So this still causes a regression because the clk_get() fails due to the changed device name. Please fold this patch in (tested on DM365, compiled on rest). Also, the change in device name (while needed) does not seem to be related to usage of wdt core. Can you may be split that change into a separate patch? Given all the trouble with it, I think that would be a good idea. Guenter Ok, I'll split it for convenience. -- Regards, Ivan Khoronzhuk -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 1/6] watchdog: davinci: change driver to use WDT core
On 11/26/2013 08:31 PM, Sekhar Nori wrote: On Monday 25 November 2013 07:34 PM, Ivan Khoronzhuk wrote: To reduce code duplicate and increase code readability use WDT core code to handle WDT interface. Remove io_lock as the WDT core uses mutex to lock each wdt device. Remove wdt_state as the WDT core tracks state with its own variable. The watchdog_init_timeout() can read timeout value from timeout-sec property if the passed value is out of bounds. The heartbeat is initialized in next way. If heartbeat is not set thought module parameter, try to read it's value from WDT node timeout-sec property. If node has no one, use default value. The heartbeat is hold in wdd->timeout by WDT core, so use it in order to set timeout period. Signed-off-by: Ivan Khoronzhuk Acked-by: Santosh Shilimkar Reviewed-by: Guenter Roeck So this still causes a regression because the clk_get() fails due to the changed device name. Please fold this patch in (tested on DM365, compiled on rest). Also, the change in device name (while needed) does not seem to be related to usage of wdt core. Can you may be split that change into a separate patch? Given all the trouble with it, I think that would be a good idea. Guenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 1/6] watchdog: davinci: change driver to use WDT core
On Monday 25 November 2013 07:34 PM, Ivan Khoronzhuk wrote: > To reduce code duplicate and increase code readability use WDT core > code to handle WDT interface. > > Remove io_lock as the WDT core uses mutex to lock each wdt device. > Remove wdt_state as the WDT core tracks state with its own variable. > > The watchdog_init_timeout() can read timeout value from timeout-sec > property if the passed value is out of bounds. The heartbeat is > initialized in next way. If heartbeat is not set thought module > parameter, try to read it's value from WDT node timeout-sec property. > If node has no one, use default value. > > The heartbeat is hold in wdd->timeout by WDT core, so use it in > order to set timeout period. > > Signed-off-by: Ivan Khoronzhuk > Acked-by: Santosh Shilimkar > Reviewed-by: Guenter Roeck So this still causes a regression because the clk_get() fails due to the changed device name. Please fold this patch in (tested on DM365, compiled on rest). Also, the change in device name (while needed) does not seem to be related to usage of wdt core. Can you may be split that change into a separate patch? Thanks, Sekhar ---8<--- diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c index 0813b51..82c6013 100644 --- a/arch/arm/mach-davinci/da830.c +++ b/arch/arm/mach-davinci/da830.c @@ -385,7 +385,7 @@ static struct clk_lookup da830_clks[] = { CLK(NULL, "pll0_sysclk7", _sysclk7), CLK("i2c_davinci.1",NULL, _clk), CLK(NULL, "timer0", _0_clk), - CLK("watchdog", NULL, _1_clk), + CLK("davinci-wdt", NULL, _1_clk), CLK(NULL, "arm_rom", _rom_clk), CLK(NULL, "scr0_ss", _ss_clk), CLK(NULL, "scr1_ss", _ss_clk), diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 352984e..ccb2f58 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -443,7 +443,7 @@ static struct clk_lookup da850_clks[] = { CLK(NULL, "pll1_sysclk3", _sysclk3), CLK("i2c_davinci.1",NULL, _clk), CLK(NULL, "timer0", _0_clk), - CLK("watchdog", NULL, _1_clk), + CLK("davinci-wdt", NULL, _1_clk), CLK(NULL, "arm_rom", _rom_clk), CLK(NULL, "tpcc0",_clk), CLK(NULL, "tptc0",_clk), diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index ef9ff1f..4bb8132 100644 --- a/arch/arm/mach-davinci/dm355.c +++ b/arch/arm/mach-davinci/dm355.c @@ -375,7 +375,7 @@ static struct clk_lookup dm355_clks[] = { CLK(NULL, "pwm3", _clk), CLK(NULL, "timer0", _clk), CLK(NULL, "timer1", _clk), - CLK("watchdog", NULL, _clk), + CLK("davinci-wdt", NULL, _clk), CLK(NULL, "timer3", _clk), CLK(NULL, "rto", _clk), CLK(NULL, "usb", _clk), diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 1511a06..b0e8df3 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c @@ -473,7 +473,7 @@ static struct clk_lookup dm365_clks[] = { CLK(NULL, "pwm3", _clk), CLK(NULL, "timer0", _clk), CLK(NULL, "timer1", _clk), - CLK("watchdog", NULL, _clk), + CLK("davinci-wdt", NULL, _clk), CLK(NULL, "timer3", _clk), CLK(NULL, "usb", _clk), CLK("davinci_emac.1", NULL, _clk), diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index 143a321..aeaad95 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c @@ -322,7 +322,7 @@ static struct clk_lookup dm644x_clks[] = { CLK(NULL, "pwm2", _clk), CLK(NULL, "timer0", _clk), CLK(NULL, "timer1", _clk), - CLK("watchdog", NULL, _clk), + CLK("davinci-wdt", NULL, _clk), CLK(NULL, NULL, NULL), }; diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index 2a73f29..a56779b 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c @@ -356,7 +356,7 @@ static struct clk_lookup dm646x_clks[] = { CLK(NULL, "pwm1", _clk), CLK(NULL, "timer0", _clk), CLK(NULL, "timer1", _clk), - CLK("watchdog", NULL, _clk), + CLK("davinci-wdt", NULL, _clk), CLK("palm_bk3710", NULL, _clk), CLK(NULL, "vpif0", _clk), CLK(NULL, "vpif1", _clk), -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 1/6] watchdog: davinci: change driver to use WDT core
On 11/26/2013 02:10 PM, Guenter Roeck wrote: On 11/26/2013 03:09 AM, Grygorii Strashko wrote: On 11/25/2013 04:04 PM, Ivan Khoronzhuk wrote: To reduce code duplicate and increase code readability use WDT core code to handle WDT interface. Remove io_lock as the WDT core uses mutex to lock each wdt device. Remove wdt_state as the WDT core tracks state with its own variable. The watchdog_init_timeout() can read timeout value from timeout-sec property if the passed value is out of bounds. The heartbeat is initialized in next way. If heartbeat is not set thought module parameter, try to read it's value from WDT node timeout-sec property. If node has no one, use default value. The heartbeat is hold in wdd->timeout by WDT core, so use it in order to set timeout period. Signed-off-by: Ivan Khoronzhuk Acked-by: Santosh Shilimkar Reviewed-by: Guenter Roeck --- arch/arm/mach-davinci/da8xx-dt.c |2 +- arch/arm/mach-davinci/devices-da8xx.c |4 +- arch/arm/mach-davinci/devices.c |2 +- drivers/watchdog/Kconfig |2 + drivers/watchdog/davinci_wdt.c| 151 - 5 files changed, 43 insertions(+), 118 deletions(-) Pls note, that this patch contains both changes in platform and driver code to fix regression reported by Sekhar Nori on v2 of this series and caused by driver name changing. Is it ok? It can be splitted, but then both patches will introduce regression by itself and thing will work only if both of them will be applied together. Splitting it would break bisect, even if applied together, so I don't think this would be a good idea. Thanks Regards, -grygorii -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 1/6] watchdog: davinci: change driver to use WDT core
On 11/26/2013 03:09 AM, Grygorii Strashko wrote: On 11/25/2013 04:04 PM, Ivan Khoronzhuk wrote: To reduce code duplicate and increase code readability use WDT core code to handle WDT interface. Remove io_lock as the WDT core uses mutex to lock each wdt device. Remove wdt_state as the WDT core tracks state with its own variable. The watchdog_init_timeout() can read timeout value from timeout-sec property if the passed value is out of bounds. The heartbeat is initialized in next way. If heartbeat is not set thought module parameter, try to read it's value from WDT node timeout-sec property. If node has no one, use default value. The heartbeat is hold in wdd->timeout by WDT core, so use it in order to set timeout period. Signed-off-by: Ivan Khoronzhuk Acked-by: Santosh Shilimkar Reviewed-by: Guenter Roeck --- arch/arm/mach-davinci/da8xx-dt.c |2 +- arch/arm/mach-davinci/devices-da8xx.c |4 +- arch/arm/mach-davinci/devices.c |2 +- drivers/watchdog/Kconfig |2 + drivers/watchdog/davinci_wdt.c| 151 - 5 files changed, 43 insertions(+), 118 deletions(-) Pls note, that this patch contains both changes in platform and driver code to fix regression reported by Sekhar Nori on v2 of this series and caused by driver name changing. Is it ok? It can be splitted, but then both patches will introduce regression by itself and thing will work only if both of them will be applied together. Splitting it would break bisect, even if applied together, so I don't think this would be a good idea. Guenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 1/6] watchdog: davinci: change driver to use WDT core
On 11/25/2013 04:04 PM, Ivan Khoronzhuk wrote: To reduce code duplicate and increase code readability use WDT core code to handle WDT interface. Remove io_lock as the WDT core uses mutex to lock each wdt device. Remove wdt_state as the WDT core tracks state with its own variable. The watchdog_init_timeout() can read timeout value from timeout-sec property if the passed value is out of bounds. The heartbeat is initialized in next way. If heartbeat is not set thought module parameter, try to read it's value from WDT node timeout-sec property. If node has no one, use default value. The heartbeat is hold in wdd->timeout by WDT core, so use it in order to set timeout period. Signed-off-by: Ivan Khoronzhuk Acked-by: Santosh Shilimkar Reviewed-by: Guenter Roeck --- arch/arm/mach-davinci/da8xx-dt.c |2 +- arch/arm/mach-davinci/devices-da8xx.c |4 +- arch/arm/mach-davinci/devices.c |2 +- drivers/watchdog/Kconfig |2 + drivers/watchdog/davinci_wdt.c| 151 - 5 files changed, 43 insertions(+), 118 deletions(-) Pls note, that this patch contains both changes in platform and driver code to fix regression reported by Sekhar Nori on v2 of this series and caused by driver name changing. Is it ok? It can be splitted, but then both patches will introduce regression by itself and thing will work only if both of them will be applied together. diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c index d2bc574..ed19287 100644 [...] -MODULE_ALIAS("platform:watchdog"); +MODULE_ALIAS("platform:davinci-wdt"); Regards, -Grygorii -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 1/6] watchdog: davinci: change driver to use WDT core
On 11/25/2013 04:04 PM, Ivan Khoronzhuk wrote: To reduce code duplicate and increase code readability use WDT core code to handle WDT interface. Remove io_lock as the WDT core uses mutex to lock each wdt device. Remove wdt_state as the WDT core tracks state with its own variable. The watchdog_init_timeout() can read timeout value from timeout-sec property if the passed value is out of bounds. The heartbeat is initialized in next way. If heartbeat is not set thought module parameter, try to read it's value from WDT node timeout-sec property. If node has no one, use default value. The heartbeat is hold in wdd-timeout by WDT core, so use it in order to set timeout period. Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com Acked-by: Santosh Shilimkar santosh.shilim...@ti.com Reviewed-by: Guenter Roeck li...@roeck-us.net --- arch/arm/mach-davinci/da8xx-dt.c |2 +- arch/arm/mach-davinci/devices-da8xx.c |4 +- arch/arm/mach-davinci/devices.c |2 +- drivers/watchdog/Kconfig |2 + drivers/watchdog/davinci_wdt.c| 151 - 5 files changed, 43 insertions(+), 118 deletions(-) Pls note, that this patch contains both changes in platform and driver code to fix regression reported by Sekhar Nori on v2 of this series and caused by driver name changing. Is it ok? It can be splitted, but then both patches will introduce regression by itself and thing will work only if both of them will be applied together. diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c index d2bc574..ed19287 100644 [...] -MODULE_ALIAS(platform:watchdog); +MODULE_ALIAS(platform:davinci-wdt); Regards, -Grygorii -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 1/6] watchdog: davinci: change driver to use WDT core
On 11/26/2013 03:09 AM, Grygorii Strashko wrote: On 11/25/2013 04:04 PM, Ivan Khoronzhuk wrote: To reduce code duplicate and increase code readability use WDT core code to handle WDT interface. Remove io_lock as the WDT core uses mutex to lock each wdt device. Remove wdt_state as the WDT core tracks state with its own variable. The watchdog_init_timeout() can read timeout value from timeout-sec property if the passed value is out of bounds. The heartbeat is initialized in next way. If heartbeat is not set thought module parameter, try to read it's value from WDT node timeout-sec property. If node has no one, use default value. The heartbeat is hold in wdd-timeout by WDT core, so use it in order to set timeout period. Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com Acked-by: Santosh Shilimkar santosh.shilim...@ti.com Reviewed-by: Guenter Roeck li...@roeck-us.net --- arch/arm/mach-davinci/da8xx-dt.c |2 +- arch/arm/mach-davinci/devices-da8xx.c |4 +- arch/arm/mach-davinci/devices.c |2 +- drivers/watchdog/Kconfig |2 + drivers/watchdog/davinci_wdt.c| 151 - 5 files changed, 43 insertions(+), 118 deletions(-) Pls note, that this patch contains both changes in platform and driver code to fix regression reported by Sekhar Nori on v2 of this series and caused by driver name changing. Is it ok? It can be splitted, but then both patches will introduce regression by itself and thing will work only if both of them will be applied together. Splitting it would break bisect, even if applied together, so I don't think this would be a good idea. Guenter -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 1/6] watchdog: davinci: change driver to use WDT core
On 11/26/2013 02:10 PM, Guenter Roeck wrote: On 11/26/2013 03:09 AM, Grygorii Strashko wrote: On 11/25/2013 04:04 PM, Ivan Khoronzhuk wrote: To reduce code duplicate and increase code readability use WDT core code to handle WDT interface. Remove io_lock as the WDT core uses mutex to lock each wdt device. Remove wdt_state as the WDT core tracks state with its own variable. The watchdog_init_timeout() can read timeout value from timeout-sec property if the passed value is out of bounds. The heartbeat is initialized in next way. If heartbeat is not set thought module parameter, try to read it's value from WDT node timeout-sec property. If node has no one, use default value. The heartbeat is hold in wdd-timeout by WDT core, so use it in order to set timeout period. Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com Acked-by: Santosh Shilimkar santosh.shilim...@ti.com Reviewed-by: Guenter Roeck li...@roeck-us.net --- arch/arm/mach-davinci/da8xx-dt.c |2 +- arch/arm/mach-davinci/devices-da8xx.c |4 +- arch/arm/mach-davinci/devices.c |2 +- drivers/watchdog/Kconfig |2 + drivers/watchdog/davinci_wdt.c| 151 - 5 files changed, 43 insertions(+), 118 deletions(-) Pls note, that this patch contains both changes in platform and driver code to fix regression reported by Sekhar Nori on v2 of this series and caused by driver name changing. Is it ok? It can be splitted, but then both patches will introduce regression by itself and thing will work only if both of them will be applied together. Splitting it would break bisect, even if applied together, so I don't think this would be a good idea. Thanks Regards, -grygorii -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 1/6] watchdog: davinci: change driver to use WDT core
On Monday 25 November 2013 07:34 PM, Ivan Khoronzhuk wrote: To reduce code duplicate and increase code readability use WDT core code to handle WDT interface. Remove io_lock as the WDT core uses mutex to lock each wdt device. Remove wdt_state as the WDT core tracks state with its own variable. The watchdog_init_timeout() can read timeout value from timeout-sec property if the passed value is out of bounds. The heartbeat is initialized in next way. If heartbeat is not set thought module parameter, try to read it's value from WDT node timeout-sec property. If node has no one, use default value. The heartbeat is hold in wdd-timeout by WDT core, so use it in order to set timeout period. Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com Acked-by: Santosh Shilimkar santosh.shilim...@ti.com Reviewed-by: Guenter Roeck li...@roeck-us.net So this still causes a regression because the clk_get() fails due to the changed device name. Please fold this patch in (tested on DM365, compiled on rest). Also, the change in device name (while needed) does not seem to be related to usage of wdt core. Can you may be split that change into a separate patch? Thanks, Sekhar ---8--- diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c index 0813b51..82c6013 100644 --- a/arch/arm/mach-davinci/da830.c +++ b/arch/arm/mach-davinci/da830.c @@ -385,7 +385,7 @@ static struct clk_lookup da830_clks[] = { CLK(NULL, pll0_sysclk7, pll0_sysclk7), CLK(i2c_davinci.1,NULL, i2c0_clk), CLK(NULL, timer0, timerp64_0_clk), - CLK(watchdog, NULL, timerp64_1_clk), + CLK(davinci-wdt, NULL, timerp64_1_clk), CLK(NULL, arm_rom, arm_rom_clk), CLK(NULL, scr0_ss, scr0_ss_clk), CLK(NULL, scr1_ss, scr1_ss_clk), diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 352984e..ccb2f58 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -443,7 +443,7 @@ static struct clk_lookup da850_clks[] = { CLK(NULL, pll1_sysclk3, pll1_sysclk3), CLK(i2c_davinci.1,NULL, i2c0_clk), CLK(NULL, timer0, timerp64_0_clk), - CLK(watchdog, NULL, timerp64_1_clk), + CLK(davinci-wdt, NULL, timerp64_1_clk), CLK(NULL, arm_rom, arm_rom_clk), CLK(NULL, tpcc0,tpcc0_clk), CLK(NULL, tptc0,tptc0_clk), diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index ef9ff1f..4bb8132 100644 --- a/arch/arm/mach-davinci/dm355.c +++ b/arch/arm/mach-davinci/dm355.c @@ -375,7 +375,7 @@ static struct clk_lookup dm355_clks[] = { CLK(NULL, pwm3, pwm3_clk), CLK(NULL, timer0, timer0_clk), CLK(NULL, timer1, timer1_clk), - CLK(watchdog, NULL, timer2_clk), + CLK(davinci-wdt, NULL, timer2_clk), CLK(NULL, timer3, timer3_clk), CLK(NULL, rto, rto_clk), CLK(NULL, usb, usb_clk), diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 1511a06..b0e8df3 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c @@ -473,7 +473,7 @@ static struct clk_lookup dm365_clks[] = { CLK(NULL, pwm3, pwm3_clk), CLK(NULL, timer0, timer0_clk), CLK(NULL, timer1, timer1_clk), - CLK(watchdog, NULL, timer2_clk), + CLK(davinci-wdt, NULL, timer2_clk), CLK(NULL, timer3, timer3_clk), CLK(NULL, usb, usb_clk), CLK(davinci_emac.1, NULL, emac_clk), diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index 143a321..aeaad95 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c @@ -322,7 +322,7 @@ static struct clk_lookup dm644x_clks[] = { CLK(NULL, pwm2, pwm2_clk), CLK(NULL, timer0, timer0_clk), CLK(NULL, timer1, timer1_clk), - CLK(watchdog, NULL, timer2_clk), + CLK(davinci-wdt, NULL, timer2_clk), CLK(NULL, NULL, NULL), }; diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index 2a73f29..a56779b 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c @@ -356,7 +356,7 @@ static struct clk_lookup dm646x_clks[] = { CLK(NULL, pwm1, pwm1_clk), CLK(NULL, timer0, timer0_clk), CLK(NULL, timer1, timer1_clk), - CLK(watchdog, NULL, timer2_clk), + CLK(davinci-wdt, NULL, timer2_clk), CLK(palm_bk3710, NULL, ide_clk), CLK(NULL, vpif0, vpif0_clk), CLK(NULL, vpif1, vpif1_clk), -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ
Re: [PATCH v3 1/6] watchdog: davinci: change driver to use WDT core
On 11/26/2013 08:31 PM, Sekhar Nori wrote: On Monday 25 November 2013 07:34 PM, Ivan Khoronzhuk wrote: To reduce code duplicate and increase code readability use WDT core code to handle WDT interface. Remove io_lock as the WDT core uses mutex to lock each wdt device. Remove wdt_state as the WDT core tracks state with its own variable. The watchdog_init_timeout() can read timeout value from timeout-sec property if the passed value is out of bounds. The heartbeat is initialized in next way. If heartbeat is not set thought module parameter, try to read it's value from WDT node timeout-sec property. If node has no one, use default value. The heartbeat is hold in wdd-timeout by WDT core, so use it in order to set timeout period. Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com Acked-by: Santosh Shilimkar santosh.shilim...@ti.com Reviewed-by: Guenter Roeck li...@roeck-us.net So this still causes a regression because the clk_get() fails due to the changed device name. Please fold this patch in (tested on DM365, compiled on rest). Also, the change in device name (while needed) does not seem to be related to usage of wdt core. Can you may be split that change into a separate patch? Given all the trouble with it, I think that would be a good idea. Guenter -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 1/6] watchdog: davinci: change driver to use WDT core
On 11/25/2013 04:16 PM, Santosh Shilimkar wrote: Ivan, On Monday 25 November 2013 09:04 AM, Ivan Khoronzhuk wrote: To reduce code duplicate and increase code readability use WDT core code to handle WDT interface. Remove io_lock as the WDT core uses mutex to lock each wdt device. Remove wdt_state as the WDT core tracks state with its own variable. The watchdog_init_timeout() can read timeout value from timeout-sec property if the passed value is out of bounds. The heartbeat is initialized in next way. If heartbeat is not set thought module parameter, try to read it's value from WDT node timeout-sec property. If node has no one, use default value. The heartbeat is hold in wdd->timeout by WDT core, so use it in order to set timeout period. Signed-off-by: Ivan Khoronzhuk Acked-by: Santosh Shilimkar Reviewed-by: Guenter Roeck Minor suggestion regarding the SOB line which applies to rest of the series as well. Typically your SOB line should be the last one like below. Acked-by: Santosh Shilimkar Reviewed-by: Guenter Roeck Signed-off-by: Ivan Khoronzhuk No need to repost the series just for that. The last patch as I commented earlier, needs to be separate patch which will go via linux-keystone tree. Once the watchdog maintainer is happy with rest of the series and applies it, I will pick last patch. Regards, Santosh Thanks, Santosh I'll take note. -- Regards, Ivan Khoronzhuk -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 1/6] watchdog: davinci: change driver to use WDT core
Ivan, On Monday 25 November 2013 09:04 AM, Ivan Khoronzhuk wrote: > To reduce code duplicate and increase code readability use WDT core > code to handle WDT interface. > > Remove io_lock as the WDT core uses mutex to lock each wdt device. > Remove wdt_state as the WDT core tracks state with its own variable. > > The watchdog_init_timeout() can read timeout value from timeout-sec > property if the passed value is out of bounds. The heartbeat is > initialized in next way. If heartbeat is not set thought module > parameter, try to read it's value from WDT node timeout-sec property. > If node has no one, use default value. > > The heartbeat is hold in wdd->timeout by WDT core, so use it in > order to set timeout period. > > Signed-off-by: Ivan Khoronzhuk > Acked-by: Santosh Shilimkar > Reviewed-by: Guenter Roeck Minor suggestion regarding the SOB line which applies to rest of the series as well. Typically your SOB line should be the last one like below. Acked-by: Santosh Shilimkar Reviewed-by: Guenter Roeck Signed-off-by: Ivan Khoronzhuk No need to repost the series just for that. The last patch as I commented earlier, needs to be separate patch which will go via linux-keystone tree. Once the watchdog maintainer is happy with rest of the series and applies it, I will pick last patch. Regards, Santosh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 1/6] watchdog: davinci: change driver to use WDT core
To reduce code duplicate and increase code readability use WDT core code to handle WDT interface. Remove io_lock as the WDT core uses mutex to lock each wdt device. Remove wdt_state as the WDT core tracks state with its own variable. The watchdog_init_timeout() can read timeout value from timeout-sec property if the passed value is out of bounds. The heartbeat is initialized in next way. If heartbeat is not set thought module parameter, try to read it's value from WDT node timeout-sec property. If node has no one, use default value. The heartbeat is hold in wdd->timeout by WDT core, so use it in order to set timeout period. Signed-off-by: Ivan Khoronzhuk Acked-by: Santosh Shilimkar Reviewed-by: Guenter Roeck --- arch/arm/mach-davinci/da8xx-dt.c |2 +- arch/arm/mach-davinci/devices-da8xx.c |4 +- arch/arm/mach-davinci/devices.c |2 +- drivers/watchdog/Kconfig |2 + drivers/watchdog/davinci_wdt.c| 151 - 5 files changed, 43 insertions(+), 118 deletions(-) diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c index d2bc574..ed19287 100644 --- a/arch/arm/mach-davinci/da8xx-dt.c +++ b/arch/arm/mach-davinci/da8xx-dt.c @@ -32,7 +32,7 @@ static void __init da8xx_init_irq(void) static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = { OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL), - OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL), + OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "davinci-wdt", NULL), OF_DEV_AUXDATA("ti,da830-mmc", 0x01c4, "da830-mmc.0", NULL), OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f0, "ehrpwm", NULL), OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f02000, "ehrpwm", NULL), diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index c46eccb..f9ba74b 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -389,7 +389,7 @@ static struct resource da8xx_watchdog_resources[] = { }; static struct platform_device da8xx_wdt_device = { - .name = "watchdog", + .name = "davinci-wdt", .id = -1, .num_resources = ARRAY_SIZE(da8xx_watchdog_resources), .resource = da8xx_watchdog_resources, @@ -399,7 +399,7 @@ void da8xx_restart(enum reboot_mode mode, const char *cmd) { struct device *dev; - dev = bus_find_device_by_name(_bus_type, NULL, "watchdog"); + dev = bus_find_device_by_name(_bus_type, NULL, "davinci-wdt"); if (!dev) { pr_err("%s: failed to find watchdog device\n", __func__); return; diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c index 3996e98..5cf9a02 100644 --- a/arch/arm/mach-davinci/devices.c +++ b/arch/arm/mach-davinci/devices.c @@ -302,7 +302,7 @@ static struct resource wdt_resources[] = { }; struct platform_device davinci_wdt_device = { - .name = "watchdog", + .name = "davinci-wdt", .id = -1, .num_resources = ARRAY_SIZE(wdt_resources), .resource = wdt_resources, diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 5be6e91..eb8c89d 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -271,6 +271,8 @@ config IOP_WATCHDOG config DAVINCI_WATCHDOG tristate "DaVinci watchdog" depends on ARCH_DAVINCI + select WATCHDOG_CORE + select WATCHDOG_NOWAYOUT help Say Y here if to include support for the watchdog timer in the DaVinci DM644x/DM646x processors. diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c index dd625cc..2a94dde 100644 --- a/drivers/watchdog/davinci_wdt.c +++ b/drivers/watchdog/davinci_wdt.c @@ -3,7 +3,7 @@ * * Watchdog driver for DaVinci DM644x/DM646x processors * - * Copyright (C) 2006 Texas Instruments. + * Copyright (C) 2006-2013 Texas Instruments. * * 2007 (c) MontaVista Software, Inc. This file is licensed under * the terms of the GNU General Public License version 2. This program @@ -15,18 +15,12 @@ #include #include #include -#include -#include #include #include -#include #include -#include -#include #include #include #include -#include #include #define MODULE_NAME "DAVINCI-WDT: " @@ -61,31 +55,12 @@ #define WDKEY_SEQ0 (0xa5c6 << 16) #define WDKEY_SEQ1 (0xda7e << 16) -static int heartbeat = DEFAULT_HEARTBEAT; - -static DEFINE_SPINLOCK(io_lock); -static unsigned long wdt_status; -#define WDT_IN_USE0 -#define WDT_OK_TO_CLOSE 1 -#define WDT_REGION_INITED 2 -#define WDT_DEVICE_INITED 3 - +static int heartbeat; static void __iomem*wdt_base; struct clk *wdt_clk; +static struct watchdog_device wdt_wdd; -static void wdt_service(void) -{ -
[PATCH v3 1/6] watchdog: davinci: change driver to use WDT core
To reduce code duplicate and increase code readability use WDT core code to handle WDT interface. Remove io_lock as the WDT core uses mutex to lock each wdt device. Remove wdt_state as the WDT core tracks state with its own variable. The watchdog_init_timeout() can read timeout value from timeout-sec property if the passed value is out of bounds. The heartbeat is initialized in next way. If heartbeat is not set thought module parameter, try to read it's value from WDT node timeout-sec property. If node has no one, use default value. The heartbeat is hold in wdd-timeout by WDT core, so use it in order to set timeout period. Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com Acked-by: Santosh Shilimkar santosh.shilim...@ti.com Reviewed-by: Guenter Roeck li...@roeck-us.net --- arch/arm/mach-davinci/da8xx-dt.c |2 +- arch/arm/mach-davinci/devices-da8xx.c |4 +- arch/arm/mach-davinci/devices.c |2 +- drivers/watchdog/Kconfig |2 + drivers/watchdog/davinci_wdt.c| 151 - 5 files changed, 43 insertions(+), 118 deletions(-) diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c index d2bc574..ed19287 100644 --- a/arch/arm/mach-davinci/da8xx-dt.c +++ b/arch/arm/mach-davinci/da8xx-dt.c @@ -32,7 +32,7 @@ static void __init da8xx_init_irq(void) static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = { OF_DEV_AUXDATA(ti,davinci-i2c, 0x01c22000, i2c_davinci.1, NULL), - OF_DEV_AUXDATA(ti,davinci-wdt, 0x01c21000, watchdog, NULL), + OF_DEV_AUXDATA(ti,davinci-wdt, 0x01c21000, davinci-wdt, NULL), OF_DEV_AUXDATA(ti,da830-mmc, 0x01c4, da830-mmc.0, NULL), OF_DEV_AUXDATA(ti,da850-ehrpwm, 0x01f0, ehrpwm, NULL), OF_DEV_AUXDATA(ti,da850-ehrpwm, 0x01f02000, ehrpwm, NULL), diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index c46eccb..f9ba74b 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -389,7 +389,7 @@ static struct resource da8xx_watchdog_resources[] = { }; static struct platform_device da8xx_wdt_device = { - .name = watchdog, + .name = davinci-wdt, .id = -1, .num_resources = ARRAY_SIZE(da8xx_watchdog_resources), .resource = da8xx_watchdog_resources, @@ -399,7 +399,7 @@ void da8xx_restart(enum reboot_mode mode, const char *cmd) { struct device *dev; - dev = bus_find_device_by_name(platform_bus_type, NULL, watchdog); + dev = bus_find_device_by_name(platform_bus_type, NULL, davinci-wdt); if (!dev) { pr_err(%s: failed to find watchdog device\n, __func__); return; diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c index 3996e98..5cf9a02 100644 --- a/arch/arm/mach-davinci/devices.c +++ b/arch/arm/mach-davinci/devices.c @@ -302,7 +302,7 @@ static struct resource wdt_resources[] = { }; struct platform_device davinci_wdt_device = { - .name = watchdog, + .name = davinci-wdt, .id = -1, .num_resources = ARRAY_SIZE(wdt_resources), .resource = wdt_resources, diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 5be6e91..eb8c89d 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -271,6 +271,8 @@ config IOP_WATCHDOG config DAVINCI_WATCHDOG tristate DaVinci watchdog depends on ARCH_DAVINCI + select WATCHDOG_CORE + select WATCHDOG_NOWAYOUT help Say Y here if to include support for the watchdog timer in the DaVinci DM644x/DM646x processors. diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c index dd625cc..2a94dde 100644 --- a/drivers/watchdog/davinci_wdt.c +++ b/drivers/watchdog/davinci_wdt.c @@ -3,7 +3,7 @@ * * Watchdog driver for DaVinci DM644x/DM646x processors * - * Copyright (C) 2006 Texas Instruments. + * Copyright (C) 2006-2013 Texas Instruments. * * 2007 (c) MontaVista Software, Inc. This file is licensed under * the terms of the GNU General Public License version 2. This program @@ -15,18 +15,12 @@ #include linux/moduleparam.h #include linux/types.h #include linux/kernel.h -#include linux/fs.h -#include linux/miscdevice.h #include linux/watchdog.h #include linux/init.h -#include linux/bitops.h #include linux/platform_device.h -#include linux/spinlock.h -#include linux/uaccess.h #include linux/io.h #include linux/device.h #include linux/clk.h -#include linux/slab.h #include linux/err.h #define MODULE_NAME DAVINCI-WDT: @@ -61,31 +55,12 @@ #define WDKEY_SEQ0 (0xa5c6 16) #define WDKEY_SEQ1 (0xda7e 16) -static int heartbeat = DEFAULT_HEARTBEAT; - -static DEFINE_SPINLOCK(io_lock); -static unsigned long wdt_status; -#define WDT_IN_USE0 -#define
Re: [PATCH v3 1/6] watchdog: davinci: change driver to use WDT core
Ivan, On Monday 25 November 2013 09:04 AM, Ivan Khoronzhuk wrote: To reduce code duplicate and increase code readability use WDT core code to handle WDT interface. Remove io_lock as the WDT core uses mutex to lock each wdt device. Remove wdt_state as the WDT core tracks state with its own variable. The watchdog_init_timeout() can read timeout value from timeout-sec property if the passed value is out of bounds. The heartbeat is initialized in next way. If heartbeat is not set thought module parameter, try to read it's value from WDT node timeout-sec property. If node has no one, use default value. The heartbeat is hold in wdd-timeout by WDT core, so use it in order to set timeout period. Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com Acked-by: Santosh Shilimkar santosh.shilim...@ti.com Reviewed-by: Guenter Roeck li...@roeck-us.net Minor suggestion regarding the SOB line which applies to rest of the series as well. Typically your SOB line should be the last one like below. Acked-by: Santosh Shilimkar santosh.shilim...@ti.com Reviewed-by: Guenter Roeck li...@roeck-us.net Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com No need to repost the series just for that. The last patch as I commented earlier, needs to be separate patch which will go via linux-keystone tree. Once the watchdog maintainer is happy with rest of the series and applies it, I will pick last patch. Regards, Santosh -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 1/6] watchdog: davinci: change driver to use WDT core
On 11/25/2013 04:16 PM, Santosh Shilimkar wrote: Ivan, On Monday 25 November 2013 09:04 AM, Ivan Khoronzhuk wrote: To reduce code duplicate and increase code readability use WDT core code to handle WDT interface. Remove io_lock as the WDT core uses mutex to lock each wdt device. Remove wdt_state as the WDT core tracks state with its own variable. The watchdog_init_timeout() can read timeout value from timeout-sec property if the passed value is out of bounds. The heartbeat is initialized in next way. If heartbeat is not set thought module parameter, try to read it's value from WDT node timeout-sec property. If node has no one, use default value. The heartbeat is hold in wdd-timeout by WDT core, so use it in order to set timeout period. Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com Acked-by: Santosh Shilimkar santosh.shilim...@ti.com Reviewed-by: Guenter Roeck li...@roeck-us.net Minor suggestion regarding the SOB line which applies to rest of the series as well. Typically your SOB line should be the last one like below. Acked-by: Santosh Shilimkar santosh.shilim...@ti.com Reviewed-by: Guenter Roeck li...@roeck-us.net Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com No need to repost the series just for that. The last patch as I commented earlier, needs to be separate patch which will go via linux-keystone tree. Once the watchdog maintainer is happy with rest of the series and applies it, I will pick last patch. Regards, Santosh Thanks, Santosh I'll take note. -- Regards, Ivan Khoronzhuk -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/