diff options
author | Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> | 2018-04-13 15:44:16 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-04-16 15:52:44 +0100 |
commit | 10b4640833e95eeacaef8060bc1b35e636df3218 (patch) | |
tree | 871fc87eaf41e850492d2734bd48f923b036726a /drivers/staging/goldfish | |
parent | af82800cd2d9cfcae2de1b47a35c26c147b9cdd1 (diff) | |
download | talos-op-linux-10b4640833e95eeacaef8060bc1b35e636df3218.tar.gz talos-op-linux-10b4640833e95eeacaef8060bc1b35e636df3218.zip |
spi: sh-msiof: Fix bit field overflow writes to TSCR/RSCR
The change fixes a bit field overflow which allows to write to higher
bits while calculating SPI transfer clock and setting BRPS and BRDV
bit fields, the problem is reproduced if 'parent_rate' to 'spi_hz'
ratio is greater than 1024, for instance
p->min_div = 2,
MSO rate = 33333333,
SPI device rate = 10000
results in
k = 5, i.e. BRDV = 0b100 or 1/32 prescaler output,
BRPS = 105,
TSCR value = 0x6804, thus MSSEL and MSIMM bit fields are non-zero.
Fixes: 65d5665bb260 ("spi: sh-msiof: Update calculation of frequency dividing")
Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/staging/goldfish')
0 files changed, 0 insertions, 0 deletions