From patchwork Mon Apr 3 06:21:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 96593 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1737251qgd; Sun, 2 Apr 2017 23:21:40 -0700 (PDT) X-Received: by 10.98.194.88 with SMTP id l85mr15495473pfg.55.1491200500239; Sun, 02 Apr 2017 23:21:40 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w9si13240525plk.296.2017.04.02.23.21.40; Sun, 02 Apr 2017 23:21:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751406AbdDCGVj (ORCPT + 4 others); Mon, 3 Apr 2017 02:21:39 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:40939 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751136AbdDCGVX (ORCPT ); Mon, 3 Apr 2017 02:21:23 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0ONT008BSLNL9700@mailout3.w1.samsung.com>; Mon, 03 Apr 2017 07:21:21 +0100 (BST) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170403062120eucas1p14aa6f6d4336feadd243aa1a10490d6cd~xzu_z9dH41434314343eucas1p1J; Mon, 3 Apr 2017 06:21:20 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1.samsung.com (EUCPMTA) with SMTP id 63.3A.14140.2E9E1E85; Mon, 3 Apr 2017 07:21:23 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170403062119eucas1p1fb7d0ceba0bc104d5e78cbc3343cf9fe~xzu9-KOXW1435114351eucas1p1M; Mon, 3 Apr 2017 06:21:19 +0000 (GMT) X-AuditID: cbfec7ef-f796a6d00000373c-e9-58e1e9e2bd0b Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 7A.D6.20206.2F9E1E85; Mon, 3 Apr 2017 07:21:38 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ONT006EQLNBVO80@eusync2.samsung.com>; Mon, 03 Apr 2017 07:21:19 +0100 (BST) From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Greg Kroah-Hartman , Seung-Woo Kim , Joonyoung Shim , Inki Dae , stable@vger.kernel.org Subject: [PATCH v3 2/3] serial: samsung: Add missing checks for dma_map_single failure Date: Mon, 03 Apr 2017 08:21:00 +0200 Message-id: <1491200468-28463-2-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1491200468-28463-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGIsWRmVeSWpSXmKPExsWy7djP87qPXz6MMFjQxWSxccZ6VovmxevZ LCbdn8Bi8eLeRRaL8+c3sFvMOL+PyeLM4l52i7VH7rJbHH7TzmqxYOMjRosZk1+yOXB7bFrV yeaxf+4ado++LasYPT5vkgtgieKySUnNySxLLdK3S+DKeLf5PVPBOpWKu2uuMTYwzpTvYuTk kBAwkXj7+ycThC0mceHeerYuRi4OIYFljBK73/xmh3A+M0pM65zCBNNx9+guRhAbrOr1dBcI u4FJYk5rEIjNJmAo0fW2iw3EFhFwlph9diETyCBmgf9MEgs+HWIHSQgLREhM7usCG8QioCpx 4/4sZhCbV8BDonXJa1aIZXISJ49NBrM5BTwl5u6/wQwySEKgnV3i8fXrQM0cQI6sxKYDzBD1 LhL/H6+HOlRY4tXxLewQtozE5cndLBB2P6NEU6s2hD2DUeLcW14I21ri8PGLYLuYBfgkJm2b zgwxnleio00IosRDou/9azYI21Hi2PX5rBC/z2GUWNrDP4FRZgEjwypGkdTS4tz01GJDveLE 3OLSvHS95PzcTYzA2D797/j7HYxPm0MOMQpwMCrx8Go4P4wQYk0sK67MPcQowcGsJMKrdAco xJuSWFmVWpQfX1Sak1p8iFGag0VJnJf31LUIIYH0xJLU7NTUgtQimCwTB6dUA9D820+Lc359 2yRvpK+ScORvy4b57AdCVRgSucr9vY1P3fC636W44bLXsc3sHqsy1wa93Obe68d33TcloPuo QV60L4fIfl4paTG+uw//Z+x76tjgnH+5W+7GwXOTK3UuXTijkyf9lqNuY43v8jMdWk+XnSr+ 83o+60w21ys7lvCUiknxaMcsVGIpzkg01GIuKk4EAH2foc3pAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBLMWRmVeSWpSXmKPExsVy+t/xK7qfXj6MMPjXrmixccZ6VovmxevZ LCbdn8Bi8eLeRRaL8+c3sFvMOL+PyeLM4l52i7VH7rJbHH7TzmqxYOMjRosZk1+yOXB7bFrV yeaxf+4ado++LasYPT5vkgtgiXKzyUhNTEktUkjNS85PycxLt1UKDXHTtVBSyEvMTbVVitD1 DQlSUihLzCkF8owM0ICDc4B7sJK+XYJbxrvN75kK1qlU3F1zjbGBcaZ8FyMnh4SAicTdo7sY IWwxiQv31rOB2EICSxglDlzz7WLkArKbmCQ23X3LCpJgEzCU6HrbBVYkIuAsMfvsQiaQImaB ZmaJnXtfM4EkhAUiJI5MP8ICYrMIqErcuD+LGcTmFfCQaF3ymhVim5zEyWOTwWxOAU+Juftv MENs9pA419fDPoGRdwEjwypGkdTS4tz03GIjveLE3OLSvHS95PzcTYzAUN927OeWHYxd74IP MQpwMCrx8Go4P4wQYk0sK67MPcQowcGsJMIbD4wUId6UxMqq1KL8+KLSnNTiQ4ymQEdNZJYS Tc4HxmFeSbyhiaG5paGRsYWFuZGRkjjv1A9XwoUE0hNLUrNTUwtSi2D6mDg4pRoYD9+wqbPO Pf/Yi91u1o/X8+eqtt+//1VL57Q3r6qp8zvhn/e7OjJ5DNa2Tpfwll2wjMFz7ikDlbUOCjMd tFlUfis9Mwz6I3ok5ranzBv7jRLv7PUYPqptn97edKAx7dl9nc/vJXmb64x2Mm6fWWVsPStg /+9CNv8n3pvOFjNmm144x+rrlXdciaU4I9FQi7moOBEAfC2rsosCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170403062119eucas1p1fb7d0ceba0bc104d5e78cbc3343cf9fe X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170403062119eucas1p1fb7d0ceba0bc104d5e78cbc3343cf9fe X-RootMTR: 20170403062119eucas1p1fb7d0ceba0bc104d5e78cbc3343cf9fe References: <1491200468-28463-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This patch adds missing checks for dma_map_single() failure and proper error reporting. Although this issue was harmless on ARM architecture, it is always good to use the DMA mapping API in a proper way. This patch fixes the following DMA API debug warning: WARNING: CPU: 1 PID: 3785 at lib/dma-debug.c:1171 check_unmap+0x8a0/0xf28 dma-pl330 121a0000.pdma: DMA-API: device driver failed to check map error[device address=0x000000006e0f9000] [size=4096 bytes] [mapped as single] Modules linked in: CPU: 1 PID: 3785 Comm: (agetty) Tainted: G W 4.11.0-rc1-00137-g07ca963-dirty #59 Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) [] (unwind_backtrace) from [] (show_stack+0x20/0x24) [] (show_stack) from [] (dump_stack+0x84/0xa0) [] (dump_stack) from [] (__warn+0x14c/0x180) [] (__warn) from [] (warn_slowpath_fmt+0x48/0x50) [] (warn_slowpath_fmt) from [] (check_unmap+0x8a0/0xf28) [] (check_unmap) from [] (debug_dma_unmap_page+0x98/0xc8) [] (debug_dma_unmap_page) from [] (s3c24xx_serial_shutdown+0x314/0x52c) [] (s3c24xx_serial_shutdown) from [] (uart_port_shutdown+0x54/0x88) [] (uart_port_shutdown) from [] (uart_shutdown+0xd4/0x110) [] (uart_shutdown) from [] (uart_hangup+0x9c/0x208) [] (uart_hangup) from [] (__tty_hangup+0x49c/0x634) [] (__tty_hangup) from [] (tty_ioctl+0xc88/0x16e4) [] (tty_ioctl) from [] (do_vfs_ioctl+0xc4/0xd10) [] (do_vfs_ioctl) from [] (SyS_ioctl+0x7c/0x8c) [] (SyS_ioctl) from [] (ret_fast_syscall+0x0/0x3c) Reported-by: Seung-Woo Kim Fixes: 62c37eedb74c8 ("serial: samsung: add dma reqest/release functions") CC: stable@vger.kernel.org # v4.10+ Signed-off-by: Marek Szyprowski Reviewed-by: Bartlomiej Zolnierkiewicz --- This issue was there since adding DMA support, but this patch applies cleanly only to v4.10+ kernels due to other changes in the surrounding code. v3: - moved spinlock removal to separate patch, extended commit message v2: - fixed commit id in 'fixes' tag, added 'reviewed-by' tag --- drivers/tty/serial/samsung.c | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: shuahkh@osg.samsung.com diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 9f3759bdb44f..ca0bcd7fd61f 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -859,7 +859,7 @@ static void s3c24xx_serial_break_ctl(struct uart_port *port, int break_state) static int s3c24xx_serial_request_dma(struct s3c24xx_uart_port *p) { struct s3c24xx_uart_dma *dma = p->dma; - unsigned long flags; + int ret; /* Default slave configuration parameters */ dma->rx_conf.direction = DMA_DEV_TO_MEM; @@ -884,8 +884,8 @@ static int s3c24xx_serial_request_dma(struct s3c24xx_uart_port *p) dma->tx_chan = dma_request_chan(p->port.dev, "tx"); if (IS_ERR(dma->tx_chan)) { - dma_release_channel(dma->rx_chan); - return PTR_ERR(dma->tx_chan); + ret = PTR_ERR(dma->tx_chan); + goto err_release_rx; } dmaengine_slave_config(dma->tx_chan, &dma->tx_conf); @@ -894,15 +894,17 @@ static int s3c24xx_serial_request_dma(struct s3c24xx_uart_port *p) dma->rx_size = PAGE_SIZE; dma->rx_buf = kmalloc(dma->rx_size, GFP_KERNEL); - if (!dma->rx_buf) { - dma_release_channel(dma->rx_chan); - dma_release_channel(dma->tx_chan); - return -ENOMEM; + ret = -ENOMEM; + goto err_release_tx; } dma->rx_addr = dma_map_single(p->port.dev, dma->rx_buf, dma->rx_size, DMA_FROM_DEVICE); + if (dma_mapping_error(p->port.dev, dma->rx_addr)) { + ret = -EIO; + goto err_free_rx; + } spin_lock_irqsave(&p->port.lock, flags); @@ -911,8 +913,23 @@ static int s3c24xx_serial_request_dma(struct s3c24xx_uart_port *p) UART_XMIT_SIZE, DMA_TO_DEVICE); spin_unlock_irqrestore(&p->port.lock, flags); + if (dma_mapping_error(p->port.dev, dma->tx_addr)) { + ret = -EIO; + goto err_unmap_rx; + } return 0; + +err_unmap_rx: + dma_unmap_single(p->port.dev, dma->rx_addr, dma->rx_size, + DMA_FROM_DEVICE); +err_free_rx: + kfree(dma->rx_buf); +err_release_tx: + dma_release_channel(dma->tx_chan); +err_release_rx: + dma_release_channel(dma->rx_chan); + return ret; } static void s3c24xx_serial_release_dma(struct s3c24xx_uart_port *p) From patchwork Mon Apr 3 06:21:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 96592 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1737241qgd; Sun, 2 Apr 2017 23:21:38 -0700 (PDT) X-Received: by 10.98.223.76 with SMTP id u73mr15506354pfg.147.1491200497950; Sun, 02 Apr 2017 23:21:37 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w9si13240525plk.296.2017.04.02.23.21.37; Sun, 02 Apr 2017 23:21:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751772AbdDCGVg (ORCPT + 4 others); Mon, 3 Apr 2017 02:21:36 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:46875 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751344AbdDCGVY (ORCPT ); Mon, 3 Apr 2017 02:21:24 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0ONT005KULNLUA00@mailout1.w1.samsung.com>; Mon, 03 Apr 2017 07:21:21 +0100 (BST) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170403062120eucas1p297cb6f0fc973fcc8b3e207e1cecde19f~xzu-IQy_E0795507955eucas1p2d; Mon, 3 Apr 2017 06:21:20 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 36.38.04459.0E9E1E85; Mon, 3 Apr 2017 07:21:20 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170403062120eucas1p1369bcd47ca09d99c955baa551cdb1e06~xzu_dCGBf2360123601eucas1p1p; Mon, 3 Apr 2017 06:21:20 +0000 (GMT) X-AuditID: cbfec7f1-f796e6d00000116b-46-58e1e9e05b66 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id BB.D6.20206.3F9E1E85; Mon, 3 Apr 2017 07:21:39 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ONT006EQLNBVO80@eusync2.samsung.com>; Mon, 03 Apr 2017 07:21:19 +0100 (BST) From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Greg Kroah-Hartman , Seung-Woo Kim , Joonyoung Shim , Inki Dae Subject: [PATCH v3 3/3] serial: samsung: Remove useless spinlock Date: Mon, 03 Apr 2017 08:21:01 +0200 Message-id: <1491200468-28463-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1491200468-28463-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrAIsWRmVeSWpSXmKPExsWy7djPc7oPXj6MMDj2X9Vi44z1rBbNi9ez WUy6P4HF4sW9iywW589vYLeYcX4fk8WZxb3sFmuP3GW3OPymndVixuSXbA5cHptWdbJ57J+7 ht2jb8sqRo/Pm+QCWKK4bFJSczLLUov07RK4Mj6d2sZWMJ+9ovFUF1MDYw9bFyMnh4SAicS1 zQuYIWwxiQv31gPFuTiEBJYySlw7+QzK+cwo8WrmSvYuRg6wjqMvakEahASWMUrM3eADYTcw ScxpDQKx2QQMJbredoEtEBFwlph9diETyBxmgadMErv6NzGCzBEWcJCYsKIGpIZFQFXiytzT 7CA2r4CHRNeehYwQB8lJnDw2mRXE5hTwlJi7/wYzyBwJgf9sEvuW/IC6R1Zi0wGoB1wkjmw5 CmULS7w6voUdwpaRuDy5mwXC7meUaGrVhrBnMEqce8sLYVtLHD5+EWwXswCfxKRt05khxvNK dLQJQZR4SDzrnAp1mqPEzYMPoMEzh1Hi378z7BMYZRYwMqxiFEktLc5NTy020itOzC0uzUvX S87P3cQIjOfT/45/3MH4/oTVIUYBDkYlHt4LDg8jhFgTy4orcw8xSnAwK4nwxgOTgRBvSmJl VWpRfnxRaU5q8SFGaQ4WJXFerlPXIoQE0hNLUrNTUwtSi2CyTBycUg2MdU8/3k+QDBeNFbh3 vtqnd90TjVaXl+bLGmZHK/mYhHFsMrjxmyf38irvtm/vnjWf9uXfEPXiyNJHQgu9JTitvoYr nZkW+DwlhJXxyfaAh1JzlsT9nHfW7PUCnedGvRza3SGB66ZzaGqpvd82ZTbbG+bnl3MMIxZt LVi10/R9CcPdu4mnfmb6KbEUZyQaajEXFScCALVuJgbjAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrILMWRmVeSWpSXmKPExsVy+t/xK7qfXz6MMDi/k8li44z1rBbNi9ez WUy6P4HF4sW9iywW589vYLeYcX4fk8WZxb3sFmuP3GW3OPymndVixuSXbA5cHptWdbJ57J+7 ht2jb8sqRo/Pm+QCWKLcbDJSE1NSixRS85LzUzLz0m2VQkPcdC2UFPISc1NtlSJ0fUOClBTK EnNKgTwjAzTg4BzgHqykb5fglvHp1Da2gvnsFY2nupgaGHvYuhg5OCQETCSOvqjtYuQEMsUk LtxbDxTm4hASWMIocXLlSyYIp4lJYtPdt6wgVWwChhJdb7vYQGwRAWeJ2WcXMoHYzAIvmSQO bhYEGSos4CAxYUUNSJhFQFXiytzT7CA2r4CHRNeehYwQy+QkTh6bDDaSU8BTYu7+G8wgthBQ zbm+HvYJjLwLGBlWMYqklhbnpucWG+kVJ+YWl+al6yXn525iBAb3tmM/t+xg7HoXfIhRgINR iYdXw/lhhBBrYllxZe4hRgkOZiUR3nhgbAjxpiRWVqUW5ccXleakFh9iNAU6aiKzlGhyPjDy 8kriDU0MzS0NjYwtLMyNjJTEead+uBIuJJCeWJKanZpakFoE08fEwSnVwFg+o/uL3vefriJq 5WvP/3oU3XF7xtatChW/XkmzMFzOWLs2faFqMN89Xt+dDlyFC4z61c9Jrtkr3M/x4/BVtfzn Mybo9ja6W/5ZbfXO5NjRpC+73gSc8FsU9PGRhrjdzmbD+S0KeqYqwX0FrSbMt8PnyJ2+pME9 uev8Z6WQ6NrTqrw9bLsCvZVYijMSDbWYi4oTAROTZA2EAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170403062120eucas1p1369bcd47ca09d99c955baa551cdb1e06 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170403062120eucas1p1369bcd47ca09d99c955baa551cdb1e06 X-RootMTR: 20170403062120eucas1p1369bcd47ca09d99c955baa551cdb1e06 References: <1491200468-28463-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Spinlock taken only for dma_map_single() for TX buffer is completely useless and doesn't protect anything, so remove it to simplify the code. Signed-off-by: Marek Szyprowski --- drivers/tty/serial/samsung.c | 4 ---- 1 file changed, 4 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index ca0bcd7fd61f..8aca18c4cdea 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -906,13 +906,9 @@ static int s3c24xx_serial_request_dma(struct s3c24xx_uart_port *p) goto err_free_rx; } - spin_lock_irqsave(&p->port.lock, flags); - /* TX buffer */ dma->tx_addr = dma_map_single(p->port.dev, p->port.state->xmit.buf, UART_XMIT_SIZE, DMA_TO_DEVICE); - - spin_unlock_irqrestore(&p->port.lock, flags); if (dma_mapping_error(p->port.dev, dma->tx_addr)) { ret = -EIO; goto err_unmap_rx;