Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1116844ybe; Thu, 19 Sep 2019 08:53:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzTdwdgjIOGdiJ4JyTho8stbfkDOkLHQ6FrHLToTgpshL8A3bOm2V1HupEfWJpG1E0ViVO X-Received: by 2002:a50:a41c:: with SMTP id u28mr16772434edb.185.1568908396181; Thu, 19 Sep 2019 08:53:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568908396; cv=none; d=google.com; s=arc-20160816; b=pX7myhpOhcRXuDbfSc2ZxDOCEFVPFnl7Z3qUIYhWREsXz3zD90DolwwZFsxI+zWE3z IGknkhJbfqdyFEyPG1jqjc3n3Xn/K+bS/9iJVH4rerslFyosRzMaj97EzvjDpgPwnPJ9 HGSdTOfgjQzcP/DbA5ebBEPLuGbdHZwgjgMzvYrhUUZTaIpr1He4ph8xBJSnhv2dynZS DyNRW3Wgh9BIXkkUw4owCti3QGOntUXyNUeT7s/G/O05ykaZx0zUctRnvDqAyZD1KX/T VohTyil8QxDRZTrmlP+x4pJOg6Cn8pVss+Hj8XSictYQRALCA4ZVzah4x3DU17vWbYML lzeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=fJLlG+KTkA6M746eS/r9HQbXOatxu3KeZuev7noyZMs=; b=VtG96u3PtNUkvF3uRkhrjESWTLK/OMsSe/NfBaY6yKgeqYBK9xthX4m3E4hkhGgUE2 RF7cMRAIF7r8OqC1GJLgm8dImONrmFvB/LkXqy9HQK0Bvt5FeOpuCzYSnmgdfZlRO7CD OJ/dQF4lU98ZxLonUEysRIFXsWKMsZMNJbh2cwjwmgbt8egv+kabrFv7Nw0SQhSBcGeN vZMwM7MDzMolgBRGFiqQ+xqobywS2esm1U0iMjCtGBJm8lDmvFLYmnm8U7S/diZuuq+H bxXvjobBGVxbqmkHxKFDfYj8Aw4wIUN49iNZw7uMtU5bxnE4HS98P7VTJcbaYU/UjkPO gcYw== 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 13si5527790edw.357.2019.09.19.08.52.52; Thu, 19 Sep 2019 08:53:16 -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 S2390082AbfISMAe (ORCPT + 99 others); Thu, 19 Sep 2019 08:00:34 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:42909 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388613AbfISMAe (ORCPT ); Thu, 19 Sep 2019 08:00:34 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iAv6u-000652-IR; Thu, 19 Sep 2019 14:00:32 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1iAv6s-00046r-NC; Thu, 19 Sep 2019 14:00:30 +0200 Date: Thu, 19 Sep 2019 14:00:30 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Philipp Puschmann Cc: festevam@gmail.com, fugang.duan@nxp.com, linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, jslaby@suse.com, yibin.gong@nxp.com, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org, l.stach@pengutronix.de Subject: Re: [PATCH v2] serial: imx: adapt rx buffer and dma periods Message-ID: <20190919120030.oie2id4womd4lcp5@pengutronix.de> References: <20190919102628.23621-1-philipp.puschmann@emlix.com> <20190919112216.qjkx5wvqhsadjxg5@pengutronix.de> <9923d405-a62d-0c6a-6039-f4a7bc3bf2e8@emlix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9923d405-a62d-0c6a-6039-f4a7bc3bf2e8@emlix.com> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 19, 2019 at 01:40:03PM +0200, Philipp Puschmann wrote: > Hi Uwe > > Am 19.09.19 um 13:22 schrieb Uwe Kleine-K?nig: > > On Thu, Sep 19, 2019 at 12:26:28PM +0200, Philipp Puschmann wrote: > >> Using only 4 DMA periods for UART RX is very few if we have a high > >> frequency of small transfers - like in our case using Bluetooth with > >> many small packets via UART - causing many dma transfers but in each > >> only filling a fraction of a single buffer. Such a case may lead to > >> the situation that DMA RX transfer is triggered but no free buffer is > >> available. While we have addressed the dma handling already with > >> "dmaengine: imx-sdma: fix dma freezes" we still want to avoid > > > > Is this statement still true now that you split this patch out of your > > bigger series? > Yes. The dma patches care about stopping DMA channel. This patch tries to > avoid that the channel runs out of usable buffers (aka dma periods). > > > > >> UART RX FIFO overrun. So we decrease the size of the buffers and > >> increase their number and the total buffer size. > > > > What happens when such an RX FIFO overrun happens? Are characters lost? > > Or only time? > Good question. In explanation i have missed an important point: > When using HW flowcontrol via RTS/CTS and the buffer is full CTS is used to > tell the remote device - here the Bluetooth chip - to stop sending data. > For a while this prevents losing of characters. But then the remote device > comes into trouble as its internal TX buffers runs over. Depends on the > device how it handles this case and if it recovers if data flow is enabled > again. > > In case without HW flow control characters would be lost. Depends on the upper > layer what happens then. > > > Does your change have an influence if I do fewer but > > bigger transfers? > Don't think so. The dma periods are raw data buffers. If one is full the next one > is being used. For the performance i don't see a significant difference between > using 1 kB buffers or 4 kB buffers. Would be great to add these infos to the commit log. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |