Vladimir Zapolskiy 10b4640833
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>
2018-04-16 15:52:44 +01:00
..
2017-07-17 12:09:38 +01:00
2016-07-07 11:44:43 +02:00
2015-12-07 20:09:09 +00:00
2017-09-27 10:02:57 -07:00
2017-08-23 17:12:05 +01:00
2017-01-23 18:09:37 +00:00
2017-08-10 15:50:23 +01:00
2017-05-26 12:41:07 +01:00