[PATCH 0/2] spi: sh-msiof: Fix bit field overflow writes to TSCR/RSCR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux