2021-02-10 01:21:16

by Jernej Skrabec

[permalink] [raw]
Subject: [PATCH v3 1/5] clk: sunxi-ng: mp: fix parent rate change flag check

CLK_SET_RATE_PARENT flag is checked on parent clock instead of current
one. Fix that.

Fixes: 3f790433c3cb ("clk: sunxi-ng: Adjust MP clock parent rate when allowed")
Reviewed-by: Chen-Yu Tsai <[email protected]>
Tested-by: Andre Heider <[email protected]>
Signed-off-by: Jernej Skrabec <[email protected]>
---
drivers/clk/sunxi-ng/ccu_mp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/sunxi-ng/ccu_mp.c b/drivers/clk/sunxi-ng/ccu_mp.c
index fa4ecb915590..9d3a76604d94 100644
--- a/drivers/clk/sunxi-ng/ccu_mp.c
+++ b/drivers/clk/sunxi-ng/ccu_mp.c
@@ -108,7 +108,7 @@ static unsigned long ccu_mp_round_rate(struct ccu_mux_internal *mux,
max_m = cmp->m.max ?: 1 << cmp->m.width;
max_p = cmp->p.max ?: 1 << ((1 << cmp->p.width) - 1);

- if (!(clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT)) {
+ if (!clk_hw_can_set_rate_parent(&cmp->common.hw)) {
ccu_mp_find_best(*parent_rate, rate, max_m, max_p, &m, &p);
rate = *parent_rate / p / m;
} else {
--
2.30.0


2021-02-10 10:37:58

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH v3 1/5] clk: sunxi-ng: mp: fix parent rate change flag check

Hi Mike, Stephen,

On Tue, Feb 09, 2021 at 06:58:56PM +0100, Jernej Skrabec wrote:
> CLK_SET_RATE_PARENT flag is checked on parent clock instead of current
> one. Fix that.
>
> Fixes: 3f790433c3cb ("clk: sunxi-ng: Adjust MP clock parent rate when allowed")
> Reviewed-by: Chen-Yu Tsai <[email protected]>
> Tested-by: Andre Heider <[email protected]>
> Signed-off-by: Jernej Skrabec <[email protected]>

This is a last minute fix for us, can you merge it into clk-fixes directly?

Acked-by: Maxime Ripard <[email protected]>

Thanks!
Maxime


Attachments:
(No filename) (563.00 B)
signature.asc (235.00 B)
Download all attachments

2021-02-11 02:30:40

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH v3 1/5] clk: sunxi-ng: mp: fix parent rate change flag check

Quoting Maxime Ripard (2021-02-10 02:29:04)
> Hi Mike, Stephen,
>
> On Tue, Feb 09, 2021 at 06:58:56PM +0100, Jernej Skrabec wrote:
> > CLK_SET_RATE_PARENT flag is checked on parent clock instead of current
> > one. Fix that.
> >
> > Fixes: 3f790433c3cb ("clk: sunxi-ng: Adjust MP clock parent rate when allowed")
> > Reviewed-by: Chen-Yu Tsai <[email protected]>
> > Tested-by: Andre Heider <[email protected]>
> > Signed-off-by: Jernej Skrabec <[email protected]>
>
> This is a last minute fix for us, can you merge it into clk-fixes directly?
>
> Acked-by: Maxime Ripard <[email protected]>
>

It's also fixing a problem that's been around since v5.0. Is something
broken that needs fixing this late? The motivation could be added to the
commit text because right now it looks like a typo fix spotted visually.

2021-02-11 05:44:03

by Jernej Skrabec

[permalink] [raw]
Subject: Re: [PATCH v3 1/5] clk: sunxi-ng: mp: fix parent rate change flag check

Dne Ĩetrtek, 11. februar 2021 ob 03:28:00 CET je Stephen Boyd napisal(a):
> Quoting Maxime Ripard (2021-02-10 02:29:04)
>
> > Hi Mike, Stephen,
> >
> > On Tue, Feb 09, 2021 at 06:58:56PM +0100, Jernej Skrabec wrote:
> > > CLK_SET_RATE_PARENT flag is checked on parent clock instead of current
> > > one. Fix that.
> > >
> > > Fixes: 3f790433c3cb ("clk: sunxi-ng: Adjust MP clock parent rate when
> > > allowed") Reviewed-by: Chen-Yu Tsai <[email protected]>
> > > Tested-by: Andre Heider <[email protected]>
> > > Signed-off-by: Jernej Skrabec <[email protected]>
> >
> > This is a last minute fix for us, can you merge it into clk-fixes
> > directly?
> >
> > Acked-by: Maxime Ripard <[email protected]>
>
> It's also fixing a problem that's been around since v5.0. Is something
> broken that needs fixing this late? The motivation could be added to the
> commit text because right now it looks like a typo fix spotted visually.

Yes, it's needed. Without this patch, 4k@60 doesn't work and probably some
other resolutions too. That's why it's send with other display related fixes.
This is part of solution for longstanding display issues.

Best regards,
Jernej



2021-02-12 03:10:37

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH v3 1/5] clk: sunxi-ng: mp: fix parent rate change flag check

Quoting Jernej Skrabec (2021-02-09 09:58:56)
> CLK_SET_RATE_PARENT flag is checked on parent clock instead of current
> one. Fix that.
>
> Fixes: 3f790433c3cb ("clk: sunxi-ng: Adjust MP clock parent rate when allowed")
> Reviewed-by: Chen-Yu Tsai <[email protected]>
> Tested-by: Andre Heider <[email protected]>
> Signed-off-by: Jernej Skrabec <[email protected]>
> ---

Ok, Applied to clk-fixes