From patchwork Thu Nov 15 09:11:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 1747901 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 6CCDB3FC64 for ; Thu, 15 Nov 2012 09:09:40 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TYvQQ-0005HR-NG; Thu, 15 Nov 2012 09:07:54 +0000 Received: from tx2ehsobe002.messaging.microsoft.com ([65.55.88.12] helo=tx2outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TYvQN-0005Fv-6k for linux-arm-kernel@lists.infradead.org; Thu, 15 Nov 2012 09:07:52 +0000 Received: from mail24-tx2-R.bigfish.com (10.9.14.254) by TX2EHSOBE003.bigfish.com (10.9.40.23) with Microsoft SMTP Server id 14.1.225.23; Thu, 15 Nov 2012 09:07:46 +0000 Received: from mail24-tx2 (localhost [127.0.0.1]) by mail24-tx2-R.bigfish.com (Postfix) with ESMTP id 678E83A0146; Thu, 15 Nov 2012 09:07:46 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: -1 X-BigFish: VS-1(zzbb2dI98dI9371Ic89bh1432Ic857hzz1de0h1202h1d1ah1d2ah1082kzzz2dh2a8h668h839hd25he5bhf0ah1288h12a5h12bdh1354h137ah1441h1504h1537h153bh162dh1631h34h1155h) Received: from mail24-tx2 (localhost.localdomain [127.0.0.1]) by mail24-tx2 (MessageSwitch) id 1352970465392411_7889; Thu, 15 Nov 2012 09:07:45 +0000 (UTC) Received: from TX2EHSMHS013.bigfish.com (unknown [10.9.14.236]) by mail24-tx2.bigfish.com (Postfix) with ESMTP id 5A4AA200058; Thu, 15 Nov 2012 09:07:45 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS013.bigfish.com (10.9.99.113) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 15 Nov 2012 09:07:42 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.2.318.3; Thu, 15 Nov 2012 09:07:42 +0000 Received: from localhost.localdomain (udp161149uds.ap.freescale.net [10.192.242.25]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id qAF97TA5025417; Thu, 15 Nov 2012 02:07:33 -0700 Message-ID: <50A4B1CE.5070203@freescale.com> Date: Thu, 15 Nov 2012 17:11:42 +0800 From: Huang Shijie User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16 MIME-Version: 1.0 To: Lauri Hintsala Subject: Re: [PATCH v2 2/3] serial: mxs-auart: add the DMA support for mx28 References: <1351074456-25863-1-git-send-email-b32955@freescale.com> <1351074456-25863-3-git-send-email-b32955@freescale.com> <50A21613.6030709@bluegiga.com> <50A45F83.1010009@freescale.com> <50A4983F.8080407@bluegiga.com> In-Reply-To: <50A4983F.8080407@bluegiga.com> X-OriginatorOrg: freescale.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121115_040751_427879_4BEF5AB4 X-CRM114-Status: GOOD ( 22.47 ) X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [65.55.88.12 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Fabio Estevam , linux@arm.linux.org.uk, vinod.koul@intel.com, gregkh@linuxfoundation.org, Veli-Pekka Peltola , linux-serial@vger.kernel.org, shawn.guo@linaro.org, linux-arm-kernel@lists.infradead.org, alan@linux.intel.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org ? 2012?11?15? 15:22, Lauri Hintsala ??: > Hi, > > On 11/15/2012 05:20 AM, Huang Shijie wrote: >> ? 2012?11?13? 17:42, Lauri Hintsala ??: >>> Hi Huang, >>> >>> DMA support doesn't work with latest stable v3.6.5 or development >>> 3.7-rc5 kernels. I get following error message when I open the serial >>> port /dev/ttyAPP0: >>> >>> [ 48.730000] mxs-auart 8006a000.serial: step 1 error >>> [ 48.750000] mxs-auart 8006a000.serial: We can not start up the DMA. >>> >> I tested this patch set in imx28-evk board Rev C with >> linux-next-20121114. >> it works fine. >> >> Maybe you can try the linux-next code. > > I tested linux-next-20121114 on apx4devkit (imx28 based device) and I > got the same error message: > > # stty -F /dev/ttyAPP0 crtscts; microcom /dev/ttyAPP0 -s 115200 > [ 133.710000] mxs-auart 8006a000.serial: step 1 error > [ 133.720000] mxs-auart 8006a000.serial: We can not start up the DMA. Could you test this patch? thanks Huang Shijie From 502db325af8664e239be3da47f32d496f3db036f Mon Sep 17 00:00:00 2001 From: Huang Shijie Date: Thu, 15 Nov 2012 16:24:31 +0800 Subject: [PATCH] fix patch Signed-off-by: Huang Shijie --- drivers/tty/serial/mxs-auart.c | 25 +++++++++++++------------ 1 files changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c index d593e0a..0e60ef2 100644 --- a/drivers/tty/serial/mxs-auart.c +++ b/drivers/tty/serial/mxs-auart.c @@ -542,7 +542,7 @@ static int mxs_auart_dma_init(struct mxs_auart_port *s) dma_cap_mask_t mask; if (auart_dma_enabled(s)) - return 0; + return -EBUSY; /* We do not get the right DMA channels. */ if (s->dma_channel_rx == -1 || s->dma_channel_rx == -1) @@ -666,10 +666,21 @@ static void mxs_auart_settermios(struct uart_port *u, * in mx28. */ if (is_imx28_auart(s) && (s->flags & MXS_AUART_DMA_CONFIG)) { - if (!mxs_auart_dma_init(s)) + if (!mxs_auart_dma_init(s)) { /* enable DMA tranfer */ ctrl2 |= AUART_CTRL2_TXDMAE | AUART_CTRL2_RXDMAE | AUART_CTRL2_DMAONERR; + + /* prepare for the DMA RX. */ + if (!mxs_auart_dma_prep_rx(s)) { + /* Disable the normal RX irq. */ + writel(AUART_INTR_RXIEN, + u->membase + AUART_INTR_CLR); + } else { + mxs_auart_dma_exit(s); + dev_err(s->dev, "DMA failed.\n"); + } + } } ctrl2 |= AUART_CTRL2_CTSEN | AUART_CTRL2_RTSEN; } else { @@ -687,16 +698,6 @@ static void mxs_auart_settermios(struct uart_port *u, uart_update_timeout(u, termios->c_cflag, baud); - /* prepare for the DMA RX. */ - if (auart_dma_enabled(s)) { - if (!mxs_auart_dma_prep_rx(s)) { - /* Disable the normal RX interrupt. */ - writel(AUART_INTR_RXIEN, u->membase + AUART_INTR_CLR); - } else { - mxs_auart_dma_exit(s); - dev_err(s->dev, "We can not start up the DMA.\n"); - } - } } static irqreturn_t mxs_auart_irq_handle(int irq, void *context) -- 1.7.0.4