Smatch issues reported for Marvell a38x DDR4

Stefan Roese stefan.roese at mailbox.org
Fri Jul 25 15:02:08 CEST 2025


Hi Andrew,

On 24.07.25 18:01, Andrew Goodbody wrote:
> Hi Stefan,
> 
> Smatch reports the following issues
> 
> drivers/ddr/marvell/a38x/mv_ddr4_training_calibration.c:1029 
> mv_ddr4_center_of_mass_calc() warn: unsigned 'd_min' is never less than 
> zero.
> drivers/ddr/marvell/a38x/mv_ddr4_training_calibration.c:2192 
> mv_ddr4_dm_tuning() warn: unsigned 'reg_val' is never less than zero.
> drivers/ddr/marvell/a38x/mv_ddr4_training_calibration.c:2270 
> mv_ddr4_dm_tuning() warn: unsigned 'reg_val' is never less than zero.
> drivers/ddr/marvell/a38x/mv_ddr4_training_calibration.c:662 
> mv_ddr4_centralization() warn: unsigned 'if_id' is never less than zero.
> drivers/ddr/marvell/a38x/mv_ddr4_training_calibration.c:662 
> mv_ddr4_centralization() warn: we never enter this loop
> drivers/ddr/marvell/a38x/mv_ddr4_training_calibration.c:911 
> mv_ddr4_dqs_reposition() warn: always true condition '(delta >= 0) => 
> (0-255 >= 0)'
> drivers/ddr/marvell/a38x/mv_ddr4_training_calibration.c:924 
> mv_ddr4_dqs_reposition() warn: unsigned 'delta' is never less than zero.
> 
> As I have no way to validate the correctness of the code I am not 
> confident enough to attempt to make the appropriate fixes in this case 
> as it could affect its operation. Perhaps you would like to take a look?

Sure, thanks for all your work on these smatch issues. Really
appreciated.

But frankly, it's not easy to test anything in this area. I still have
access to one board (AFAIK), but minor changes usually don't really
make a notable difference in the DDR controller configuration here.

My suggestion is to send the patches (or one patch) "as best as you can"
to the list for official review. I'll try to review and perhaps someone
else with access to such a board will take a look.

Thanks,
Stefan



More information about the U-Boot mailing list