Received: by 10.223.164.221 with SMTP id h29csp1594515wrb; Thu, 12 Oct 2017 02:56:26 -0700 (PDT) X-Received: by 10.99.147.3 with SMTP id b3mr1705278pge.352.1507802186543; Thu, 12 Oct 2017 02:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507802186; cv=none; d=google.com; s=arc-20160816; b=BbVIGkIbBdn3ME4p/Rktg+2p6cvYNyrf8jzjJ2kWMbFL8tQJazC3TBEHc/CBVnKyXJ gYEpYY+ujqlB1cwKCkbuounoVRN/R5x5B6FpFVi+Qbrmuyn6dM5hNGp0iCA8IHzQP26R EqU1ahBsIUwgKpe9tJbj9LT5f95xLQh8s2IlayF8367Jda2Asg3SvDo4XCFzxQGfaINa jQAVW/SKqsURiea10oeUhIBT7AFXZOUevvtDREzozrKWvQ7KqbrrfskPOk5Cc7eb0I0B 4gAE/QQdIDFt7A8/wAVxgNU2JIZ5B06VS1EWctfKCgJqIoyugPuYWnJiXLjVbUEiKFD1 F1hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=LKZTeVq9gG7Ss0jU9ou3lHOsrJGwwrQAzWhdriDioNI=; b=lO9OV9ohrBsuPHZDzpiS3+wmemSKyI6fA2YmArGjSBRX1SiHedzkQ1kd7JPEPXpOHf 4dqP/Ifsif+zKoVjDgR/jXRyyMjEvFLGqvhpFqsh5EuYsB0mbgzHGGGS+VX9af2vmzsO GMS9JoOgL56HPL+MiY03ZZ+lrt3FstoR9uFAo209unGwwaUWUQGAn5t+XUaK/ow33WPg EYMLvMmIRTsvTD+S9cul7a+uL6FkH+rxh2TeBmR3svH8uJQteB4NqpY/fF2zAHzhF+0/ lsXOcbru33SAoK83s8kFF18UJ2Oyh4EDntnZnO47Bx1ClDX/nJBapikFHk8DRLbt9XdO zQgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uWB532DL; 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 85si11013560pfo.365.2017.10.12.02.56.12; Thu, 12 Oct 2017 02:56:26 -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=uWB532DL; 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 S1751963AbdJLJzt (ORCPT + 99 others); Thu, 12 Oct 2017 05:55:49 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:52571 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750907AbdJLJzs (ORCPT ); Thu, 12 Oct 2017 05:55:48 -0400 Received: by mail-lf0-f66.google.com with SMTP id b190so5305031lfg.9; Thu, 12 Oct 2017 02:55:47 -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; bh=LKZTeVq9gG7Ss0jU9ou3lHOsrJGwwrQAzWhdriDioNI=; b=uWB532DLcOJBdyOr7LaGCwQF0lJjf0O75Tp5+8ve/cwpzm1n0JpoN0HH9e1/6UliLt AhS6m3vDouZttIL8AyRmPt13gEfDbWLFH0R6X10oe4cO++pc/jAYgkkWW+yb0YR9zuA5 WYnEieppiMgvWTEMHOpScXafugojGLsA5GWZM5wcPpQd0pPwSF7Nosp3NxoY2x83g4s8 OcXpykQQDUsaz2Fz5KCZ+YKPNIjrAQy6FEC5JqbEVpmKfCKcIVBi9iePd1Hs6BY7VQQ9 ImwI6fuM5C5rFQNkEDusryWCwfZj8/GnA/Iy4G03vfWy0zgz/JhU3yJbeRazbe2OSYVx MtLw== 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; bh=LKZTeVq9gG7Ss0jU9ou3lHOsrJGwwrQAzWhdriDioNI=; b=HcMIi6+muLBXLryksEVFi9dGs125rIasaL0ZhLfZgRrCTbNNfZDpMZ9DZBnCQiOSRd zMmKRJPj+O1HUGaVB2u35Xk0P00IqWpVuJQnE8ijepUZKBqD8ZZ31TUtydwUYXRbVrVC syO0xuqO9gV8iZnc2xs0uhQCnWb/MIhVlG1ByUv4qUq4TBNalBrfaOvFVac9eYc79WHi M+GnzfMzV4E0MpWSGekH1uGnvqJ33Xkon4wK8HIgz+4EMORsaPsnQsFIU7+bYRg+R/2g z+Kc/fEmDrG9F5gEQdabpWlIktWTf5L9LleeoyWrFKFpZauhhydlWRttWVVdyektD3QZ MiIg== X-Gm-Message-State: AMCzsaWtk6/kC/JLPHc8uxBwcfq+EgnfbQLDm7R5xb9MxBmekN3MpgQ/ w0zbmXQymO+nJaqzccDkIloQFbppTyynBGMQRn8= X-Google-Smtp-Source: ABhQp+QCuxuAyicFElBczGaSilrbPVjK+k2kRV8pBHZ/vWwx/o6s0wgUQ7geX7CXWvjJyd2IAKd4gZWC/bD9XQzIbSk= X-Received: by 10.25.156.200 with SMTP id f191mr675570lfe.0.1507802146500; Thu, 12 Oct 2017 02:55:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.208.203 with HTTP; Thu, 12 Oct 2017 02:55:45 -0700 (PDT) In-Reply-To: <990c3275-35b3-68da-453c-d1a80e867df7@st.com> References: <1507722788-31224-1-git-send-email-radoslaw.pietrzyk@gmail.com> <990c3275-35b3-68da-453c-d1a80e867df7@st.com> From: =?UTF-8?Q?Rados=C5=82aw_Pietrzyk?= Date: Thu, 12 Oct 2017 11:55:45 +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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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/i2c-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 stm32f4_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 register >> - * until N-2 data. >> - */ >> - default: >> - stm32f4_i2c_read_msg(i2c_dev); >> } >> } >> >> @@ -470,8 +463,6 @@ static void stm32f4_i2c_handle_rx_done(struct stm32f4_i2c_dev *i2c_dev) >> */ >> reg = 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 1581043712191485724@xxx Thu Oct 12 09:33:01 +0000 2017 X-GM-THRID: 1580962045961710824 X-Gmail-Labels: Inbox,Category Forums