From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752343AbcHHNSU (ORCPT ); Mon, 8 Aug 2016 09:18:20 -0400 Received: from mx0a-00176a03.pphosted.com ([67.231.149.52]:39057 "EHLO mx0a-00176a03.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751798AbcHHNSR (ORCPT ); Mon, 8 Aug 2016 09:18:17 -0400 From: Nandor Han To: =Dan Williams , Vinod Koul , Greg Kroah-Hartman , Jiri Slaby Cc: Nandor Han , dmaengine@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Senna Tschudin Subject: [PATCH 0/4] serial,dmaengine: use DMA cyclic for IMX UART driver Date: Mon, 8 Aug 2016 15:38:24 +0300 Message-Id: X-Mailer: git-send-email 2.8.3 In-Reply-To: References: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-08_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608080143 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Update the IMX UART driver to use cyclic DMA in order to avoid losing serial data because of DMA start latency. Support variable data length transfers for cyclic channels in IMX SDMA(Smart DMA) driver and, as specified in "Documentation/dmaengine/provider.txt" section "General Design Notes", run the SDMA channel callback directly from the SDMA interrupt context. Every commit message will explain the changes. Impacted devices: IMX6i,IMX53 CPU: - clients of the IMX UART that have DMA enabled. - cyclic SDMA clients (Note:Not able to find others than IMX UART driver) Functionality tested by connecting the m53evk to my laptop using a USB-serial converter and start sending, from my laptop 800 bytes long packets at 8ms interval. On the m53evk with interrupt load, generated by connecting/disconnecting at 3s interval a USB HUB having some devices connected (~4), I receive serial data in a loop and check that no overruns are created using command: `watch -n1 cat /proc/tty/driver/IMX-uart` Also done tests were I check how the data is received when sending packets bigger than a buffer descriptor size (1024). In my tests I have sent 4 packets (1028, 2048, 2048, 2048) and check that 7172 bytes were received using the command: `watch -n1 cat /proc/tty/driver/IMX-uart` Result: serinfo:1.0 driver revision: 2: uart:IMX mmio:0x5000C000 irq:49 tx:0 rx:7172 RTS|CTS|DTR|DSR|CD Nandor Han (4): dmaengine: imx-sdma - reduce transfer latency for DMA cyclic clients dmaengine: imx-sdma - update the residue calculation for cyclic channels serial: imx-serial - update UART IMX driver to use cyclic DMA serial: imx-serial - update RX error counters when DMA is used drivers/dma/imx-sdma.c | 56 +++++++++------ drivers/tty/serial/imx.c | 173 ++++++++++++++++++++++++++++++----------------- 2 files changed, 144 insertions(+), 85 deletions(-) -- 2.8.3