Received: by 10.223.164.221 with SMTP id h29csp2209158wrb; Tue, 17 Oct 2017 18:07:23 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAqakCpRw64KNB7AiZOj9ZBYqhuK9PDjvT3Di+Yyxw3dXGx2wd8UIvdrbpUfkBejQoZkmF+ X-Received: by 10.84.205.70 with SMTP id o6mr13899443plh.350.1508288842970; Tue, 17 Oct 2017 18:07:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508288842; cv=none; d=google.com; s=arc-20160816; b=wOt1eohMkKYBR4mQdkgzzBfpSTRB3xdZVERnrYF3lt30WL/a/bS8VVXRGeSwLBoBC9 QTJyh03it6efrnFrSbArRlDuzQ2CC/FJDLS3FVcBdQF98jr6ZtdF9t47Z25EjjZiGLHC rUBezhjGQ8TWbhI9HEflwoPYitIa0d3ehDgcs92fq3ZWrc5IbtUkM0EsEed9vgnkZOpT qkTkGLBP/nqxpog/KzUlBI0s0lRZdd+jFXNI6amHsybci2752Yn7TbRxEt6VrzXyhZKI sy6nthJ1kyXeoMABBl/VbHpDpgrtKSyF2CAIVievvZb3KDTN3KabhwYs2owSoWHwTM4u dXbg== 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=tPrBiY0hfSOH1/08oLAsR7pQTYqq7iVLIqrmhuoglxs=; b=z9SXoedzGwLLz73XmS+CT9oF/3IkUySUhC/Syq0fsf/oQNR6piiFlxjrNZnl8Hvhcl NUVcxTzOsSvjQbqpOTwRX9UVIBsQNbY20rPw3JnGO7FfX7Jr9dZBAfvwtbyGBAHQPLLP 4/TyMQnFasF0hpOFFBKEi6ED4y+rteWFcpQ/pM7EiSY4UJ/rPL3/MMcn28UuIRdPiQwk r4E+sgY35ipnrtw4X321menh+O/tiU9xn3l6tufaOWMWd3UM6Kz1K+d3RuP7LLQY/uUT 73OiYWVErM25f0Ls3L38IN/aakfiTtk+2buoJdL6v7Na1sQk78XayZWQCTPic5Axj8P1 gmCw== 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 f10si6801633pln.804.2017.10.17.18.07.08; Tue, 17 Oct 2017 18:07:22 -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 S1762917AbdJQOfz (ORCPT + 99 others); Tue, 17 Oct 2017 10:35:55 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:46576 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755214AbdJQOfy (ORCPT ); Tue, 17 Oct 2017 10:35:54 -0400 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9HEYCD0028048; Tue, 17 Oct 2017 16:35:15 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2dmvmyxmwu-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 17 Oct 2017 16:35:15 +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 44BA33F; Tue, 17 Oct 2017 14:35:15 +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 14217286B; Tue, 17 Oct 2017 14:35:15 +0000 (GMT) Received: from [10.201.23.236] (10.75.127.48) by SFHDAG5NODE2.st.com (10.75.127.14) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 17 Oct 2017 16:35:14 +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> <2d892fec-0496-8a6f-51c9-439b933d9975@st.com> From: Pierre Yves MORDRET Message-ID: Date: Tue, 17 Oct 2017 16:35:13 +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.48] X-ClientProxiedBy: SFHDAG5NODE2.st.com (10.75.127.14) To SFHDAG5NODE2.st.com (10.75.127.14) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-17_11:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/17/2017 03:51 PM, Radosław 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 your 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ł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 1581554931725255931@xxx Wed Oct 18 00:58:38 +0000 2017 X-GM-THRID: 1580962045961710824 X-Gmail-Labels: Inbox,Category Forums