From: Wolfram Sang <wsa@the-dreams.de>
To: Arseny Solokha <asolokha@kb.kras.ru>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
Valentin Longchamp <valentin.longchamp@keymile.com>
Subject: Re: [RESEND, 1/4] i2c: mpc: get MPC8xxx I2C clock prescaler before using it in calculations
Date: Sat, 30 Dec 2017 19:18:14 +0100 [thread overview]
Message-ID: <20171230181814.4ppgyqg6mcfahkdh@ninjato> (raw)
In-Reply-To: <20171207102003.23496-2-asolokha@kb.kras.ru>
[-- Attachment #1: Type: text/plain, Size: 727 bytes --]
On Thu, Dec 07, 2017 at 05:20:00PM +0700, Arseny Solokha wrote:
> Obtaining the actual I2C clock prescaler value in mpc_i2c_setup_8xxx() only
> happens when the clock parameter is set to something other than
> MPC_I2C_CLOCK_LEGACY. When the clock parameter is exactly
> MPC_I2C_CLOCK_LEGACY, the prescaler parameter is used in arithmetic
> division as provided by the caller, resulting in a division by zero
> for the majority of processors supported by the module.
>
> Avoid division by zero by obtaining the actual I2C clock prescaler
> in mpc_i2c_setup_8xxx() unconditionally regardless of the passed clock
> value.
>
> Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
Applied to for-current, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-12-30 18:18 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-10 7:50 [PATCH 0/4] i2c: mpc: Clean up clock selection Arseny Solokha
2017-11-10 7:50 ` [PATCH 1/4] i2c: mpc: get MPC8xxx I2C clock prescaler before using it in calculations Arseny Solokha
2017-11-10 7:50 ` [PATCH 2/4] i2c: mpc: unify obtaining the MPC8533/44 I2C clock prescaler w/ MPC8xxx Arseny Solokha
2017-11-10 7:50 ` [PATCH 3/4] i2c: mpc: fix PORDEVSR2 mask for MPC8533/44 Arseny Solokha
2017-11-10 7:50 ` [PATCH 4/4] i2c: mpc: always determine I2C clock prescaler at runtime Arseny Solokha
2017-12-07 10:19 ` [PATCH RESEND 0/4] i2c: mpc: Clean up clock selection Arseny Solokha
2017-12-07 10:20 ` [PATCH RESEND 1/4] i2c: mpc: get MPC8xxx I2C clock prescaler before using it in calculations Arseny Solokha
2017-12-30 18:18 ` Wolfram Sang [this message]
2018-01-15 18:21 ` [RESEND, " Wolfram Sang
2017-12-07 10:20 ` [PATCH RESEND 2/4] i2c: mpc: unify obtaining the MPC8533/44 I2C clock prescaler w/ MPC8xxx Arseny Solokha
2017-12-30 18:19 ` [RESEND, " Wolfram Sang
2018-01-15 18:21 ` Wolfram Sang
2017-12-07 10:20 ` [PATCH RESEND 3/4] i2c: mpc: fix PORDEVSR2 mask for MPC8533/44 Arseny Solokha
2017-12-30 18:11 ` [RESEND,3/4] " Wolfram Sang
2018-01-15 18:22 ` Wolfram Sang
2017-12-07 10:20 ` [PATCH RESEND 4/4] i2c: mpc: always determine I2C clock prescaler at runtime Arseny Solokha
2017-12-30 18:14 ` [RESEND, " Wolfram Sang
2018-01-10 11:36 ` Arseny Solokha
2018-01-10 11:36 ` [PATCH v2 " Arseny Solokha
2018-01-15 18:22 ` Wolfram Sang
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=20171230181814.4ppgyqg6mcfahkdh@ninjato \
--to=wsa@the-dreams.de \
--cc=asolokha@kb.kras.ru \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=valentin.longchamp@keymile.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox