From: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
To: Mark Brown <broonie@kernel.org>,
Geert Uytterhoeven <geert@linux-m68k.org>
Cc: <linux-spi@vger.kernel.org>, <linux-renesas-soc@vger.kernel.org>
Subject: [PATCH 0/2] spi: sh-msiof: Fix bit field overflow writes to TSCR/RSCR
Date: Fri, 13 Apr 2018 15:44:15 +0300 [thread overview]
Message-ID: <1523623457-9682-1-git-send-email-vladimir_zapolskiy@mentor.com> (raw)
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
next reply other threads:[~2018-04-13 12:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-13 12:44 Vladimir Zapolskiy [this message]
2018-04-13 12:44 ` [PATCH 1/2] spi: sh-msiof: Fix bit field overflow writes to TSCR/RSCR 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1523623457-9682-1-git-send-email-vladimir_zapolskiy@mentor.com \
--to=vladimir_zapolskiy@mentor.com \
--cc=broonie@kernel.org \
--cc=geert@linux-m68k.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.