All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] spi: sh-msiof: Fix bit field overflow writes to TSCR/RSCR
@ 2018-04-13 12:44 Vladimir Zapolskiy
  2018-04-13 12:44 ` [PATCH 1/2] " Vladimir Zapolskiy
  2018-04-13 12:44 ` [PATCH 2/2] spi: sh-msiof: Simplify calculation of divisors for transfer rate Vladimir Zapolskiy
  0 siblings, 2 replies; 5+ messages in thread
From: Vladimir Zapolskiy @ 2018-04-13 12:44 UTC (permalink / raw)
  To: Mark Brown, Geert Uytterhoeven; +Cc: linux-spi, linux-renesas-soc

The changeset 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.

I attach the second patch to the series, because actually the squashed
change is the sole fix as well, the split was done only to simplify
backporting of the most essential part.

The reorganization of sh_msiof_spi_set_clk_regs() function allows to
avoid min_t()/max_t(), break/continue in the loop etc., which hopefully
is seen as a beneficial update.

Geert, I'd appreciate if you can find time to review and test the changes.

Vladimir Zapolskiy (2):
  spi: sh-msiof: Fix bit field overflow writes to TSCR/RSCR
  spi: sh-msiof: Simplify calculation of divisors for transfer rate

 drivers/spi/spi-sh-msiof.c | 66 ++++++++++++++++++++++++----------------------
 1 file changed, 35 insertions(+), 31 deletions(-)

-- 
2.8.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-04-16 17:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-13 12:44 [PATCH 0/2] spi: sh-msiof: Fix bit field overflow writes to TSCR/RSCR Vladimir Zapolskiy
2018-04-13 12:44 ` [PATCH 1/2] " Vladimir Zapolskiy
2018-04-16 17:16   ` Applied "spi: sh-msiof: Fix bit field overflow writes to TSCR/RSCR" to the spi tree Mark Brown
2018-04-13 12:44 ` [PATCH 2/2] spi: sh-msiof: Simplify calculation of divisors for transfer rate Vladimir Zapolskiy
2018-04-16 17:15   ` Applied "spi: sh-msiof: Simplify calculation of divisors for transfer rate" to the spi tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.