mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
* [PATCH] clk: meson: vid-pll-div: remove warning and return 0 on invalid config
@ 2019-03-27 15:13 Neil Armstrong
  2019-03-29  8:39 ` Jerome Brunet
  0 siblings, 1 reply; 3+ messages in thread
From: Neil Armstrong @ 2019-03-27 15:13 UTC (permalink / raw)
  To: jbrunet
  Cc: linux-amlogic, linux-kernel, linux-clk, linux-arm-kernel, Neil Armstrong

The vid_pll_div is a programmable fractional divider, but vendor gives a
limited of known configuration value and it's corresponding fraction.

Thus when at reset value (0) or unknown value, we cannot determine the
result rate.

The initial behaviour was to print a warning, but the warning triggers
at each boot and when the clock tree is refreshed.

This patch moves the print to debug and returns 0 instead of the
parent rate.

Fixes: 72dbb8c94d0d ("clk: meson: Add vid_pll divider driver")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/clk/meson/vid-pll-div.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/meson/vid-pll-div.c b/drivers/clk/meson/vid-pll-div.c
index 08bcc01c0923..daff235bc763 100644
--- a/drivers/clk/meson/vid-pll-div.c
+++ b/drivers/clk/meson/vid-pll-div.c
@@ -82,8 +82,8 @@ static unsigned long meson_vid_pll_div_recalc_rate(struct clk_hw *hw,
 	div = _get_table_val(meson_parm_read(clk->map, &pll_div->val),
 			     meson_parm_read(clk->map, &pll_div->sel));
 	if (!div || !div->divider) {
-		pr_info("%s: Invalid config value for vid_pll_div\n", __func__);
-		return parent_rate;
+		pr_debug("%s: Invalid config value for vid_pll_div\n", __func__);
+		return 0;
 	}
 
 	return DIV_ROUND_UP_ULL(parent_rate * div->multiplier, div->divider);
-- 
2.21.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH] clk: meson: vid-pll-div: remove warning and return 0 on invalid config
  2019-03-27 15:13 [PATCH] clk: meson: vid-pll-div: remove warning and return 0 on invalid config Neil Armstrong
@ 2019-03-29  8:39 ` Jerome Brunet
  2019-03-29  8:40   ` Neil Armstrong
  0 siblings, 1 reply; 3+ messages in thread
From: Jerome Brunet @ 2019-03-29  8:39 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: linux-amlogic, linux-clk, linux-arm-kernel, linux-kernel

On Wed, 2019-03-27 at 16:13 +0100, Neil Armstrong wrote:
> The vid_pll_div is a programmable fractional divider, but vendor gives a
> limited of known configuration value and it's corresponding fraction.
> 
> Thus when at reset value (0) or unknown value, we cannot determine the
> result rate.
> 
> The initial behaviour was to print a warning, but the warning triggers
> at each boot and when the clock tree is refreshed.
> 
> This patch moves the print to debug and returns 0 instead of the
> parent rate.
> 
> Fixes: 72dbb8c94d0d ("clk: meson: Add vid_pll divider driver")
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---
>  drivers/clk/meson/vid-pll-div.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH] clk: meson: vid-pll-div: remove warning and return 0 on invalid config
  2019-03-29  8:39 ` Jerome Brunet
@ 2019-03-29  8:40   ` Neil Armstrong
  0 siblings, 0 replies; 3+ messages in thread
From: Neil Armstrong @ 2019-03-29  8:40 UTC (permalink / raw)
  To: Jerome Brunet; +Cc: linux-amlogic, linux-clk, linux-arm-kernel, linux-kernel

On 29/03/2019 09:39, Jerome Brunet wrote:
> On Wed, 2019-03-27 at 16:13 +0100, Neil Armstrong wrote:
>> The vid_pll_div is a programmable fractional divider, but vendor gives a
>> limited of known configuration value and it's corresponding fraction.
>>
>> Thus when at reset value (0) or unknown value, we cannot determine the
>> result rate.
>>
>> The initial behaviour was to print a warning, but the warning triggers
>> at each boot and when the clock tree is refreshed.
>>
>> This patch moves the print to debug and returns 0 instead of the
>> parent rate.
>>
>> Fixes: 72dbb8c94d0d ("clk: meson: Add vid_pll divider driver")
>> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
>> ---
>>  drivers/clk/meson/vid-pll-div.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
> 

Thanks,

Applied to fixes/drivers

Neil

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

end of thread, other threads:[~2019-03-29  8:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-27 15:13 [PATCH] clk: meson: vid-pll-div: remove warning and return 0 on invalid config Neil Armstrong
2019-03-29  8:39 ` Jerome Brunet
2019-03-29  8:40   ` Neil Armstrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®