mbox series

[clk-fixes,v1,0/2] Fix clk-composite to support .determine_rate

Message ID 20211016105022.303413-1-martin.blumenstingl@googlemail.com (mailing list archive)
Headers show
Series Fix clk-composite to support .determine_rate | expand

Message

Martin Blumenstingl Oct. 16, 2021, 10:50 a.m. UTC
Alex reports [0] that commit 69a00fb3d69706 ("clk: divider: Implement
and wire up .determine_rate by default") breaks Rockchip platforms
because the parent is not considered anymore. This is because
clk-composite skips the "best parent" selection when
rate_ops.determine_rate is set. Above commit does this by adding
clk_divider_ops.determine_rate by default (then the Rockchip platform
drivers are using clk_divider_ops as rate_ops in clk-composite).

With these two patches a revert of above commit is not needed anymore
(which would result in a revert of five follow-up commits as well).
Instead the first patch changes the order so clk_divider_ops which
has both, .determine_rate and .round_rate are supported by clk-divider
(again).
The second patch makes clk-composite use (and even prefer)
rate_ops.determine_rate when available.

Special thanks to Alex for his patience and helping test these patches
off-list (since I don't have any board with Rockchip SoC).

At least the first patch should go into -fixes.


[0] https://lore.kernel.org/linux-clk/4eb964ac-4fff-b59d-2660-2f84d8af5901@gmail.com/


Martin Blumenstingl (2):
  clk: composite: Also consider .determine_rate for rate + mux
    composites
  clk: composite: Use rate_ops.determine_rate when also a mux is
    available

 drivers/clk/clk-composite.c | 76 +++++++++++++++++++++++++------------
 1 file changed, 52 insertions(+), 24 deletions(-)

Comments

Alex Bee Oct. 16, 2021, 11:50 a.m. UTC | #1
Hi Martin, Hi Stephen,

Am 16.10.21 um 12:50 schrieb Martin Blumenstingl:
> Alex reports [0] that commit 69a00fb3d69706 ("clk: divider: Implement
> and wire up .determine_rate by default") breaks Rockchip platforms
> because the parent is not considered anymore. This is because
> clk-composite skips the "best parent" selection when
> rate_ops.determine_rate is set. Above commit does this by adding
> clk_divider_ops.determine_rate by default (then the Rockchip platform
> drivers are using clk_divider_ops as rate_ops in clk-composite).
>
> With these two patches a revert of above commit is not needed anymore
> (which would result in a revert of five follow-up commits as well).
> Instead the first patch changes the order so clk_divider_ops which
> has both, .determine_rate and .round_rate are supported by clk-divider
> (again).
> The second patch makes clk-composite use (and even prefer)
> rate_ops.determine_rate when available.
>
> Special thanks to Alex for his patience and helping test these patches
> off-list (since I don't have any board with Rockchip SoC).
>
> At least the first patch should go into -fixes.
>
>
> [0] https://lore.kernel.org/linux-clk/4eb964ac-4fff-b59d-2660-2f84d8af5901@gmail.com/

thanks for looking into this and fixing .determine_rate + mux as well 
for making this future-proof.

Both [PATCH 1/2] as a standalone fix, as well as  [PATCH 1/2] and [PATCH 
2/2] in combination are

     Tested-by: Alex Bee <knaerzche@gmail.com>

Regards,
Alex


>
> Martin Blumenstingl (2):
>    clk: composite: Also consider .determine_rate for rate + mux
>      composites
>    clk: composite: Use rate_ops.determine_rate when also a mux is
>      available
>
>   drivers/clk/clk-composite.c | 76 +++++++++++++++++++++++++------------
>   1 file changed, 52 insertions(+), 24 deletions(-)
>
Chen-Yu Tsai Oct. 17, 2021, 4:15 p.m. UTC | #2
On Sat, Oct 16, 2021 at 7:51 PM Alex Bee <knaerzche@gmail.com> wrote:
>
> Hi Martin, Hi Stephen,
>
> Am 16.10.21 um 12:50 schrieb Martin Blumenstingl:
> > Alex reports [0] that commit 69a00fb3d69706 ("clk: divider: Implement
> > and wire up .determine_rate by default") breaks Rockchip platforms
> > because the parent is not considered anymore. This is because
> > clk-composite skips the "best parent" selection when
> > rate_ops.determine_rate is set. Above commit does this by adding
> > clk_divider_ops.determine_rate by default (then the Rockchip platform
> > drivers are using clk_divider_ops as rate_ops in clk-composite).
> >
> > With these two patches a revert of above commit is not needed anymore
> > (which would result in a revert of five follow-up commits as well).
> > Instead the first patch changes the order so clk_divider_ops which
> > has both, .determine_rate and .round_rate are supported by clk-divider
> > (again).
> > The second patch makes clk-composite use (and even prefer)
> > rate_ops.determine_rate when available.
> >
> > Special thanks to Alex for his patience and helping test these patches
> > off-list (since I don't have any board with Rockchip SoC).
> >
> > At least the first patch should go into -fixes.
> >
> >
> > [0] https://lore.kernel.org/linux-clk/4eb964ac-4fff-b59d-2660-2f84d8af5901@gmail.com/
>
> thanks for looking into this and fixing .determine_rate + mux as well
> for making this future-proof.
>
> Both [PATCH 1/2] as a standalone fix, as well as  [PATCH 1/2] and [PATCH
> 2/2] in combination are
>
>      Tested-by: Alex Bee <knaerzche@gmail.com>
>

Tested-by: Chen-Yu Tsai <wens@csie.org> # on NanoPi M4B and M4V2

showing SDIO back at around 150 MHz.