linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk-gate: fix bit # check in clk_register_gate()
@ 2014-12-24 14:43 Sergei Shtylyov
  2015-01-17 22:01 ` Mike Turquette
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2014-12-24 14:43 UTC (permalink / raw)
  To: mturquette, linux-kernel, sboyd; +Cc: linux-sh

In case CLK_GATE_HIWORD_MASK flag is passed to clk_register_gate(), the bit #
should be no higher than 15, however the corresponding check is obviously off-
by-one.

Fixes: 045779942c04 ("clk: gate: add CLK_GATE_HIWORD_MASK")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
The patch is against Linus' repo because the 'clk-fixes' branch  in  Mike
Turquette's 'linux.git' repo at Linaro seems very outdated. BTW, the repo
at kernel.org specified by the MAINTAINERS file doesn't seem to exist --
can something be done about that?

 drivers/clk/clk-gate.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux/drivers/clk/clk-gate.c
=================================--- linux.orig/drivers/clk/clk-gate.c
+++ linux/drivers/clk/clk-gate.c
@@ -128,7 +128,7 @@ struct clk *clk_register_gate(struct dev
 	struct clk_init_data init;
 
 	if (clk_gate_flags & CLK_GATE_HIWORD_MASK) {
-		if (bit_idx > 16) {
+		if (bit_idx > 15) {
 			pr_err("gate bit exceeds LOWORD field\n");
 			return ERR_PTR(-EINVAL);
 		}


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

* Re: [PATCH] clk-gate: fix bit # check in clk_register_gate()
  2014-12-24 14:43 [PATCH] clk-gate: fix bit # check in clk_register_gate() Sergei Shtylyov
@ 2015-01-17 22:01 ` Mike Turquette
  2015-01-17 22:06   ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Turquette @ 2015-01-17 22:01 UTC (permalink / raw)
  To: Sergei Shtylyov, linux-kernel, sboyd; +Cc: linux-sh

Quoting Sergei Shtylyov (2014-12-24 06:43:27)
> In case CLK_GATE_HIWORD_MASK flag is passed to clk_register_gate(), the bit #
> should be no higher than 15, however the corresponding check is obviously off-
> by-one.
> 
> Fixes: 045779942c04 ("clk: gate: add CLK_GATE_HIWORD_MASK")
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Applied to clk-next. Thanks! Is this causing a visible regression for
you? It is not a new bug so I'd prefer to send it though clk-next unless
something is blowing up on your end.

> 
> ---
> The patch is against Linus' repo because the 'clk-fixes' branch  in  Mike
> Turquette's 'linux.git' repo at Linaro seems very outdated. BTW, the repo
> at kernel.org specified by the MAINTAINERS file doesn't seem to exist --
> can something be done about that?

The clk-fixes branch at git.linaro.org is now updated and the clk tree
at git.kernel.org is also live. Blame the holidays.

For now they will mirror each other (and linux-next will continue to
reference the one at git.linaro.org until 3.19 is released).

Regards,
Mike

> 
>  drivers/clk/clk-gate.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux/drivers/clk/clk-gate.c
> =================================> --- linux.orig/drivers/clk/clk-gate.c
> +++ linux/drivers/clk/clk-gate.c
> @@ -128,7 +128,7 @@ struct clk *clk_register_gate(struct dev
>         struct clk_init_data init;
>  
>         if (clk_gate_flags & CLK_GATE_HIWORD_MASK) {
> -               if (bit_idx > 16) {
> +               if (bit_idx > 15) {
>                         pr_err("gate bit exceeds LOWORD field\n");
>                         return ERR_PTR(-EINVAL);
>                 }
> 

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

* Re: [PATCH] clk-gate: fix bit # check in clk_register_gate()
  2015-01-17 22:01 ` Mike Turquette
@ 2015-01-17 22:06   ` Sergei Shtylyov
  0 siblings, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2015-01-17 22:06 UTC (permalink / raw)
  To: Mike Turquette, linux-kernel, sboyd; +Cc: linux-sh

Hello.

On 01/18/2015 01:01 AM, Mike Turquette wrote:

>> In case CLK_GATE_HIWORD_MASK flag is passed to clk_register_gate(), the bit #
>> should be no higher than 15, however the corresponding check is obviously off-
>> by-one.

>> Fixes: 045779942c04 ("clk: gate: add CLK_GATE_HIWORD_MASK")
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

> Applied to clk-next. Thanks! Is this causing a visible regression for
> you? It is not a new bug so I'd prefer to send it though clk-next unless
> something is blowing up on your end.

    No, nothing, I don't even call this function (was using composite clock). 
Found by just looking at the code.

>> ---
>> The patch is against Linus' repo because the 'clk-fixes' branch  in  Mike
>> Turquette's 'linux.git' repo at Linaro seems very outdated. BTW, the repo
>> at kernel.org specified by the MAINTAINERS file doesn't seem to exist --
>> can something be done about that?

> The clk-fixes branch at git.linaro.org is now updated and the clk tree
> at git.kernel.org is also live. Blame the holidays.

> For now they will mirror each other (and linux-next will continue to
> reference the one at git.linaro.org until 3.19 is released).

    Thank you.

> Regards,
> Mike

WBR, Sergei


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

end of thread, other threads:[~2015-01-17 22:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-24 14:43 [PATCH] clk-gate: fix bit # check in clk_register_gate() Sergei Shtylyov
2015-01-17 22:01 ` Mike Turquette
2015-01-17 22:06   ` Sergei Shtylyov

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).