Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1587943 > unrolled thread
| Started by | Krzysztof Kozlowski <krzk@kernel.org> |
|---|---|
| First post | 2017-02-24 22:20 +0100 |
| Last post | 2017-02-24 23:00 +0100 |
| Articles | 8 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 1/7] watchdog: s3c2410: Use dev_dbg instead of pr_info Krzysztof Kozlowski <krzk@kernel.org> - 2017-02-24 22:20 +0100
[PATCH 4/7] watchdog: s3c2410: Add prefix to local function Krzysztof Kozlowski <krzk@kernel.org> - 2017-02-24 22:20 +0100
Re: [PATCH 4/7] watchdog: s3c2410: Add prefix to local function Guenter Roeck <linux@roeck-us.net> - 2017-02-24 23:00 +0100
[PATCH 3/7] watchdog: s3c2410: Enable COMPILE_TEST Krzysztof Kozlowski <krzk@kernel.org> - 2017-02-24 22:20 +0100
Re: [PATCH 3/7] watchdog: s3c2410: Enable COMPILE_TEST Guenter Roeck <linux@roeck-us.net> - 2017-02-24 23:00 +0100
[PATCH 2/7] watchdog: s3c2410: Select MFD_SYSCON on all Exynos platforms Krzysztof Kozlowski <krzk@kernel.org> - 2017-02-24 22:20 +0100
Re: [PATCH 2/7] watchdog: s3c2410: Select MFD_SYSCON on all Exynos platforms Guenter Roeck <linux@roeck-us.net> - 2017-02-24 23:00 +0100
Re: [PATCH 1/7] watchdog: s3c2410: Use dev_dbg instead of pr_info Guenter Roeck <linux@roeck-us.net> - 2017-02-24 23:00 +0100
| From | Krzysztof Kozlowski <krzk@kernel.org> |
|---|---|
| Date | 2017-02-24 22:20 +0100 |
| Subject | [PATCH 1/7] watchdog: s3c2410: Use dev_dbg instead of pr_info |
| Message-ID | <tevhL-5TR-3@gated-at.bofh.it> |
Replace the 'debug' module parameter and pr_info() with proper device
dynamic debug calls because this is the preferred and flexible way of
enabling debugging printks.
Also remove some obvious debug printks.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
drivers/watchdog/s3c2410_wdt.c | 29 ++++++-----------------------
1 file changed, 6 insertions(+), 23 deletions(-)
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
index 7db7847a005c..f7aad19d20ff 100644
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -23,8 +23,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
@@ -83,13 +81,11 @@ static bool nowayout = WATCHDOG_NOWAYOUT;
static int tmr_margin;
static int tmr_atboot = S3C2410_WATCHDOG_ATBOOT;
static int soft_noboot;
-static int debug;
module_param(tmr_margin, int, 0);
module_param(tmr_atboot, int, 0);
module_param(nowayout, bool, 0);
module_param(soft_noboot, int, 0);
-module_param(debug, int, 0);
MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. (default="
__MODULE_STRING(S3C2410_WATCHDOG_DEFAULT_TIME) ")");
@@ -100,7 +96,6 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
MODULE_PARM_DESC(soft_noboot, "Watchdog action, set to 1 to ignore reboots, "
"0 to reboot (default 0)");
-MODULE_PARM_DESC(debug, "Watchdog debug, set to >1 for debug (default 0)");
/**
* struct s3c2410_wdt_variant - Per-variant config data
@@ -204,14 +199,6 @@ static const struct platform_device_id s3c2410_wdt_ids[] = {
};
MODULE_DEVICE_TABLE(platform, s3c2410_wdt_ids);
-/* watchdog control routines */
-
-#define DBG(fmt, ...) \
-do { \
- if (debug) \
- pr_info(fmt, ##__VA_ARGS__); \
-} while (0)
-
/* functions */
static inline unsigned int s3c2410wdt_max_timeout(struct clk *clock)
@@ -307,8 +294,8 @@ static int s3c2410wdt_start(struct watchdog_device *wdd)
wtcon |= S3C2410_WTCON_RSTEN;
}
- DBG("%s: count=0x%08x, wtcon=%08lx\n",
- __func__, wdt->count, wtcon);
+ dev_dbg(wdt->dev, "Starting watchdog: count=0x%08x, wtcon=%08lx\n",
+ wdt->count, wtcon);
writel(wdt->count, wdt->reg_base + S3C2410_WTDAT);
writel(wdt->count, wdt->reg_base + S3C2410_WTCNT);
@@ -337,8 +324,8 @@ static int s3c2410wdt_set_heartbeat(struct watchdog_device *wdd, unsigned timeou
freq = DIV_ROUND_UP(freq, 128);
count = timeout * freq;
- DBG("%s: count=%d, timeout=%d, freq=%lu\n",
- __func__, count, timeout, freq);
+ dev_dbg(wdt->dev, "Heartbeat: count=%d, timeout=%d, freq=%lu\n",
+ count, timeout, freq);
/* if the count is bigger than the watchdog register,
then work out what we need to do (and if) we can
@@ -354,8 +341,8 @@ static int s3c2410wdt_set_heartbeat(struct watchdog_device *wdd, unsigned timeou
}
}
- DBG("%s: timeout=%d, divisor=%d, count=%d (%08x)\n",
- __func__, timeout, divisor, count, DIV_ROUND_UP(count, divisor));
+ dev_dbg(wdt->dev, "Heartbeat: timeout=%d, divisor=%d, count=%d (%08x)\n",
+ timeout, divisor, count, DIV_ROUND_UP(count, divisor));
count = DIV_ROUND_UP(count, divisor);
wdt->count = count;
@@ -544,8 +531,6 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
int started = 0;
int ret;
- DBG("%s: probe=%p\n", __func__, pdev);
-
dev = &pdev->dev;
wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
@@ -581,8 +566,6 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
goto err;
}
- DBG("probe: mapped reg_base=%p\n", wdt->reg_base);
-
wdt->clock = devm_clk_get(dev, "watchdog");
if (IS_ERR(wdt->clock)) {
dev_err(dev, "failed to find watchdog clock source\n");
--
2.9.3
[toc] | [next] | [standalone]
| From | Krzysztof Kozlowski <krzk@kernel.org> |
|---|---|
| Date | 2017-02-24 22:20 +0100 |
| Subject | [PATCH 4/7] watchdog: s3c2410: Add prefix to local function |
| Message-ID | <tevrr-5ZH-7@gated-at.bofh.it> |
| In reply to | #1587943 |
Functions marked static inline might not be inlined so a driver-specific
prefix for function name helps when looking through call backtrace.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
drivers/watchdog/s3c2410_wdt.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
index f7aad19d20ff..a031842ffcb0 100644
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -507,9 +507,8 @@ static inline unsigned int s3c2410wdt_get_bootstatus(struct s3c2410_wdt *wdt)
return 0;
}
-/* s3c2410_get_wdt_driver_data */
static inline struct s3c2410_wdt_variant *
-get_wdt_drv_data(struct platform_device *pdev)
+s3c2410_get_wdt_drv_data(struct platform_device *pdev)
{
if (pdev->dev.of_node) {
const struct of_device_id *match;
@@ -541,7 +540,7 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
spin_lock_init(&wdt->lock);
wdt->wdt_device = s3c2410_wdd;
- wdt->drv_data = get_wdt_drv_data(pdev);
+ wdt->drv_data = s3c2410_get_wdt_drv_data(pdev);
if (wdt->drv_data->quirks & QUIRKS_HAVE_PMUREG) {
wdt->pmureg = syscon_regmap_lookup_by_phandle(dev->of_node,
"samsung,syscon-phandle");
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2017-02-24 23:00 +0100 |
| Subject | Re: [PATCH 4/7] watchdog: s3c2410: Add prefix to local function |
| Message-ID | <tew49-6gV-1@gated-at.bofh.it> |
| In reply to | #1587946 |
On 02/24/2017 01:07 PM, Krzysztof Kozlowski wrote:
> Functions marked static inline might not be inlined so a driver-specific
> prefix for function name helps when looking through call backtrace.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/s3c2410_wdt.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
> index f7aad19d20ff..a031842ffcb0 100644
> --- a/drivers/watchdog/s3c2410_wdt.c
> +++ b/drivers/watchdog/s3c2410_wdt.c
> @@ -507,9 +507,8 @@ static inline unsigned int s3c2410wdt_get_bootstatus(struct s3c2410_wdt *wdt)
> return 0;
> }
>
> -/* s3c2410_get_wdt_driver_data */
> static inline struct s3c2410_wdt_variant *
> -get_wdt_drv_data(struct platform_device *pdev)
> +s3c2410_get_wdt_drv_data(struct platform_device *pdev)
> {
> if (pdev->dev.of_node) {
> const struct of_device_id *match;
> @@ -541,7 +540,7 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
> spin_lock_init(&wdt->lock);
> wdt->wdt_device = s3c2410_wdd;
>
> - wdt->drv_data = get_wdt_drv_data(pdev);
> + wdt->drv_data = s3c2410_get_wdt_drv_data(pdev);
> if (wdt->drv_data->quirks & QUIRKS_HAVE_PMUREG) {
> wdt->pmureg = syscon_regmap_lookup_by_phandle(dev->of_node,
> "samsung,syscon-phandle");
>
[toc] | [prev] | [next] | [standalone]
| From | Krzysztof Kozlowski <krzk@kernel.org> |
|---|---|
| Date | 2017-02-24 22:20 +0100 |
| Subject | [PATCH 3/7] watchdog: s3c2410: Enable COMPILE_TEST |
| Message-ID | <tevrr-5ZH-15@gated-at.bofh.it> |
| In reply to | #1587943 |
Driver can be compile tested on other architectures as well so use it to increase build coverage. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> --- drivers/watchdog/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 338c5bc46f73..82d5f07b5e64 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -333,7 +333,7 @@ config HAVE_S3C2410_WATCHDOG config S3C2410_WATCHDOG tristate "S3C2410 Watchdog" - depends on HAVE_S3C2410_WATCHDOG + depends on HAVE_S3C2410_WATCHDOG || COMPILE_TEST select WATCHDOG_CORE select MFD_SYSCON if ARCH_EXYNOS help -- 2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2017-02-24 23:00 +0100 |
| Subject | Re: [PATCH 3/7] watchdog: s3c2410: Enable COMPILE_TEST |
| Message-ID | <tew4a-6gV-21@gated-at.bofh.it> |
| In reply to | #1587947 |
On 02/24/2017 01:07 PM, Krzysztof Kozlowski wrote: > Driver can be compile tested on other architectures as well so use it to > increase build coverage. > > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Already submitted as part of 'watchdog: Enable COMPILE_TEST where possible'. > --- > drivers/watchdog/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig > index 338c5bc46f73..82d5f07b5e64 100644 > --- a/drivers/watchdog/Kconfig > +++ b/drivers/watchdog/Kconfig > @@ -333,7 +333,7 @@ config HAVE_S3C2410_WATCHDOG > > config S3C2410_WATCHDOG > tristate "S3C2410 Watchdog" > - depends on HAVE_S3C2410_WATCHDOG > + depends on HAVE_S3C2410_WATCHDOG || COMPILE_TEST > select WATCHDOG_CORE > select MFD_SYSCON if ARCH_EXYNOS > help >
[toc] | [prev] | [next] | [standalone]
| From | Krzysztof Kozlowski <krzk@kernel.org> |
|---|---|
| Date | 2017-02-24 22:20 +0100 |
| Subject | [PATCH 2/7] watchdog: s3c2410: Select MFD_SYSCON on all Exynos platforms |
| Message-ID | <tevrr-5ZH-17@gated-at.bofh.it> |
| In reply to | #1587943 |
Syscon is used not only on Exynos5 SoCs but also on Exynos3250, Exynos4412 and ARMv8 versions (Exynos5433, Exynos7). Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> --- drivers/watchdog/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index acb00b53a520..338c5bc46f73 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -335,7 +335,7 @@ config S3C2410_WATCHDOG tristate "S3C2410 Watchdog" depends on HAVE_S3C2410_WATCHDOG select WATCHDOG_CORE - select MFD_SYSCON if ARCH_EXYNOS5 + select MFD_SYSCON if ARCH_EXYNOS help Watchdog timer block in the Samsung SoCs. This will reboot the system when the timer expires with the watchdog enabled. -- 2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2017-02-24 23:00 +0100 |
| Subject | Re: [PATCH 2/7] watchdog: s3c2410: Select MFD_SYSCON on all Exynos platforms |
| Message-ID | <tew4a-6gV-25@gated-at.bofh.it> |
| In reply to | #1587948 |
On 02/24/2017 01:07 PM, Krzysztof Kozlowski wrote: > Syscon is used not only on Exynos5 SoCs but also on Exynos3250, > Exynos4412 and ARMv8 versions (Exynos5433, Exynos7). > > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> > --- > drivers/watchdog/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig > index acb00b53a520..338c5bc46f73 100644 > --- a/drivers/watchdog/Kconfig > +++ b/drivers/watchdog/Kconfig > @@ -335,7 +335,7 @@ config S3C2410_WATCHDOG > tristate "S3C2410 Watchdog" > depends on HAVE_S3C2410_WATCHDOG > select WATCHDOG_CORE > - select MFD_SYSCON if ARCH_EXYNOS5 > + select MFD_SYSCON if ARCH_EXYNOS > help > Watchdog timer block in the Samsung SoCs. This will reboot > the system when the timer expires with the watchdog enabled. >
[toc] | [prev] | [next] | [standalone]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2017-02-24 23:00 +0100 |
| Message-ID | <tew49-6gV-5@gated-at.bofh.it> |
| In reply to | #1587943 |
On 02/24/2017 01:07 PM, Krzysztof Kozlowski wrote:
> Replace the 'debug' module parameter and pr_info() with proper device
> dynamic debug calls because this is the preferred and flexible way of
> enabling debugging printks.
>
> Also remove some obvious debug printks.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/s3c2410_wdt.c | 29 ++++++-----------------------
> 1 file changed, 6 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
> index 7db7847a005c..f7aad19d20ff 100644
> --- a/drivers/watchdog/s3c2410_wdt.c
> +++ b/drivers/watchdog/s3c2410_wdt.c
> @@ -23,8 +23,6 @@
> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
> */
>
> -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> -
> #include <linux/module.h>
> #include <linux/moduleparam.h>
> #include <linux/types.h>
> @@ -83,13 +81,11 @@ static bool nowayout = WATCHDOG_NOWAYOUT;
> static int tmr_margin;
> static int tmr_atboot = S3C2410_WATCHDOG_ATBOOT;
> static int soft_noboot;
> -static int debug;
>
> module_param(tmr_margin, int, 0);
> module_param(tmr_atboot, int, 0);
> module_param(nowayout, bool, 0);
> module_param(soft_noboot, int, 0);
> -module_param(debug, int, 0);
>
> MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. (default="
> __MODULE_STRING(S3C2410_WATCHDOG_DEFAULT_TIME) ")");
> @@ -100,7 +96,6 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
> __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> MODULE_PARM_DESC(soft_noboot, "Watchdog action, set to 1 to ignore reboots, "
> "0 to reboot (default 0)");
> -MODULE_PARM_DESC(debug, "Watchdog debug, set to >1 for debug (default 0)");
>
> /**
> * struct s3c2410_wdt_variant - Per-variant config data
> @@ -204,14 +199,6 @@ static const struct platform_device_id s3c2410_wdt_ids[] = {
> };
> MODULE_DEVICE_TABLE(platform, s3c2410_wdt_ids);
>
> -/* watchdog control routines */
> -
> -#define DBG(fmt, ...) \
> -do { \
> - if (debug) \
> - pr_info(fmt, ##__VA_ARGS__); \
> -} while (0)
> -
> /* functions */
>
> static inline unsigned int s3c2410wdt_max_timeout(struct clk *clock)
> @@ -307,8 +294,8 @@ static int s3c2410wdt_start(struct watchdog_device *wdd)
> wtcon |= S3C2410_WTCON_RSTEN;
> }
>
> - DBG("%s: count=0x%08x, wtcon=%08lx\n",
> - __func__, wdt->count, wtcon);
> + dev_dbg(wdt->dev, "Starting watchdog: count=0x%08x, wtcon=%08lx\n",
> + wdt->count, wtcon);
>
> writel(wdt->count, wdt->reg_base + S3C2410_WTDAT);
> writel(wdt->count, wdt->reg_base + S3C2410_WTCNT);
> @@ -337,8 +324,8 @@ static int s3c2410wdt_set_heartbeat(struct watchdog_device *wdd, unsigned timeou
> freq = DIV_ROUND_UP(freq, 128);
> count = timeout * freq;
>
> - DBG("%s: count=%d, timeout=%d, freq=%lu\n",
> - __func__, count, timeout, freq);
> + dev_dbg(wdt->dev, "Heartbeat: count=%d, timeout=%d, freq=%lu\n",
> + count, timeout, freq);
>
> /* if the count is bigger than the watchdog register,
> then work out what we need to do (and if) we can
> @@ -354,8 +341,8 @@ static int s3c2410wdt_set_heartbeat(struct watchdog_device *wdd, unsigned timeou
> }
> }
>
> - DBG("%s: timeout=%d, divisor=%d, count=%d (%08x)\n",
> - __func__, timeout, divisor, count, DIV_ROUND_UP(count, divisor));
> + dev_dbg(wdt->dev, "Heartbeat: timeout=%d, divisor=%d, count=%d (%08x)\n",
> + timeout, divisor, count, DIV_ROUND_UP(count, divisor));
>
> count = DIV_ROUND_UP(count, divisor);
> wdt->count = count;
> @@ -544,8 +531,6 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
> int started = 0;
> int ret;
>
> - DBG("%s: probe=%p\n", __func__, pdev);
> -
> dev = &pdev->dev;
>
> wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
> @@ -581,8 +566,6 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
> goto err;
> }
>
> - DBG("probe: mapped reg_base=%p\n", wdt->reg_base);
> -
> wdt->clock = devm_clk_get(dev, "watchdog");
> if (IS_ERR(wdt->clock)) {
> dev_err(dev, "failed to find watchdog clock source\n");
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web