From patchwork Thu Mar 23 07:45:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 9640479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 91272602CA for ; Thu, 23 Mar 2017 07:46:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FC56284E8 for ; Thu, 23 Mar 2017 07:46:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 70CC527CF9; Thu, 23 Mar 2017 07:46:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C31CC27CF9 for ; Thu, 23 Mar 2017 07:46:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752486AbdCWHp5 (ORCPT ); Thu, 23 Mar 2017 03:45:57 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:35915 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752224AbdCWHpy (ORCPT ); Thu, 23 Mar 2017 03:45:54 -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 <0ON900AVMC8E3Y40@mailout3.w1.samsung.com>; Thu, 23 Mar 2017 07:45:50 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170323074549eucas1p2e91e11e08a01097f7b2db9f4eef0e29a~ucymmXxgL2940529405eucas1p2L; Thu, 23 Mar 2017 07:45:49 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges4.samsung.com (EUCPMTA) with SMTP id D5.1A.28517.D2D73D85; Thu, 23 Mar 2017 07:45:49 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170323074548eucas1p142511884e12d6211bebd9cbabde2f9c9~ucyl4Rgd11228512285eucas1p1o; Thu, 23 Mar 2017 07:45:48 +0000 (GMT) X-AuditID: cbfec7f4-f79716d000006f65-c3-58d37d2d68ab Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 8D.23.06687.89D73D85; Thu, 23 Mar 2017 07:47:36 +0000 (GMT) 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 <0ON9006HQC88AT50@eusync2.samsung.com>; Thu, 23 Mar 2017 07:45:48 +0000 (GMT) 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 1/2] serial: samsung: Use right device for DMA-mapping calls Date: Thu, 23 Mar 2017 08:45:21 +0100 Message-id: <1490255131-9597-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFIsWRmVeSWpSXmKPExsWy7djP87q6tZcjDC695LTYOGM9q0Xz4vVs FpPuT2CxeHHvIovF+fMb2C1mnN/HZHFmcS+7xdojd9kt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FyMnh4SAicS7jycZ IWwxiQv31rN1MXJxCAksYZRYdu0CK4TTxCTR9vM6E0gVm4ChRNfbLjYQW0TAWWL22YVMIEXM As3MEjv3vgYrEhbwkVixcSbYWBYBVYnnnW+YQWxeAXeJhR29TBDr5CROHpvMOoGRewEjwypG kdTS4tz03GJDveLE3OLSvHS95PzcTYzA4N127OfmHYyXNgYfYhTgYFTi4Y2ouRQhxJpYVlyZ e4hRgoNZSYTXtvByhBBvSmJlVWpRfnxRaU5q8SFGU6DlE5mlRJPzgZGVVxJvaGJobmloZGxh YW5kpCTOW/LhSriQQHpiSWp2ampBahFMHxMHp1QDY2btp1df7m/WPdm6a8Oqn/fk4906+UuS ru5dvCJiZcadN7Efbhw7tSHX5EFkj1Zi+oPc45PDBTM7U/beE+u6lu3f9zWv4qnlx/XXrswI 5//ipLpeK5cnuXm5vKz0h5mx8iXMm5/ol1vviNA3uhy4137mJ4X86IbWNs5H1QZZNvPYtfeY H6gOVGIpzkg01GIuKk4EAKPy5qd0AgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170323074548eucas1p142511884e12d6211bebd9cbabde2f9c9 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRs=?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170323074548eucas1p142511884e12d6211bebd9cbabde2f9c9 X-RootMTR: 20170323074548eucas1p142511884e12d6211bebd9cbabde2f9c9 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Driver should provide its own struct device for all DMA-mapping calls instead of extracting device pointer from DMA engine channel. Reported-by: Seung-Woo Kim Fixes: 2c37eedb74c8 ("serial: samsung: add dma reqest/release functions") CC: stable@vger.kernel.org # v4.0+ Signed-off-by: Marek Szyprowski --- drivers/tty/serial/samsung.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 7a17aedbf902..9f3759bdb44f 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -901,14 +901,13 @@ static int s3c24xx_serial_request_dma(struct s3c24xx_uart_port *p) return -ENOMEM; } - dma->rx_addr = dma_map_single(dma->rx_chan->device->dev, dma->rx_buf, + dma->rx_addr = dma_map_single(p->port.dev, dma->rx_buf, dma->rx_size, DMA_FROM_DEVICE); spin_lock_irqsave(&p->port.lock, flags); /* TX buffer */ - dma->tx_addr = dma_map_single(dma->tx_chan->device->dev, - p->port.state->xmit.buf, + 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); @@ -922,7 +921,7 @@ static void s3c24xx_serial_release_dma(struct s3c24xx_uart_port *p) if (dma->rx_chan) { dmaengine_terminate_all(dma->rx_chan); - dma_unmap_single(dma->rx_chan->device->dev, dma->rx_addr, + dma_unmap_single(p->port.dev, dma->rx_addr, dma->rx_size, DMA_FROM_DEVICE); kfree(dma->rx_buf); dma_release_channel(dma->rx_chan); @@ -931,7 +930,7 @@ static void s3c24xx_serial_release_dma(struct s3c24xx_uart_port *p) if (dma->tx_chan) { dmaengine_terminate_all(dma->tx_chan); - dma_unmap_single(dma->tx_chan->device->dev, dma->tx_addr, + dma_unmap_single(p->port.dev, dma->tx_addr, UART_XMIT_SIZE, DMA_TO_DEVICE); dma_release_channel(dma->tx_chan); dma->tx_chan = NULL;