Re: [PATCH 06/13] iio: adc: rockchip_saradc: Benefit from devm_clk_get_enabled() to simplify

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Aug 13, 2022 at 7:21 PM Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
>
> On Mon,  8 Aug 2022 22:47:33 +0200
> Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> wrote:
>
> > Make use of devm_clk_get_enabled() to replace some code that effectively
> > open codes this new function.
> >
> > Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
>
> This might have side effects as it now enables the clock before calling
> the clk_set_rate(). Also changes the clock start up ordering. Neither is that
> scary a change, but on really fussy hardware they might cause problems.
>
> Add a few rock-chips people who have sent patches in last few years
> to hopefully take a look or even better run a test.

I believe you found a bug in the patch. The possible solutions are:
- not take the patch
- disable and re-enable clock around clk_set_rate()

IIRC clk_set_rate() will spit a WARN if clock is enabled.

-- 
With Best Regards,
Andy Shevchenko




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux