linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/69] clocksource/drivers/mtk_timer: Add pr_fmt define
       [not found] <5672CB9E.7090707@linaro.org>
@ 2015-12-18 14:17 ` Daniel Lezcano
  2015-12-18 14:17   ` [PATCH 02/69] clocksource/drivers/mtk_timer: Fix pr_warn() messages in mtk_timer_init Daniel Lezcano
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Alexey Klimov,
	Matthias Brugger, moderated list:ARM/Mediatek SoC...

From: Alexey Klimov <alexey.klimov@linaro.org>

It's a bit unclear what subsystem/driver emits some messages to dmesg in
the function mtk_init_timer(). Use pr_fmt to auto-prefix the messages
appropriately.

Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/mtk_timer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
index fbfc746..8f99cd7 100644
--- a/drivers/clocksource/mtk_timer.c
+++ b/drivers/clocksource/mtk_timer.c
@@ -16,6 +16,8 @@
  * GNU General Public License for more details.
  */
 
+#define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
+
 #include <linux/clk.h>
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
-- 
1.9.1

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

* [PATCH 02/69] clocksource/drivers/mtk_timer: Fix pr_warn() messages in mtk_timer_init
  2015-12-18 14:17 ` [PATCH 01/69] clocksource/drivers/mtk_timer: Add pr_fmt define Daniel Lezcano
@ 2015-12-18 14:17   ` Daniel Lezcano
  2015-12-30 18:15     ` Matthias Brugger
  2015-12-18 14:17   ` [PATCH 03/69] clocksource/drivers/mtk_timer: Fix memleak in mtk_timer_init() Daniel Lezcano
       [not found]   ` <1450448302-27429-1-git-send-email-daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
  2 siblings, 1 reply; 6+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, moderated list:ARM/Mediatek SoC...,
	Matthias Brugger, mingo, linux-arm-kernel, Alexey Klimov

From: Alexey Klimov <alexey.klimov@linaro.org>

1) Change pr_warn()s to pr_err()s. These messages are actually errors and not
   warnings.
2) Add missing \n.
3) Error message for kzalloc() failure is removed per suggestion by Joe Perches.
   There is generic stack_dump() for allocation issues.

Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/mtk_timer.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
index 8f99cd7..e1e0642 100644
--- a/drivers/clocksource/mtk_timer.c
+++ b/drivers/clocksource/mtk_timer.c
@@ -189,10 +189,8 @@ static void __init mtk_timer_init(struct device_node *node)
 	struct clk *clk;
 
 	evt = kzalloc(sizeof(*evt), GFP_KERNEL);
-	if (!evt) {
-		pr_warn("Can't allocate mtk clock event driver struct");
+	if (!evt)
 		return;
-	}
 
 	evt->dev.name = "mtk_tick";
 	evt->dev.rating = 300;
@@ -206,31 +204,31 @@ static void __init mtk_timer_init(struct device_node *node)
 
 	evt->gpt_base = of_io_request_and_map(node, 0, "mtk-timer");
 	if (IS_ERR(evt->gpt_base)) {
-		pr_warn("Can't get resource\n");
+		pr_err("Can't get resource\n");
 		return;
 	}
 
 	evt->dev.irq = irq_of_parse_and_map(node, 0);
 	if (evt->dev.irq <= 0) {
-		pr_warn("Can't parse IRQ");
+		pr_err("Can't parse IRQ\n");
 		goto err_mem;
 	}
 
 	clk = of_clk_get(node, 0);
 	if (IS_ERR(clk)) {
-		pr_warn("Can't get timer clock");
+		pr_err("Can't get timer clock\n");
 		goto err_irq;
 	}
 
 	if (clk_prepare_enable(clk)) {
-		pr_warn("Can't prepare clock");
+		pr_err("Can't prepare clock\n");
 		goto err_clk_put;
 	}
 	rate = clk_get_rate(clk);
 
 	if (request_irq(evt->dev.irq, mtk_timer_interrupt,
 			IRQF_TIMER | IRQF_IRQPOLL, "mtk_timer", evt)) {
-		pr_warn("failed to setup irq %d\n", evt->dev.irq);
+		pr_err("failed to setup irq %d\n", evt->dev.irq);
 		goto err_clk_disable;
 	}
 
-- 
1.9.1

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

* [PATCH 03/69] clocksource/drivers/mtk_timer: Fix memleak in mtk_timer_init()
  2015-12-18 14:17 ` [PATCH 01/69] clocksource/drivers/mtk_timer: Add pr_fmt define Daniel Lezcano
  2015-12-18 14:17   ` [PATCH 02/69] clocksource/drivers/mtk_timer: Fix pr_warn() messages in mtk_timer_init Daniel Lezcano
@ 2015-12-18 14:17   ` Daniel Lezcano
       [not found]   ` <1450448302-27429-1-git-send-email-daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
  2 siblings, 0 replies; 6+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Alexey Klimov,
	Matthias Brugger, moderated list:ARM/Mediatek SoC...

From: Alexey Klimov <alexey.klimov@linaro.org>

Add error path to clear evt struct allocated by kzalloc() in the beginning of
function mtk_timer_init().

Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/mtk_timer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
index e1e0642..d67bc35 100644
--- a/drivers/clocksource/mtk_timer.c
+++ b/drivers/clocksource/mtk_timer.c
@@ -205,7 +205,7 @@ static void __init mtk_timer_init(struct device_node *node)
 	evt->gpt_base = of_io_request_and_map(node, 0, "mtk-timer");
 	if (IS_ERR(evt->gpt_base)) {
 		pr_err("Can't get resource\n");
-		return;
+		goto err_kzalloc;
 	}
 
 	evt->dev.irq = irq_of_parse_and_map(node, 0);
@@ -260,5 +260,7 @@ err_mem:
 	iounmap(evt->gpt_base);
 	of_address_to_resource(node, 0, &res);
 	release_mem_region(res.start, resource_size(&res));
+err_kzalloc:
+	kfree(evt);
 }
 CLOCKSOURCE_OF_DECLARE(mtk_mt6577, "mediatek,mt6577-timer", mtk_timer_init);
-- 
1.9.1

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

* [PATCH 15/69] clocksource/drivers/mediatek: Add the COMPILE_TEST option
       [not found]   ` <1450448302-27429-1-git-send-email-daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
@ 2015-12-18 14:17     ` Daniel Lezcano
  2015-12-30 18:16       ` Matthias Brugger
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Lezcano @ 2015-12-18 14:17 UTC (permalink / raw)
  To: tglx-hfZtesqFncYOwBW4kG4KsQ
  Cc: Matthias Brugger, moderated list:ARM/Mediatek SoC...,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	mingo-DgEjT+Ai2ygdnm+yROfE0A

Increase the compilation test coverage by adding the COMPILE_TEST option.

Signed-off-by: Daniel Lezcano <daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 96a34dc..3ba43f6 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -228,9 +228,11 @@ config SYS_SUPPORTS_SH_CMT
         bool
 
 config MTK_TIMER
+	bool "Mediatek timer driver" if COMPILE_TEST
 	select CLKSRC_OF
 	select CLKSRC_MMIO
-	bool
+	help
+	  Support for Mediatek timer driver.
 
 config SYS_SUPPORTS_SH_MTU2
         bool
-- 
1.9.1

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

* Re: [PATCH 02/69] clocksource/drivers/mtk_timer: Fix pr_warn() messages in mtk_timer_init
  2015-12-18 14:17   ` [PATCH 02/69] clocksource/drivers/mtk_timer: Fix pr_warn() messages in mtk_timer_init Daniel Lezcano
@ 2015-12-30 18:15     ` Matthias Brugger
  0 siblings, 0 replies; 6+ messages in thread
From: Matthias Brugger @ 2015-12-30 18:15 UTC (permalink / raw)
  To: Daniel Lezcano, tglx
  Cc: linux-kernel, linux-arm-kernel, mingo, Alexey Klimov,
	moderated list:ARM/Mediatek SoC...



On 18/12/15 15:17, Daniel Lezcano wrote:
> From: Alexey Klimov <alexey.klimov@linaro.org>
>
> 1) Change pr_warn()s to pr_err()s. These messages are actually errors and not
>     warnings.
> 2) Add missing \n.
> 3) Error message for kzalloc() failure is removed per suggestion by Joe Perches.
>     There is generic stack_dump() for allocation issues.
>
> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---

Acked-by: Matthias Brugger <matthias.bgg@gmail.com>

>   drivers/clocksource/mtk_timer.c | 14 ++++++--------
>   1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
> index 8f99cd7..e1e0642 100644
> --- a/drivers/clocksource/mtk_timer.c
> +++ b/drivers/clocksource/mtk_timer.c
> @@ -189,10 +189,8 @@ static void __init mtk_timer_init(struct device_node *node)
>   	struct clk *clk;
>
>   	evt = kzalloc(sizeof(*evt), GFP_KERNEL);
> -	if (!evt) {
> -		pr_warn("Can't allocate mtk clock event driver struct");
> +	if (!evt)
>   		return;
> -	}
>
>   	evt->dev.name = "mtk_tick";
>   	evt->dev.rating = 300;
> @@ -206,31 +204,31 @@ static void __init mtk_timer_init(struct device_node *node)
>
>   	evt->gpt_base = of_io_request_and_map(node, 0, "mtk-timer");
>   	if (IS_ERR(evt->gpt_base)) {
> -		pr_warn("Can't get resource\n");
> +		pr_err("Can't get resource\n");
>   		return;
>   	}
>
>   	evt->dev.irq = irq_of_parse_and_map(node, 0);
>   	if (evt->dev.irq <= 0) {
> -		pr_warn("Can't parse IRQ");
> +		pr_err("Can't parse IRQ\n");
>   		goto err_mem;
>   	}
>
>   	clk = of_clk_get(node, 0);
>   	if (IS_ERR(clk)) {
> -		pr_warn("Can't get timer clock");
> +		pr_err("Can't get timer clock\n");
>   		goto err_irq;
>   	}
>
>   	if (clk_prepare_enable(clk)) {
> -		pr_warn("Can't prepare clock");
> +		pr_err("Can't prepare clock\n");
>   		goto err_clk_put;
>   	}
>   	rate = clk_get_rate(clk);
>
>   	if (request_irq(evt->dev.irq, mtk_timer_interrupt,
>   			IRQF_TIMER | IRQF_IRQPOLL, "mtk_timer", evt)) {
> -		pr_warn("failed to setup irq %d\n", evt->dev.irq);
> +		pr_err("failed to setup irq %d\n", evt->dev.irq);
>   		goto err_clk_disable;
>   	}
>
>

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

* Re: [PATCH 15/69] clocksource/drivers/mediatek: Add the COMPILE_TEST option
  2015-12-18 14:17     ` [PATCH 15/69] clocksource/drivers/mediatek: Add the COMPILE_TEST option Daniel Lezcano
@ 2015-12-30 18:16       ` Matthias Brugger
  0 siblings, 0 replies; 6+ messages in thread
From: Matthias Brugger @ 2015-12-30 18:16 UTC (permalink / raw)
  To: Daniel Lezcano, tglx
  Cc: linux-kernel, linux-arm-kernel, mingo,
	moderated list:ARM/Mediatek SoC...



On 18/12/15 15:17, Daniel Lezcano wrote:
> Increase the compilation test coverage by adding the COMPILE_TEST option.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---

Acked-by: Matthias Brugger <matthias.bgg@gmail.com>

>   drivers/clocksource/Kconfig | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
> index 96a34dc..3ba43f6 100644
> --- a/drivers/clocksource/Kconfig
> +++ b/drivers/clocksource/Kconfig
> @@ -228,9 +228,11 @@ config SYS_SUPPORTS_SH_CMT
>           bool
>
>   config MTK_TIMER
> +	bool "Mediatek timer driver" if COMPILE_TEST
>   	select CLKSRC_OF
>   	select CLKSRC_MMIO
> -	bool
> +	help
> +	  Support for Mediatek timer driver.
>
>   config SYS_SUPPORTS_SH_MTU2
>           bool
>

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

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

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <5672CB9E.7090707@linaro.org>
2015-12-18 14:17 ` [PATCH 01/69] clocksource/drivers/mtk_timer: Add pr_fmt define Daniel Lezcano
2015-12-18 14:17   ` [PATCH 02/69] clocksource/drivers/mtk_timer: Fix pr_warn() messages in mtk_timer_init Daniel Lezcano
2015-12-30 18:15     ` Matthias Brugger
2015-12-18 14:17   ` [PATCH 03/69] clocksource/drivers/mtk_timer: Fix memleak in mtk_timer_init() Daniel Lezcano
     [not found]   ` <1450448302-27429-1-git-send-email-daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-12-18 14:17     ` [PATCH 15/69] clocksource/drivers/mediatek: Add the COMPILE_TEST option Daniel Lezcano
2015-12-30 18:16       ` Matthias Brugger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).