Received: by 10.223.164.221 with SMTP id h29csp2197164wrb; Tue, 17 Oct 2017 17:50:38 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAzJbJj9uySvlUZfB49KLkRnOx0nwa4yaMvA57TjKKy1QGNubesXI0fznFmkTGjcbOTlKxW X-Received: by 10.99.122.92 with SMTP id j28mr12310466pgn.154.1508287838774; Tue, 17 Oct 2017 17:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508287838; cv=none; d=google.com; s=arc-20160816; b=r0xtnJFPT39MkvE5Adjib8amjPC1VY5w2ZyjmZRMoZovQnl3ESuF/AIi6aaeiVTloN mdeZXu+YizxR0HAcCUuVPjnLcTAme/u17kRPwqk5Bn30Ko7O8NK36oZipWMjBEjNMkaq aDmLpCGwH69rIRNw89FfMHg0KWjMMqp0CSxeE/RncZslKWg/Tqm4ORFeJyMWMS6n+EYT 6K4kbdAT5Qz0dG9turyPvFSpRhnGT76y5cpwd+D1Z1ik77hp2ku8fBgbhLOHjU2ki/9y +smNPHdegAfLOuk5x6zjDtD1Tq8ixMsoV2aZdBt1xZqnUM+WcIPdaqwxcFTnfIeFykhv weng== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=BdjLBTNbAJnJ8yoDcvzMYlS2WT2AtDtxx6gQm6W5bX4=; b=H6pGi0ykm9E3AxmBZM3aGwvruX5/jHEzrtU0QSGDx9zmYvcHZaePrKGgCFlDcwna9t Y/lz3hIFEKVeSMRuaUSAjPBJTzZOVbGAuS83OkRmrmw64B7kUmzcEy7dYB3VJloGtHRy olsH3/meh/zyKkkG6XL5DuUhP4+s68muQdVoakgHQdUiv/9CcX+0laxzz9hAPOEzfntl mMJ5t6Yxx5Ap6hDyVk7zF/jH+7ccm2RorDUwYtWLE6sc8CGyl56QTfE7rjexJ8YR3q5R uLtxxsN/g4MOhpyKaW4uTdRx2wdyhzLvOH9nijokA7gq/Mpg8oTuF3WxsJhsmkh32gCi 80HA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12si4614252pfd.152.2017.10.17.17.50.24; Tue, 17 Oct 2017 17:50:38 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755608AbdJQNTC (ORCPT + 99 others); Tue, 17 Oct 2017 09:19:02 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:43647 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752660AbdJQNTA (ORCPT ); Tue, 17 Oct 2017 09:19:00 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9HDEOQR002267; Tue, 17 Oct 2017 15:18:27 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2dk9fd0s5c-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 17 Oct 2017 15:18:26 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1CCFE31; Tue, 17 Oct 2017 13:18:26 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node2.st.com [10.75.127.14]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id F32892728; Tue, 17 Oct 2017 13:18:25 +0000 (GMT) Received: from [10.201.23.236] (10.75.127.49) by SFHDAG5NODE2.st.com (10.75.127.14) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 17 Oct 2017 15:18:25 +0200 Subject: Re: [PATCH] i2c: stm32: Fixes multibyte transfer for STM32F4 I2C controller To: =?UTF-8?Q?Rados=c5=82aw_Pietrzyk?= CC: Wolfram Sang , Maxime Coquelin , Alexandre Torgue , "open list:I2C SUBSYSTEM" , "moderated list:ARM/STM32 ARCHITECTURE" , open list References: <1507722788-31224-1-git-send-email-radoslaw.pietrzyk@gmail.com> <990c3275-35b3-68da-453c-d1a80e867df7@st.com> From: Pierre Yves MORDRET Message-ID: <2d892fec-0496-8a6f-51c9-439b933d9975@st.com> Date: Tue, 17 Oct 2017 15:18:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.75.127.49] X-ClientProxiedBy: SFHDAG8NODE3.st.com (10.75.127.24) To SFHDAG5NODE2.st.com (10.75.127.14) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-17_10:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/12/2017 11:55 AM, Radosław 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 timer 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 matter 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/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 1581045185569783646@xxx Thu Oct 12 09:56:26 +0000 2017 X-GM-THRID: 1580962045961710824 X-Gmail-Labels: Inbox,Category Forums