Re: [PATCH] staging: sm750fb: clean up PLL calculation code
From: Himanshu Bakshi
Date: Sat Oct 24 2026 - 07:51:09 EST
Hi Greg,
I found this while reviewing sm750_calc_pll_value() and looking for a
cleaner way to handle the PLL candidate calculation.
I tested the change as follows:
Built the sm750fb driver successfully using make -j2
M=drivers/staging/sm750fb W=1.
Ran a standalone C differential regression test comparing the original
and modified algorithms across 2,010,084 test cases, including
frequency sweeps, boundary values, and randomized requests.
Compared the return values and resulting PLL fields. All tested cases matched.
The differential test uses standalone copies of the original and
modified algorithms rather than executing the function inside the
kernel, so it verifies that the two implementations behave identically
over the tested inputs. I have not tested this on physical SM750
hardware. If by any chance you would like to see the test c file, let
me know.
Thanks and Regards,
Himanshu Bakshi
On Sat, Oct 24, 2026 at 1:32 PM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> On Sat, Oct 24, 2026 at 01:05:49PM +0530, himanshu bakshi wrote:
> > From: Himanshu Bakshi <himanshu.bakshi478@xxxxxxxxx>
> >
> > Improve the PLL calculation function's documentation and
> > readability.
> >
> > Simplify candidate selection by skipping candidates that do
> > not improve the frequency error, and defer updating the PLL
> > parameters until the best candidate has been selected.
>
> How was this found and tested?
>
> thanks,
>
> greg k-h