From patchwork Thu Mar 23 12:01:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 9640931 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 35080601E9 for ; Thu, 23 Mar 2017 12:02:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 270D9284D6 for ; Thu, 23 Mar 2017 12:02:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BE24284E9; Thu, 23 Mar 2017 12:02:27 +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 8B1BD284D6 for ; Thu, 23 Mar 2017 12:02:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932751AbdCWMCQ (ORCPT ); Thu, 23 Mar 2017 08:02:16 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:56424 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932702AbdCWMCO (ORCPT ); Thu, 23 Mar 2017 08:02:14 -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 <0ON9006N6O3MNN20@mailout1.w1.samsung.com>; Thu, 23 Mar 2017 12:02:10 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170323120209eucas1p2310a9133fc035c4521a4e0342807ed8a~ugSajuKUS2009820098eucas1p24; Thu, 23 Mar 2017 12:02:09 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1.samsung.com (EUCPMTA) with SMTP id B9.F2.16908.449B3D85; Thu, 23 Mar 2017 12:02:12 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170323120208eucas1p28df58f312314337e9750d23930de733b~ugSZ6Hxo92013020130eucas1p28; Thu, 23 Mar 2017 12:02:08 +0000 (GMT) X-AuditID: cbfec7ef-f79d26d00000420c-e0-58d3b94499b9 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 1C.EC.10233.059B3D85; Thu, 23 Mar 2017 12:02:24 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ON900MNEO3FD5A0@eusync3.samsung.com>; Thu, 23 Mar 2017 12:02:08 +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 v2 1/2] serial: samsung: Use right device for DMA-mapping calls Date: Thu, 23 Mar 2017 13:01:52 +0100 Message-id: <1490270519-4046-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrBIsWRmVeSWpSXmKPExsWy7djP87ouOy9HGDybx2GxccZ6VovmxevZ LCbdn8Bi8eLeRRaL8+c3sFvMOL+PyeLM4l52i7VH7rJbHH7Tz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ffxcj J5ApJnHh3no2EFtIYAmjxNYNrl2MXEB2E5PE5wOv2UESbAKGEl1vu8CKRAScJWafXcgEUsQs 0MwssXPvayaQhLCAv8TFNYdYQGwWAVWJC18Ps4LYvALuEjvPrWSD2CYncfLYZNYJjNwLGBlW MYqklhbnpucWG+kVJ+YWl+al6yXn525iBIbttmM/t+xg7HoXfIhRgINRiYd3Q92lCCHWxLLi ytxDjBIczEoivI+2X44Q4k1JrKxKLcqPLyrNSS0+xGgKtHwis5Rocj4wpvJK4g1NDM0tDY2M LSzMjYyUxHmnfrgSLiSQnliSmp2aWpBaBNPHxMEp1cCYLM/cmJVy4wbr8tfVGrMfd6wOflza l3LaNp1HuT/8kLJqfjqLRvqEhE5Rd4f13Be3mm0q+GkndtBwrv+UytVMrvzFohcfJoT08NSI TDs3M3jlmr0zbFhc2e/vUlgSxL55h3vJChcXu5paFt8LXpc5C/NDJRTuS2g/qjofmfv3pZNs nugdGyWW4oxEQy3mouJEAMqMkbZxAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170323120208eucas1p28df58f312314337e9750d23930de733b X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 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: 20170323120208eucas1p28df58f312314337e9750d23930de733b X-RootMTR: 20170323120208eucas1p28df58f312314337e9750d23930de733b 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: 62c37eedb74c8 ("serial: samsung: add dma reqest/release functions") CC: stable@vger.kernel.org # v4.0+ Signed-off-by: Marek Szyprowski Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Krzysztof Kozlowski --- v2: - fixed commit id in 'fixes' tag, added 'reviewed-by' tag --- 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;