From patchwork Mon Dec 9 11:53:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 3310631 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A70D9C0D4A for ; Mon, 9 Dec 2013 11:54:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8644F201FB for ; Mon, 9 Dec 2013 11:54:25 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CC0AE201B4 for ; Mon, 9 Dec 2013 11:54:23 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VpzPo-0006dt-9b; Mon, 09 Dec 2013 11:54:20 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VpzPl-0003g0-RR; Mon, 09 Dec 2013 11:54:17 +0000 Received: from moutng.kundenserver.de ([212.227.126.171]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VpzPi-0003eX-4t for linux-arm-kernel@lists.infradead.org; Mon, 09 Dec 2013 11:54:15 +0000 Received: from axis700.grange (dslb-094-221-120-150.pools.arcor-ip.net [94.221.120.150]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0LhTpQ-1VCEn52qC8-00n4i8; Mon, 09 Dec 2013 12:53:32 +0100 Received: by axis700.grange (Postfix, from userid 1000) id BE17540BB4; Mon, 9 Dec 2013 12:53:30 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id BB03440BB3; Mon, 9 Dec 2013 12:53:30 +0100 (CET) Date: Mon, 9 Dec 2013 12:53:30 +0100 (CET) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: Linus Walleij Subject: [PATCH] serial: pl011: also enable DMA Rx polling with no platform data In-Reply-To: <1385631664-32607-1-git-send-email-linus.walleij@linaro.org> Message-ID: References: <1385631664-32607-1-git-send-email-linus.walleij@linaro.org> MIME-Version: 1.0 X-Provags-ID: V02:K0:9Han72zGuNtndNwSLCUiDlGT+fVEmZblus5gHgOXCns DlILBjqaeZqOOAUTnRGBfACMgN/BwDhopNPgWfXE7Zai/tTV3r 8zFtyAj3uog0PV30h7E6Jx/jcOBkLH05dqUAL+DpJpINxwGcbG SPmYcuhKe3KppkcEn3MkzMGuG2SJkNg+HxjgFBASNitb9s3P/O pz1hhqnSYmf8+HNF8C2399NX2cBNG1c+1w56+KJD/8cg2MMfaw G2VtlRQi8GVcCcGQInfYDTHyv2zWzkw8rUfS2AkE+a6YeDsEIn 0/XVMby1ksPhe/nLd2CBFVXhVG2C2nItGKsKzCUolRMBUcnwfd VQSheF9y6x5tEUnGv0R3WSvyJwgXT8+uCEQfAaCFo6sKZ+DYZC eSBp8doPb9PEg== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131209_065414_401941_06B332C5 X-CRM114-Status: GOOD ( 12.78 ) X-Spam-Score: -1.9 (-) Cc: Greg Kroah-Hartman , Chanho Min , linux-serial@vger.kernel.org, Jongsung Kim , Russell King , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP An earlier patch "serial: pl011: use DMA RX polling by default" enabled DMA Rx polling on PL011 only in configurations, using platform data. A simple extension of that patch also enables DMA Rx polling when no platform data is used, e.g. in Device Tree configurations. In such cases a default poll timeout and an automatically calculated poll rate will be used. Signed-off-by: Guennadi Liakhovetski Acked-by: Linus Walleij --- drivers/tty/serial/amba-pl011.c | 39 ++++++++++++++++++--------------------- 1 files changed, 18 insertions(+), 21 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index e593f8d..baecdfa 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -327,28 +327,25 @@ static void pl011_dma_probe_initcall(struct device *dev, struct uart_amba_port * dmaengine_slave_config(chan, &rx_conf); uap->dmarx.chan = chan; - if (plat) { - /* Set poll rate if specified. */ - if (plat->dma_rx_poll_rate) { - uap->dmarx.auto_poll_rate = false; - uap->dmarx.poll_rate = plat->dma_rx_poll_rate; - } else { - /* - * 100 ms defaults to poll rate if not - * specified. This will be adjusted with - * the baud rate at set_termios. - */ - uap->dmarx.auto_poll_rate = true; - uap->dmarx.poll_rate = 100; - } - /* 3 secs defaults poll_timeout if not specified. */ - if (plat->dma_rx_poll_timeout) - uap->dmarx.poll_timeout = - plat->dma_rx_poll_timeout; - else - uap->dmarx.poll_timeout = 3000; - } else + /* Set poll rate if specified. */ + if (plat && plat->dma_rx_poll_rate) { uap->dmarx.auto_poll_rate = false; + uap->dmarx.poll_rate = plat->dma_rx_poll_rate; + } else { + /* + * 100 ms defaults to poll rate if not + * specified. This will be adjusted with + * the baud rate at set_termios. + */ + uap->dmarx.auto_poll_rate = true; + uap->dmarx.poll_rate = 100; + } + /* 3 secs defaults poll_timeout if not specified. */ + if (plat && plat->dma_rx_poll_timeout) + uap->dmarx.poll_timeout = + plat->dma_rx_poll_timeout; + else + uap->dmarx.poll_timeout = 3000; dev_info(uap->port.dev, "DMA channel RX %s\n", dma_chan_name(uap->dmarx.chan));