]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
spi: sh-msiof: Avoid invalid clock generator parameters
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 5 Aug 2016 08:17:52 +0000 (10:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Oct 2016 13:21:18 +0000 (15:21 +0200)
commit5001a9558c1c8a05941922d3a99101e8a0a00384
treeeae5e0acb6913332c4487175a94bc87b9e8687b1
parentafca668faa80cbd97ca767d41c2845a175d931c2
spi: sh-msiof: Avoid invalid clock generator parameters

commit c3ccf357c3d75bd2924e049b6a991f7c0c111068 upstream.

The conversion from a look-up table to a calculation for clock generator
parameters forgot to take into account that BRDV x 1/1 is valid only if
BRPS is x 1/1 or x 1/2, leading to undefined behavior (e.g. arbitrary
clock rates).

This limitation is documented for the MSIOF module in all supported
SH/R-Mobile and R-Car Gen2/Gen3 ARM SoCs.

Tested on r8a7791/koelsch and r8a7795/salvator-x.

Fixes: 65d5665bb260b034 ("spi: sh-msiof: Update calculation of frequency dividing")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-sh-msiof.c