From patchwork Thu Mar 10 16:16:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 550730 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73524C43219 for ; Thu, 10 Mar 2022 16:22:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239784AbiCJQXU (ORCPT ); Thu, 10 Mar 2022 11:23:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244201AbiCJQW4 (ORCPT ); Thu, 10 Mar 2022 11:22:56 -0500 Received: from mslow1.mail.gandi.net (mslow1.mail.gandi.net [217.70.178.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74E5619ABDF for ; Thu, 10 Mar 2022 08:20:43 -0800 (PST) Received: from relay6-d.mail.gandi.net (unknown [217.70.183.198]) by mslow1.mail.gandi.net (Postfix) with ESMTP id 33A7CCE164 for ; Thu, 10 Mar 2022 16:17:06 +0000 (UTC) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 139A9C0002; Thu, 10 Mar 2022 16:16:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1646929016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OI+rKHEpqRIrjR3Tah2YGtk8yTfjmktV3JYE6NKdQlQ=; b=dTs3NKGUK1vPl99yeVirt1PGt18l2hPMSM0LqG0eRCoCkiAkbPBObpQcEokGH8/FHly5ah ostyAeBni+/FxTM2Wly7YTx7ld7lsHdvCEdW4MpFD47YAsZaxyOT1zmE+yRaFUheR6LBXk KVmRJbYAm2i8XjXbef228Mg8c6vD9eeCLwhmAsK7wf9sKn5iSzVr14z9CkSsuAO9IpYvsR csAoSeqsUzZ1YYmrtJrubQbUN7ZsexWAmAa3FEbRMlBdZyq/eJuvV09UIIB11co1tamwTH W50z2dDtj9gzUhtr94eBYY1k2lpQEBfbvX+Cn3WEptro8AJ1Tw7g0y0VsXR4DA== From: Miquel Raynal To: linux-renesas-soc@vger.kernel.org, Magnus Damm , Gareth Williams , Phil Edworthy , Geert Uytterhoeven , Greg Kroah-Hartman Cc: Jiri Slaby , Andy Shevchenko , linux-serial@vger.kernel.org, Milan Stevanovic , Jimmy Lalande , Pascal Eberhard , Thomas Petazzoni , Herve Codina , Clement Leger , Miquel Raynal Subject: [PATCH 1/7] serial: 8250_dma: Use ->tx_dma function pointer to start next DMA Date: Thu, 10 Mar 2022 17:16:44 +0100 Message-Id: <20220310161650.289387-2-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220310161650.289387-1-miquel.raynal@bootlin.com> References: <20220310161650.289387-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org From: Phil Edworthy The 8250 driver is quite flexible. Regarding DMA handling, there is the possibility to either use the default helper (serial8250_tx_dma()) or call a specific function. Only the omap and brcm implementation do that. In both cases, they don't use the serial8250_tx_dma() helper at all. As we are going to write a new DMA handling function for the RZ/N1 SoCs which will use the serial8250_tx_dma() implementation (preceded by a couple of register writes), we need the ->tx_dma() pointer to link to our own function, but within the __dma_tx_complete() helper we also need to call our own implementation instead of the default one directly. In order to do that, let's call ->tx_dma() instead of serial8250_tx_dma() from __dma_tx_complete(). Signed-off-by: Phil Edworthy [miquel.raynal@bootlin.com: Re-write commit message] Signed-off-by: Miquel Raynal --- drivers/tty/serial/8250/8250_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_dma.c b/drivers/tty/serial/8250/8250_dma.c index 890fa7ddaa7f..a0563f2341ac 100644 --- a/drivers/tty/serial/8250/8250_dma.c +++ b/drivers/tty/serial/8250/8250_dma.c @@ -33,7 +33,7 @@ static void __dma_tx_complete(void *param) if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) uart_write_wakeup(&p->port); - ret = serial8250_tx_dma(p); + ret = dma->tx_dma(p); if (ret) serial8250_set_THRI(p);