Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1001509ybe; Wed, 11 Sep 2019 07:57:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzUrKKTzK9Kdq0YQphI2yu9G6rF6ytXzLEnIYR9PJ4OT9Hd9d8tDnR6bLCLVLvcm2kEH3cI X-Received: by 2002:a50:9e26:: with SMTP id z35mr36811843ede.265.1568213877673; Wed, 11 Sep 2019 07:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568213877; cv=none; d=google.com; s=arc-20160816; b=ePOdQPDXay/AgtwomD7z/QRsSyzjDh+FOkhZhnSh5+z+aKMP29Ig+5U39uSR3G7gTj uKapY/qVpUbZegA6c8mNcy9rTURhvh4xtAmfGUUkeqzuswhh294wh8i6aRLg1LKLTekL WAnwv1xE3aypouO6fxAbuMOEUNwto44jP6ul8zq994LI/YUjCTFmtgiIi6A4qhM2CuA5 0lbWQSOBviSwSgaCD6bFA0ywdBHkDngGFL8D3tO+BH6SXuXHdWq/x16YV9gI+nE7jRdu 6ZDt6gD+s8wJMDV2pf2UAmHQxouOJXp/yh4/ugMYtsp23WxtdrgaMPuWgdGcWN4jA8Vh flMg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=guwHCYWpHmgthxUDQP33ZYOoZkIyD8U3rLunCFe8jJ0=; b=Gk2xkZLhdsHtOCXDWPdaDTOH+hQndkBUCxxPxiJ52VM0DqJCOrko1Gfj5qADmaDi9O KsxzMTxC6mwIX+QIlh0zWPv53urcAnckkhVhTPVpYmVXmCfhMS8nVMnsk0OzMJ6oLtf+ QWMMnI1UQLTn0mwBhHsEgTfYZgaf6Cv3KJtwbhYa1mLxVJZTrsVwqJHoQGcQA+PfMLtK RXroMOlC7QEBXx+gg9gBd6NSPGwUdW1qS43sucdtfng6lni2g/8xf3lXNdC+OcTWuBGl SXFv9Tv6iz0uhLm36laIPOgnLokznAYdntKeqdFnpcIWr0zhzGjEWrxOOSS1RQ8JbY/a OpZg== 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 w14si11335293eju.353.2019.09.11.07.57.34; Wed, 11 Sep 2019 07:57:57 -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 S1728385AbfIKOzl (ORCPT + 99 others); Wed, 11 Sep 2019 10:55:41 -0400 Received: from mx1.emlix.com ([188.40.240.192]:37226 "EHLO mx1.emlix.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727912AbfIKOzk (ORCPT ); Wed, 11 Sep 2019 10:55:40 -0400 X-Greylist: delayed 338 seconds by postgrey-1.27 at vger.kernel.org; Wed, 11 Sep 2019 10:55:39 EDT Received: from mailer.emlix.com (unknown [81.20.119.6]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.emlix.com (Postfix) with ESMTPS id CB1555FCF6; Wed, 11 Sep 2019 16:50:00 +0200 (CEST) From: Philipp Puschmann To: linux-kernel@vger.kernel.org Cc: vkoul@kernel.org, dan.j.williams@intel.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, gregkh@linuxfoundation.org, jslaby@suse.com, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, Philipp Puschmann Subject: [PATCH 3/4] serial: imx: adapt rx buffer and dma periods Date: Wed, 11 Sep 2019 16:49:42 +0200 Message-Id: <20190911144943.21554-4-philipp.puschmann@emlix.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190911144943.21554-1-philipp.puschmann@emlix.com> References: <20190911144943.21554-1-philipp.puschmann@emlix.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 buffer is available. While we have addressed the dma handling already we still want to avoid UART RX FIFO overrun. So we decrease the size of the buffers and increase their number and the total buffer size. Signed-off-by: Philipp Puschmann --- drivers/tty/serial/imx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 57d6e6ba556e..cdc51569237c 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1028,8 +1028,6 @@ static void imx_uart_timeout(struct timer_list *t) } } -#define RX_BUF_SIZE (PAGE_SIZE) - /* * There are two kinds of RX DMA interrupts(such as in the MX6Q): * [1] the RX DMA buffer is full. @@ -1112,7 +1110,8 @@ static void imx_uart_dma_rx_callback(void *data) } /* RX DMA buffer periods */ -#define RX_DMA_PERIODS 4 +#define RX_DMA_PERIODS 16 +#define RX_BUF_SIZE (PAGE_SIZE / 4) static int imx_uart_start_rx_dma(struct imx_port *sport) { -- 2.23.0