From patchwork Wed Aug 29 08:27:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 10579663 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D896117DB for ; Wed, 29 Aug 2018 08:32:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C90652AAA9 for ; Wed, 29 Aug 2018 08:32:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C78DF2AB2A; Wed, 29 Aug 2018 08:32:23 +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=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 15E882AAA9 for ; Wed, 29 Aug 2018 08:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=amBxaQqVrGKu/Y1adJga1oW16ezUJRoRQP+0y/N90Js=; b=VqHpnYuN0/8hAh /E9gxNd5b6AsiztJgSiaYezyA3+5oMN7cnHjbNpp56qfYTvnYslf0VpFnYhgKNegm0ZBiKH1fkahO PKFaN6VMZimZ/RGUL2weEyrlQJ/P/u3kbqAW3wZ6UYjMt1B86kkDSR2ZcsRnRk9d5ewm+Ui1V7YZ9 UavQHAT8UFaRfbsck7nnmGRWL5CkGOeMbxbFwn98QcRtEIQnYhWtvzbec7M+EIf/RmcBdatO1mYr8 yLbM1RLBsVOxce3j1Wsx9jNf3RUxaGi6x7tZEHTPDNNDBhMxOFk/p+/MEzxIsBeildPuTRUIGU4Y5 yH1ynUSj02k6fIizGxNg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuvtc-0004Zh-MD; Wed, 29 Aug 2018 08:32:12 +0000 Received: from mail-co1nam04on0606.outbound.protection.outlook.com ([2a01:111:f400:fe4d::606] helo=NAM04-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuvsc-0004I4-Oq for linux-arm-kernel@lists.infradead.org; Wed, 29 Aug 2018 08:31:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector1-synaptics-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jm4BaL0NQFhNa+A1ISRcyLK+GL21wNHApx6exQXongI=; b=wG+Eta2axCAZbZut18vbA038uS2Djj1W8EeTO75PMauHnna6dWN7lvuFp1/uiDH1ap9CUF8+wDTC61AcUSf4wiUnLlqfTl4vxFSwvwUO3EFo+UhmgSpUeeJBGIwzOnbsXZGucZjQEYHMtz4YIB7y4EvioVwt6a4TRmLM7Iek6LA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; Received: from xhacker.debian (124.74.246.114) by BY2PR0301MB1573.namprd03.prod.outlook.com (2a01:111:e400:526e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.17; Wed, 29 Aug 2018 08:30:52 +0000 Date: Wed, 29 Aug 2018 16:27:51 +0800 From: Jisheng Zhang To: , "David S. Miller" Subject: [PATCH 2/5] net: mvneta: fix the wrong function to unmap rx buf Message-ID: <20180829162751.018acbb6@xhacker.debian> In-Reply-To: <20180829162456.2bd69796@xhacker.debian> References: <20180829162456.2bd69796@xhacker.debian> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Originating-IP: [124.74.246.114] X-ClientProxiedBy: OSAPR01CA0160.jpnprd01.prod.outlook.com (2603:1096:604:d::28) To BY2PR0301MB1573.namprd03.prod.outlook.com (2a01:111:e400:526e::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 945bfebc-4224-4d04-5707-08d60d89bcad X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BY2PR0301MB1573; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1573; 3:fQx6B7owvOshMs6bwmGj73eyFiZvPCJfTs9WS2Y2Q13SGHMg1JC+4oDQ5HZXQrS7RLfwAeHnbv/pM5DI81o8Y2QFKCeWD6NNTaUesJQW7T4OA7zrD+amS4oCsWBpSpfnawWy6LMAvPV4O/zjpHIrsjm1YyjYZCvj3kW1nLE5uCYDIEgQFWKugccth1Rh7egVp83rbjztAIPiHh70a80AXzL0UHw5vDGcKz8jtIz55zXuDEYKdpPlfwvLVAy0tUwo; 25:/XQ07x7CxfhkE/sgxD2ymR2aQNew2+hxBQ5H3NQERWLuXr9OPK2jxAczRoDyvhDyiBDAIwiEz87+SCe0rX1TV4J9X1iRd4f2FshByAVDtX9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D8lccKB6pCikHSRWcFInUXOBxj064njxVOBy96FU213r3S1MHcXxmtPy7VQt6QwJHEizqM/fGPQ8ZhtdT326TMbtw+ZI/NW8ryujQJxRTHpR/PpmtUE7HeKOb5bEdcCEmeoeBXk2ddHLYWG1Y952nXIqmJA7MgfMuYC3NMvyUnvZRDMs82K3p05ezA+pkPezrmdg3+SF95bM6Q8+wfM8Rf+F8UIOSWyTpfzU7Zvz/djm3yFyYMLddgTY6KcN/dTfEw9jgTGlY52ow== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016); SRVR:BY2PR0301MB1573; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0301MB1573; X-Forefront-PRVS: 077929D941 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(366004)(396003)(136003)(376002)(199004)(189003)(53936002)(8936002)(26005)(72206003)(52116002)(7696005)(76176011)(478600001)(33896004)(316002)(486006)(446003)(16526019)(186003)(55016002)(956004)(11346002)(476003)(50466002)(6506007)(110136005)(386003)(9686003)(86362001)(54906003)(25786009)(97736004)(5660300001)(3846002)(106356001)(105586002)(66066001)(1076002)(23726003)(50226002)(230700001)(47776003)(6116002)(4326008)(7736002)(68736007)(2906002)(305945005)(81166006)(8676002)(81156014)(39210200001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB1573; H:xhacker.debian; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: synaptics.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1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tz40iIt4wMnvVkvlynzEFFwxVOIzEgivxRTwxLUSBuHpgeC5pkhpcHuhUJKtuZQooVRoCrMF47v+wpl354KTg3Or+7S9xSfEkcOSlRYjBG1HRofbZn8cWpHe0wwUKohRPp1ucjejlmH/WIlapIYt1Vm7RpsmJYU5m6g01U=; 7:3LF+w8ozXHU+gsWSROyvaLDVsGYsizdxgrfNVDb0CvmAOwm2ZOyQ92Rsr0YkTpq4COr5AzA3lAjfdZ54S30RNQP5TyfWpKMZ7kMEOMfghQtAaxpHLXmV3E66sbxTP0h7vl6YQZQtcuGuTxtj642fgAkKDCYsRR+jP/2RhyXx/r/XlRFZnKOrNWPmY8fNpIC1Bb+74XDB7c6w3SKHwBqg/GcehmtvyDBh1O6/a12gy5EFmEClnDpft/gj2nZUo0Tb SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2018 08:30:52.5133 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 945bfebc-4224-4d04-5707-08d60d89bcad X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB1573 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180829_013111_016560_E48E52CE X-CRM114-Status: UNSURE ( 7.56 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, Gregory CLEMENT , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Andrew Lunn Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 7e47fd84b56b ("net: mvneta: Allocate page for the descriptor") always allocate one page for each rx descriptor, so the rx is mapped with dmap_map_page() now, but the unmap routine isn't updated at the same time. Fix this by using dma_unmap_page() in corresponding places. Fixes: 7e47fd84b56b ("net: mvneta: Allocate page for the descriptor") Signed-off-by: Jisheng Zhang --- drivers/net/ethernet/marvell/mvneta.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 0ce94f6587a5..d9206094fce3 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -1890,8 +1890,9 @@ static void mvneta_rxq_drop_pkts(struct mvneta_port *pp, if (!data || !(rx_desc->buf_phys_addr)) continue; - dma_unmap_single(pp->dev->dev.parent, rx_desc->buf_phys_addr, - MVNETA_RX_BUF_SIZE(pp->pkt_size), DMA_FROM_DEVICE); + dma_unmap_page(pp->dev->dev.parent, rx_desc->buf_phys_addr, + MVNETA_RX_BUF_SIZE(pp->pkt_size), + DMA_FROM_DEVICE); __free_page(data); } } @@ -2008,8 +2009,8 @@ static int mvneta_rx_swbm(struct napi_struct *napi, skb_add_rx_frag(rxq->skb, frag_num, page, frag_offset, frag_size, PAGE_SIZE); - dma_unmap_single(dev->dev.parent, phys_addr, - PAGE_SIZE, DMA_FROM_DEVICE); + dma_unmap_page(dev->dev.parent, phys_addr, + PAGE_SIZE, DMA_FROM_DEVICE); rxq->left_size -= frag_size; } } else { @@ -2039,9 +2040,8 @@ static int mvneta_rx_swbm(struct napi_struct *napi, frag_offset, frag_size, PAGE_SIZE); - dma_unmap_single(dev->dev.parent, phys_addr, - PAGE_SIZE, - DMA_FROM_DEVICE); + dma_unmap_page(dev->dev.parent, phys_addr, + PAGE_SIZE, DMA_FROM_DEVICE); rxq->left_size -= frag_size; }