Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4114160ybb; Tue, 7 Apr 2020 00:41:17 -0700 (PDT) X-Google-Smtp-Source: APiQypKNOJruSfwzkSN7q4OlPmIosfr3wFgKQQEEtWJDvaenSALpJy+MPMwtdPENMtxPXCOsOiDr X-Received: by 2002:aca:ef82:: with SMTP id n124mr674777oih.73.1586245277212; Tue, 07 Apr 2020 00:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586245277; cv=none; d=google.com; s=arc-20160816; b=KKZB+ZdMpSfYR4HWpliPyqrsuHskltDUn9Y3GKYXEkkQK22FWB9/yGreQpp9UYjgZY SZd/E69WkNREjLIq8Xguqy1mE4E5bYO/BQ0EXXzegHf1ymArv9CTAQJF3BdE8B+pk7vN 5EqLVU56yxuR8p/CZdDB52F7jfhADt+QbRTaYwFUhA15G1p/4TH03nlx4EIaJQ3K/oyq pZS9pA1vxELg67TmeyKohzpqbpy2n44W73fCNfeJzIQouwYvDr6LehIoUTTz+dMmgT+b HBBi675pnTE4muC6DDq2Ya08l8oUVuDHty2rV/9oET1wUdqEMlo65SuYNy3gvyy8gQdE kbwQ== 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:mime-version :user-agent:date:message-id:subject:from:to; bh=/30uEpIbWYJabC6FgyknuJvUhH+dyw0T0Y7vodAHJBo=; b=rbFTNA0bTVZdAkRwTJai1Udxk5NJKZurvaSFFVe/+u2HTYdwDu05+vJhpEtbvPlVGd R+tS2bBKekLHlsxQHnmqpW3iV4ZTFII/+3YWo0N4xcdCHsOxJQ5x/HLc/JeZXgTb9YRb /vFp70p08Z+ea9Xzro/0f/FBOTfmNg31V7WjKej5oT/4aAGjFmbRX8xEHSLKfdMevyPM 7q+bzWBZpZzRFFnzsZjjCWsvI+ZAd8PBxqjB5K7qnZ3cgX0HzwLA4pw52jOZV9GGPoPp dYhrdDr3yHhk75DCAwdoVZYTBC57tk6xYi4CEv4+GZe31CM0x9rmctzuSPyGmM/ZIEtq H2sw== 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 a18si988545otq.286.2020.04.07.00.41.04; Tue, 07 Apr 2020 00:41:17 -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 S1727705AbgDGHjD (ORCPT + 99 others); Tue, 7 Apr 2020 03:39:03 -0400 Received: from submit-4.e-mind.com ([188.94.192.50]:45694 "EHLO submit-4.e-mind.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726591AbgDGHjD (ORCPT ); Tue, 7 Apr 2020 03:39:03 -0400 X-Greylist: delayed 514 seconds by postgrey-1.27 at vger.kernel.org; Tue, 07 Apr 2020 03:39:03 EDT Received: from localhost (unknown [127.0.0.1]) by submit-4.e-mind.com (Postfix) with ESMTP id 87B81840ACD for ; Tue, 7 Apr 2020 07:30:27 +0000 (UTC) Received: from submit-4.e-mind.com ([127.0.0.1]) by localhost (submit-4.e-mind.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xpFV_Vk5VK2J for ; Tue, 7 Apr 2020 09:30:27 +0200 (CEST) Received: from qmail.e-mind.com (qmail34.e-mind.com [188.94.192.34]) by submit-4.e-mind.com (Postfix) with SMTP id 808A0840ACF for ; Tue, 7 Apr 2020 09:30:20 +0200 (CEST) Received: (qmail 3614 invoked by uid 0); 7 Apr 2020 07:30:20 -0000 Received: from unknown (HELO ?192.168.143.6?) (185.53.252.165) by 0 with SMTP; 7 Apr 2020 07:30:20 -0000 To: Greg Kroah-Hartman , jslaby@suse.com, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Gianluca Renzi , dimka@embeddedalley.com, linux@rempel-privat.de From: gianluca Subject: Serial data loss Message-ID: <960c5054-48b0-fedc-4f3a-7246d84da832@eurek.it> Date: Tue, 7 Apr 2020 09:30:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello everybody! I hope you are keeping safe against Covid-19 a.k.a. Coronavirus! Now my issue: I have a BIG trouble having dataloss when using two internal serial ports of my boards based on NXP/FreeScale iMX28 SoC ARMv5Te ARM920ej-s architecture. It runs at 454Mhz. Kernel used 4.9.x When using my test case unit software between two serial ports connect each other by a null modem cable, it fails when the speed rate are different, and dataloss is increasing higher the speed rate. I suppose to have overruns (now I am modifying my software to check them too), but I think it is due the way the ISR is called and all data are passed to the uart circular buffer within the interrupt routine. I am talking about the high latency from the IRQ up to the service routine when flushing the FIFO and another IRQ is called by another uart in the same time at different speed. The code I was looking is: drivers/tty/serial/mxs-auart.c __but__ all other serial drivers are acting in the same way: they are reading one character at time from the FIFO (if it exists) and put it into the circular buffer so serial/tty driver can pass them to the user read routine. Each function call has some overhead and it is time-consuming, and if another interrupt is invoked by the same UART Core but from another serial port (different context) the continuos insertion done by hardware UART into the FIFO cannot be served fast enough to have an overrun. I think this can be applied __almost__ to every serial driver as they are written in the same way. And it is __NOT__ an issue because of the CPU and its speed! Using two serial converter (FTDI and Prolific PL2303 based) on each board, the problem does not appear at all even after 24 hours running at more than 115200!!! It does work fine if I am using two different serial devices: one internal uart (mxs-auart) and an external uart (ttyUSB). So I can say it is related on how the harwdare is managing the interrupt context and the FIFO/buffer small size. Are those correct assuptions? Will a shared FIQ driver over the UART solve the issue? Regards, -- Eurek s.r.l. | Electronic Engineering | http://www.eurek.it via Celletta 8/B, 40026 Imola, Italy | Phone: +39-(0)542-609120 p.iva 00690621206 - c.f. 04020030377 | Fax: +39-(0)542-609212