linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: clk: zynqmp: Allow zero divisor value
@ 2019-03-04 23:27 Jolly Shah
  2019-03-18 12:48 ` Michal Simek
  2019-04-11 18:32 ` Stephen Boyd
  0 siblings, 2 replies; 5+ messages in thread
From: Jolly Shah @ 2019-03-04 23:27 UTC (permalink / raw)
  To: mturquette, sboyd, michal.simek, linux-clk
  Cc: rajanv, linux-arm-kernel, linux-kernel, Rajan Vaja, Jolly Shah

From: Rajan Vaja <rajan.vaja@xilinx.com>

Zero divider is valid and default for some of ZynqMP
clocks. Allow zero divisor when CLK_DIVIDER_ALLOW_ZERO
for the clock is set.

Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
Signed-off-by: Jolly Shah <jollys@xilinx.com>
---
 drivers/clk/zynqmp/divider.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c
index a371c66..e146b6f 100644
--- a/drivers/clk/zynqmp/divider.c
+++ b/drivers/clk/zynqmp/divider.c
@@ -76,6 +76,13 @@ static unsigned long zynqmp_clk_divider_recalc_rate(struct clk_hw *hw,
 	else
 		value = div >> 16;
 
+	if (!value) {
+		WARN(!(divider->flags & CLK_DIVIDER_ALLOW_ZERO),
+		     "%s: Zero divisor and CLK_DIVIDER_ALLOW_ZERO not set\n",
+		     clk_name);
+		return parent_rate;
+	}
+
 	return DIV_ROUND_UP_ULL(parent_rate, value);
 }
 
-- 
2.7.4


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

* Re: [PATCH] drivers: clk: zynqmp: Allow zero divisor value
  2019-03-04 23:27 [PATCH] drivers: clk: zynqmp: Allow zero divisor value Jolly Shah
@ 2019-03-18 12:48 ` Michal Simek
  2019-03-18 19:42   ` Stephen Boyd
  2019-04-11 18:32 ` Stephen Boyd
  1 sibling, 1 reply; 5+ messages in thread
From: Michal Simek @ 2019-03-18 12:48 UTC (permalink / raw)
  To: Jolly Shah, mturquette, sboyd, michal.simek, linux-clk
  Cc: rajanv, linux-arm-kernel, linux-kernel, Rajan Vaja, Jolly Shah

On 05. 03. 19 0:27, Jolly Shah wrote:
> From: Rajan Vaja <rajan.vaja@xilinx.com>
> 
> Zero divider is valid and default for some of ZynqMP
> clocks. Allow zero divisor when CLK_DIVIDER_ALLOW_ZERO
> for the clock is set.
> 
> Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
> Signed-off-by: Jolly Shah <jollys@xilinx.com>
> ---
>  drivers/clk/zynqmp/divider.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c
> index a371c66..e146b6f 100644
> --- a/drivers/clk/zynqmp/divider.c
> +++ b/drivers/clk/zynqmp/divider.c
> @@ -76,6 +76,13 @@ static unsigned long zynqmp_clk_divider_recalc_rate(struct clk_hw *hw,
>  	else
>  		value = div >> 16;
>  
> +	if (!value) {
> +		WARN(!(divider->flags & CLK_DIVIDER_ALLOW_ZERO),
> +		     "%s: Zero divisor and CLK_DIVIDER_ALLOW_ZERO not set\n",
> +		     clk_name);
> +		return parent_rate;
> +	}
> +
>  	return DIV_ROUND_UP_ULL(parent_rate, value);
>  }
>  
> 

Stephen: Do you want to take it via your tree?

Thanks,
Michal


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

* Re: [PATCH] drivers: clk: zynqmp: Allow zero divisor value
  2019-03-18 12:48 ` Michal Simek
@ 2019-03-18 19:42   ` Stephen Boyd
  2019-03-19  7:19     ` Michal Simek
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Boyd @ 2019-03-18 19:42 UTC (permalink / raw)
  To: Jolly Shah, linux-clk, michal.simek, mturquette, sboyd
  Cc: rajanv, linux-arm-kernel, linux-kernel, Rajan Vaja, Jolly Shah

Quoting Michal Simek (2019-03-18 05:48:52)
> On 05. 03. 19 0:27, Jolly Shah wrote:
> > From: Rajan Vaja <rajan.vaja@xilinx.com>
> > 
> > Zero divider is valid and default for some of ZynqMP
> > clocks. Allow zero divisor when CLK_DIVIDER_ALLOW_ZERO
> > for the clock is set.
> > 
> > Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
> > Signed-off-by: Jolly Shah <jollys@xilinx.com>
> > ---
> >  drivers/clk/zynqmp/divider.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c
> > index a371c66..e146b6f 100644
> > --- a/drivers/clk/zynqmp/divider.c
> > +++ b/drivers/clk/zynqmp/divider.c
> > @@ -76,6 +76,13 @@ static unsigned long zynqmp_clk_divider_recalc_rate(struct clk_hw *hw,
> >       else
> >               value = div >> 16;
> >  
> > +     if (!value) {
> > +             WARN(!(divider->flags & CLK_DIVIDER_ALLOW_ZERO),
> > +                  "%s: Zero divisor and CLK_DIVIDER_ALLOW_ZERO not set\n",
> > +                  clk_name);
> > +             return parent_rate;
> > +     }
> > +
> >       return DIV_ROUND_UP_ULL(parent_rate, value);
> >  }
> >  
> > 
> 
> Stephen: Do you want to take it via your tree?
> 

Sure.


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

* Re: [PATCH] drivers: clk: zynqmp: Allow zero divisor value
  2019-03-18 19:42   ` Stephen Boyd
@ 2019-03-19  7:19     ` Michal Simek
  0 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2019-03-19  7:19 UTC (permalink / raw)
  To: Stephen Boyd, Jolly Shah, linux-clk, michal.simek, mturquette, sboyd
  Cc: rajanv, linux-arm-kernel, linux-kernel, Rajan Vaja, Jolly Shah

On 18. 03. 19 20:42, Stephen Boyd wrote:
> Quoting Michal Simek (2019-03-18 05:48:52)
>> On 05. 03. 19 0:27, Jolly Shah wrote:
>>> From: Rajan Vaja <rajan.vaja@xilinx.com>
>>>
>>> Zero divider is valid and default for some of ZynqMP
>>> clocks. Allow zero divisor when CLK_DIVIDER_ALLOW_ZERO
>>> for the clock is set.
>>>
>>> Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
>>> Signed-off-by: Jolly Shah <jollys@xilinx.com>
>>> ---
>>>  drivers/clk/zynqmp/divider.c | 7 +++++++
>>>  1 file changed, 7 insertions(+)
>>>
>>> diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c
>>> index a371c66..e146b6f 100644
>>> --- a/drivers/clk/zynqmp/divider.c
>>> +++ b/drivers/clk/zynqmp/divider.c
>>> @@ -76,6 +76,13 @@ static unsigned long zynqmp_clk_divider_recalc_rate(struct clk_hw *hw,
>>>       else
>>>               value = div >> 16;
>>>  
>>> +     if (!value) {
>>> +             WARN(!(divider->flags & CLK_DIVIDER_ALLOW_ZERO),
>>> +                  "%s: Zero divisor and CLK_DIVIDER_ALLOW_ZERO not set\n",
>>> +                  clk_name);
>>> +             return parent_rate;
>>> +     }
>>> +
>>>       return DIV_ROUND_UP_ULL(parent_rate, value);
>>>  }
>>>  
>>>
>>
>> Stephen: Do you want to take it via your tree?
>>
> 
> Sure.

ok. Then your turn with that two patches when you have time.

Thanks,
Michal



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

* Re: [PATCH] drivers: clk: zynqmp: Allow zero divisor value
  2019-03-04 23:27 [PATCH] drivers: clk: zynqmp: Allow zero divisor value Jolly Shah
  2019-03-18 12:48 ` Michal Simek
@ 2019-04-11 18:32 ` Stephen Boyd
  1 sibling, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2019-04-11 18:32 UTC (permalink / raw)
  To: Jolly Shah, linux-clk, michal.simek, mturquette, sboyd
  Cc: rajanv, linux-arm-kernel, linux-kernel, Rajan Vaja, Jolly Shah

Quoting Jolly Shah (2019-03-04 15:27:46)
> From: Rajan Vaja <rajan.vaja@xilinx.com>
> 
> Zero divider is valid and default for some of ZynqMP
> clocks. Allow zero divisor when CLK_DIVIDER_ALLOW_ZERO
> for the clock is set.
> 
> Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
> Signed-off-by: Jolly Shah <jollys@xilinx.com>
> ---

Applied to clk-next


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

end of thread, other threads:[~2019-04-11 18:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-04 23:27 [PATCH] drivers: clk: zynqmp: Allow zero divisor value Jolly Shah
2019-03-18 12:48 ` Michal Simek
2019-03-18 19:42   ` Stephen Boyd
2019-03-19  7:19     ` Michal Simek
2019-04-11 18:32 ` Stephen Boyd

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