Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1506434 > unrolled thread
| Started by | David Wu <david.wu@rock-chips.com> |
|---|---|
| First post | 2016-10-22 10:50 +0200 |
| Last post | 2016-10-27 16:10 +0200 |
| Articles | 5 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH] i2c: rk3x: Give the tuning value 0 during rk3x_i2c_v0_calc_timings David Wu <david.wu@rock-chips.com> - 2016-10-22 10:50 +0200
Re: [PATCH] i2c: rk3x: Give the tuning value 0 during rk3x_i2c_v0_calc_timings Andy Yan <andy.yan@rock-chips.com> - 2016-10-24 14:00 +0200
Re: [PATCH] i2c: rk3x: Give the tuning value 0 during rk3x_i2c_v0_calc_timings Doug Anderson <dianders@chromium.org> - 2016-10-24 20:40 +0200
Re: [PATCH] i2c: rk3x: Give the tuning value 0 during rk3x_i2c_v0_calc_timings Wolfram Sang <wsa@the-dreams.de> - 2016-10-25 11:20 +0200
Re: [PATCH] i2c: rk3x: Give the tuning value 0 during rk3x_i2c_v0_calc_timings Wolfram Sang <wsa@the-dreams.de> - 2016-10-27 16:10 +0200
| From | David Wu <david.wu@rock-chips.com> |
|---|---|
| Date | 2016-10-22 10:50 +0200 |
| Subject | [PATCH] i2c: rk3x: Give the tuning value 0 during rk3x_i2c_v0_calc_timings |
| Message-ID | <sv0a6-15J-45@gated-at.bofh.it> |
We found a bug that i2c transfer sometimes failed on 3066a board with
stabel-4.8, the con register would be updated by uninitialized tuning
value, it made the i2c transfer failed.
So give the tuning value to be zero during rk3x_i2c_v0_calc_timings.
Signed-off-by: David Wu <david.wu@rock-chips.com>
---
drivers/i2c/busses/i2c-rk3x.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
index 50702c7..df22066 100644
--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -694,6 +694,8 @@ static int rk3x_i2c_v0_calc_timings(unsigned long clk_rate,
t_calc->div_low--;
t_calc->div_high--;
+ /* Give the tuning value 0, that would not update con register */
+ t_calc->tuning = 0;
/* Maximum divider supported by hw is 0xffff */
if (t_calc->div_low > 0xffff) {
t_calc->div_low = 0xffff;
--
1.9.1
[toc] | [next] | [standalone]
| From | Andy Yan <andy.yan@rock-chips.com> |
|---|---|
| Date | 2016-10-24 14:00 +0200 |
| Subject | Re: [PATCH] i2c: rk3x: Give the tuning value 0 during rk3x_i2c_v0_calc_timings |
| Message-ID | <svM54-76Q-11@gated-at.bofh.it> |
| In reply to | #1506434 |
Hi:
On 2016年10月22日 16:43, David Wu wrote:
> We found a bug that i2c transfer sometimes failed on 3066a board with
> stabel-4.8, the con register would be updated by uninitialized tuning
> value, it made the i2c transfer failed.
>
> So give the tuning value to be zero during rk3x_i2c_v0_calc_timings.
>
> Signed-off-by: David Wu <david.wu@rock-chips.com>
> ---
> drivers/i2c/busses/i2c-rk3x.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
> index 50702c7..df22066 100644
> --- a/drivers/i2c/busses/i2c-rk3x.c
> +++ b/drivers/i2c/busses/i2c-rk3x.c
> @@ -694,6 +694,8 @@ static int rk3x_i2c_v0_calc_timings(unsigned long clk_rate,
> t_calc->div_low--;
> t_calc->div_high--;
>
> + /* Give the tuning value 0, that would not update con register */
> + t_calc->tuning = 0;
> /* Maximum divider supported by hw is 0xffff */
> if (t_calc->div_low > 0xffff) {
> t_calc->div_low = 0xffff;
rk3066a based board can't boot up(with endless i2c irq messages print
out) from linux-4.8 without this fix.
Tested-by: Andy Yan <andy.yan@rock-chips.com>
[toc] | [prev] | [next] | [standalone]
| From | Doug Anderson <dianders@chromium.org> |
|---|---|
| Date | 2016-10-24 20:40 +0200 |
| Message-ID | <svSk9-2XX-5@gated-at.bofh.it> |
| In reply to | #1506434 |
Hi, On Sat, Oct 22, 2016 at 1:43 AM, David Wu <david.wu@rock-chips.com> wrote: > We found a bug that i2c transfer sometimes failed on 3066a board with > stabel-4.8, the con register would be updated by uninitialized tuning > value, it made the i2c transfer failed. > > So give the tuning value to be zero during rk3x_i2c_v0_calc_timings. > > Signed-off-by: David Wu <david.wu@rock-chips.com> > --- > drivers/i2c/busses/i2c-rk3x.c | 2 ++ > 1 file changed, 2 insertions(+) Reviewed-by: Douglas Anderson <dianders@chromium.org>
[toc] | [prev] | [next] | [standalone]
| From | Wolfram Sang <wsa@the-dreams.de> |
|---|---|
| Date | 2016-10-25 11:20 +0200 |
| Subject | Re: [PATCH] i2c: rk3x: Give the tuning value 0 during rk3x_i2c_v0_calc_timings |
| Message-ID | <sw63L-3ER-5@gated-at.bofh.it> |
| In reply to | #1506434 |
[Multipart message — attachments visible in raw view] — view raw
On Sat, Oct 22, 2016 at 04:43:42PM +0800, David Wu wrote: > We found a bug that i2c transfer sometimes failed on 3066a board with > stabel-4.8, the con register would be updated by uninitialized tuning > value, it made the i2c transfer failed. > > So give the tuning value to be zero during rk3x_i2c_v0_calc_timings. > > Signed-off-by: David Wu <david.wu@rock-chips.com> Added stable and applied to for-current, thanks!
[toc] | [prev] | [next] | [standalone]
| From | Wolfram Sang <wsa@the-dreams.de> |
|---|---|
| Date | 2016-10-27 16:10 +0200 |
| Subject | Re: [PATCH] i2c: rk3x: Give the tuning value 0 during rk3x_i2c_v0_calc_timings |
| Message-ID | <swTxx-2VB-79@gated-at.bofh.it> |
| In reply to | #1506434 |
[Multipart message — attachments visible in raw view] — view raw
On Sat, Oct 22, 2016 at 04:43:42PM +0800, David Wu wrote: > We found a bug that i2c transfer sometimes failed on 3066a board with > stabel-4.8, the con register would be updated by uninitialized tuning > value, it made the i2c transfer failed. > > So give the tuning value to be zero during rk3x_i2c_v0_calc_timings. > > Signed-off-by: David Wu <david.wu@rock-chips.com> What I missed to say in my review: Please use a subject line that describes WHY the change is needed not so much WHAT is done. Like: "fix missing initialization causing boot problems"
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web