Received: by 10.223.164.221 with SMTP id h29csp514312wrb; Tue, 24 Oct 2017 04:47:56 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RHpAH1Q60CaZGcRi/SRaFrv8ck+DDTOew3Sis/KNbzN3eWwjxPU70A+72qsX1DdjAKW7Z9 X-Received: by 10.84.135.129 with SMTP id 1mr13059219plj.47.1508845676044; Tue, 24 Oct 2017 04:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508845676; cv=none; d=google.com; s=arc-20160816; b=qwxtlykb2XJfT8EAztiMWoOhq6HPWShENeiTE5QsZxSb43fSumxYPigHp/Ykf/T62E Lpg9Bm5WBaUG/XJndAPZICsp5LWcpE5hiMch0DOXs5/FxQikFeFW9rO/3BOSUIxnDAVU 49WmX0OANWhhLnA0cLxIgyJ50Cu5TjLc+uZvevr7A5iyH8cEzXqOoAsYye+iwiPuVTJ3 8z/ADwp4SJvWPu6VP8/14/93+E6EoxuE/HQEAD8kiRIJX1pNTG3BRvn9bUg7IsKMG/KQ 37sQAFDtQggkDCk/wnA9HZ4OvyB99aDF8G6xyyZnO+SuNzFzswrdFS0EXEkuu4E9+1vO Topg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=YuHrXobvQ+utsiPmg3/x/fDod+zdgPzeF5gnolEmWEk=; b=aOPgKd1JGrGV0XtHV3epEp/UVGeWNxr18nW0D5GDzfWzciyPZQq8kk3dRReBZn22Rf pgYrzletzPpJ3E+AzvqlTYyqda8HDOaFWlTkkglbat0tLu8FT9kVg/GCu2k9Uc2F0eTg Paef9TbklF/5GmH7lRXqgdeHUHIKxAQAEBy1XbiHRXRpgVRpl6CGnE5wnh3xOaRhUCke W4iADbP8958Hb67yvnBQAwdTJVHPz6uxOWfRXzNtZZHhcUxH4wWMAoec0akn6REKVHF7 X1ax0Hv8x/gFDr3Iw6hY89dimr6nMJwexMAQSP9eyQ0G1lAemgu0N3sctcXz2tMcL3h0 zpgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QNiukEfm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z31si45266plb.732.2017.10.24.04.47.42; Tue, 24 Oct 2017 04:47:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QNiukEfm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932273AbdJXLps (ORCPT + 99 others); Tue, 24 Oct 2017 07:45:48 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:55342 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751825AbdJXLpq (ORCPT ); Tue, 24 Oct 2017 07:45:46 -0400 Received: by mail-lf0-f67.google.com with SMTP id p184so23592557lfe.12; Tue, 24 Oct 2017 04:45:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=YuHrXobvQ+utsiPmg3/x/fDod+zdgPzeF5gnolEmWEk=; b=QNiukEfmqwPTsupGr4o12eiS4/hHehXqCSmZGQN14QYpz9ymG3QgOJDBhALOXeE5vI WXLrkM9suYhmQAKrLYHboAjVVkYiCjOp3bcPxK6r9696g8ObKKK8arnN01L3ahleY/tl h12iXRBgj9F3XHNip5dJVYPRzHVwr6m6+u7ORWOzPAgog1phEM5Hsi4hthp294XZb+Aw 0Py82vEwoXznT69ZsMbMd6sxyx5yIBWQA4gwtonLO9MqyO8/g1eJ4e3Ekjk9LY0ahBCO fx8G72duJcKIQTyRKaqLbNavvpQTOQNKplonx3N9e79Jx5WGh12+o81vYtLeFxBEP2N7 NZ4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=YuHrXobvQ+utsiPmg3/x/fDod+zdgPzeF5gnolEmWEk=; b=ey8drFUc0AIV5EoWCTXqD+ZA6NGhboRu8t+3AZNaPicYt/ZEl8FEeIw5zknNzuS++t Q5LI4hG1JJ3fDnF21GP7O2fkRkXTuFkxPlpuD6FyG1S86sLV+7siwn4g2cP2xSIiNLEq hO1Z2oHvOCVSeaLXKUxfpGqzm55Jm+w7BqAEF7NnFEbY6JfoXguXCNHvPP5NPghO1k2c 9FKkWBKhBeEi+F6L3RZuKP5D0ZtBWvtZMOAbZnEXyBr+eGB6scWd99DK4guJA/y7T58O MLBqz85wWviat+9kdLvJ0W75W5ApFrL2m3+pwmNkTzfjAxjqL0ob1lm7N2dKBNHS4c2+ +VWQ== X-Gm-Message-State: AMCzsaXnIJaeqtdbqBY8vcZqZWgjzSLT8yyrCt0dnIKdblGZqUIpBdvB 8EaYajAgHpJkM90NsxqsIjaj9FDtfWgHt/zSGjc= X-Received: by 10.25.217.26 with SMTP id q26mr5617523lfg.52.1508845544454; Tue, 24 Oct 2017 04:45:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.208.136 with HTTP; Tue, 24 Oct 2017 04:45:43 -0700 (PDT) In-Reply-To: References: <1507722788-31224-1-git-send-email-radoslaw.pietrzyk@gmail.com> <990c3275-35b3-68da-453c-d1a80e867df7@st.com> <2d892fec-0496-8a6f-51c9-439b933d9975@st.com> From: =?UTF-8?Q?Rados=C5=82aw_Pietrzyk?= Date: Tue, 24 Oct 2017 13:45:43 +0200 Message-ID: Subject: Re: [PATCH] i2c: stm32: Fixes multibyte transfer for STM32F4 I2C controller To: Pierre Yves MORDRET Cc: Wolfram Sang , Maxime Coquelin , Alexandre Torgue , "open list:I2C SUBSYSTEM" , "moderated list:ARM/STM32 ARCHITECTURE" , open list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I'm afraid that didn't help and the problem still exists even with those patches applied. 2017-10-17 16:35 GMT+02:00 Pierre Yves MORDRET = : > > > On 10/17/2017 03:51 PM, Rados=C5=82aw Pietrzyk wrote: >> I can try of course but it means that any IRQ delay may cause the same >> problem so the question is whether the driver should be vulnerable to >> such use cases. >> > > I may or ... may or not. If those patches don't find effectiveness at you= r side > I will have to look at it closer. > Nonetheless I prefer to start from something more stable in term of clock= before > investigating further. > > Please let me know > > Regards >> 2017-10-17 15:18 GMT+02:00 Pierre Yves MORDRET : >>> >>> >>> On 10/12/2017 11:55 AM, Rados=C5=82aw Pietrzyk wrote: >>>> It looks like there is a use case when IRQ handler is delayed a bit >>>> and the logic in the driver does not work. What is the real root cause >>>> I don't know. >>>> >>> >>> As far as I know on this STM32 F4 platform there is some trouble with t= imer >>> events that may have bad influences on scheduling. Some tasks could be = delayed >>> for some reasons. >>> It would be great if the following patches below could help in your mat= ter >>> https://patchwork.kernel.org/patch/9980961/ >>> https://patchwork.kernel.org/patch/9980963/ >>> https://patchwork.kernel.org/patch/9980965/ >>> https://patchwork.kernel.org/patch/9980967/ >>> >>> Would you mind to test those ? >>> Thanks >>> >>>> 2017-10-12 11:31 GMT+02:00 Pierre Yves MORDRET : >>>>> >>>>> >>>>> On 10/11/2017 01:53 PM, Radoslaw Pietrzyk wrote: >>>>>> Do not read data on RXNE but on BTF only due to HW >>>>>> synchronisation problems and NACKing read data too early. >>>>>> It was found during testing of stmpe811 touchscreen driver. >>>>>> >>>>> >>>>> Would you mind to explain what is behind "hw sync issue" you've seen = ? >>>>> >>>>>> Signed-off-by: Radoslaw Pietrzyk >>>>>> --- >>>>>> drivers/i2c/busses/i2c-stm32f4.c | 11 +---------- >>>>>> 1 file changed, 1 insertion(+), 10 deletions(-) >>>>>> >>>>>> diff --git a/drivers/i2c/busses/i2c-stm32f4.c b/drivers/i2c/busses/i= 2c-stm32f4.c >>>>>> index 4ec1084..86bcf4c 100644 >>>>>> --- a/drivers/i2c/busses/i2c-stm32f4.c >>>>>> +++ b/drivers/i2c/busses/i2c-stm32f4.c >>>>>> @@ -409,16 +409,9 @@ static void stm32f4_i2c_handle_read(struct stm3= 2f4_i2c_dev *i2c_dev) >>>>>> * So, here we just disable buffer interrupt in order to avoid= another >>>>>> * system preemption due to RX not empty event. >>>>>> */ >>>>>> - case 2: >>>>>> - case 3: >>>>>> + default: >>>>>> stm32f4_i2c_clr_bits(reg, STM32F4_I2C_CR2_ITBUFEN); >>>>>> break; >>>>>> - /* >>>>>> - * For N byte reception with N > 3 we directly read data regis= ter >>>>>> - * until N-2 data. >>>>>> - */ >>>>>> - default: >>>>>> - stm32f4_i2c_read_msg(i2c_dev); >>>>>> } >>>>>> } >>>>>> >>>>>> @@ -470,8 +463,6 @@ static void stm32f4_i2c_handle_rx_done(struct st= m32f4_i2c_dev *i2c_dev) >>>>>> */ >>>>>> reg =3D i2c_dev->base + STM32F4_I2C_CR1; >>>>>> stm32f4_i2c_clr_bits(reg, STM32F4_I2C_CR1_ACK); >>>>>> - stm32f4_i2c_read_msg(i2c_dev); >>>>>> - break; >>>>>> default: >>>>>> stm32f4_i2c_read_msg(i2c_dev); >>>>>> } >>>>>> From 1581555481996722246@xxx Wed Oct 18 01:07:23 +0000 2017 X-GM-THRID: 1580962045961710824 X-Gmail-Labels: Inbox,Category Forums