Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934081AbcJXLzs (ORCPT ); Mon, 24 Oct 2016 07:55:48 -0400 Received: from regular1.263xmail.com ([211.150.99.139]:47655 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756858AbcJXLzp (ORCPT ); Mon, 24 Oct 2016 07:55:45 -0400 X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED4: 1 X-RL-SENDER: andy.yan@rock-chips.com X-FST-TO: linux-arm-kernel@lists.infradead.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: andy.yan@rock-chips.com X-UNIQUE-TAG: <57518e9520fb6be5185562df718511ee> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [PATCH] i2c: rk3x: Give the tuning value 0 during rk3x_i2c_v0_calc_timings To: David Wu , heiko@sntech.de, wsa@the-dreams.de References: <1477125822-30644-1-git-send-email-david.wu@rock-chips.com> Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dianders@chromium.org, linux-rockchip@lists.infradead.org, linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org From: Andy Yan Message-ID: Date: Mon, 24 Oct 2016 19:55:32 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <1477125822-30644-1-git-send-email-david.wu@rock-chips.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1142 Lines: 33 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 > --- > 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