Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp354317imm; Wed, 29 Aug 2018 01:32:40 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZto3F8K2rdWB10II7oEfmCiU4+w3eF9MLb7gcKbf9tm1Iq45k59V5Rp0yarZ7VE7pnd8k4 X-Received: by 2002:a63:c347:: with SMTP id e7-v6mr4874936pgd.240.1535531560378; Wed, 29 Aug 2018 01:32:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535531560; cv=none; d=google.com; s=arc-20160816; b=aUHsRYRXiT7u8t5tL10FvMJJHdDDq4Q5v7AMGMx6xz2fViJgppEfXpDeP+PPvoIIDw cQtpXT9upcR/KeAsJereWoU3RZypKiTqUeghK/oFbSSuKHHEkIyMJanQfsaeAgZ29djf LVt1E2HQmJhxpnT6g6tdo8fL3FxX+dVnqpabUNWbX9ywLAqvR9VjQxvs7VxmOofZx7g4 KNsScW9hTVSv8dyjIodeif8VIhui2wS94ENCNuFapY0Z1u0PpwycG8HeGc7Bc1tjSIqa gNCmzRiKF8u3ltzgOkWMUOah4z8o4KLuDRvMZhGnQHvH6Mt0YM1Zgdp3kxRG5CSIWpNW QJHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=jm4BaL0NQFhNa+A1ISRcyLK+GL21wNHApx6exQXongI=; b=RNKFHu42ihH3UoNqWL1Zul6USAvthlfCiGdgJEwo4RTQgIlrpEvnJkSiDziBXUCUwl u2k8em3eei6HS/+Qtgc4oT6gd+UOwdmXuZLBO8U874XapbFczZLn6nRxioykBqJ0gje/ 9Sy4VQr4z9yCo9S/W6cYrc0xlwMrhdqS5L7pV8fbQmpMyR/wQq0eaBtxl+MjEIZ8scBG AxuzE74/mgSghnUN4MNWfUrMdbWBksSeDmP8Tta094I7mkYgsYIy+qiBn8qKaNQOsA/1 eh6gCPXQdzJzIb869kwqMQXwPWtNYR56EWmsQ+xd3sCwMUoxG66on87b0cfF6slyQm1O bPzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=wG+Eta2a; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e125-v6si3187518pgc.424.2018.08.29.01.32.25; Wed, 29 Aug 2018 01:32:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=wG+Eta2a; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728167AbeH2M0r (ORCPT + 99 others); Wed, 29 Aug 2018 08:26:47 -0400 Received: from mail-eopbgr690078.outbound.protection.outlook.com ([40.107.69.78]:48160 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727245AbeH2M0r (ORCPT ); Wed, 29 Aug 2018 08:26:47 -0400 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" Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Lunn , Gregory CLEMENT , linux-arm-kernel@lists.infradead.org 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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:fQx6B7owvOshMs6bwmGj73eyFiZvPCJfTs9WS2Y2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hrNc5MgeBDHeqyfEHiLf5fhnPmedgjK7p8ts41aoFoD9hh9f/2qZGy7yKwOkefMPv7XfSGl+QDmHzcU+vJXD7ooYra70DhYEl1q7E2zFcH+7juMSgQHf4i9+pPXYK8qWbwHmlJ1PnZCzGCLfGlVl72ddTW6tPz8vBQ1yQlhix1zVvBO8FxDz0pneo5PLAPJaNakvw+QxFhsNdXQDcm2GFKpXKOIU3wWuojPQYt0n38tsVWAANGp/zXDroSs/Mb44YpFItehaQQFrEjzXqOWOMonoUi3Wf27X93+uwkeJwN90m9AJKjk/OSb;4:Oh+ZRBTLiD8lccKB6pCikHSRWcFInUXOBxj064njxVOBy96FU213r3S1MHcXxmtPy7VQt6QwJHEizqM/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;BY2PR0301MB1573;23:19zp3OzJpsvA+vIzDjWHucuIO5jP30pRrTNFIh4?= =?us-ascii?Q?4/+022ldvRLYh3/iP2KIVVns24MgroBEL69XWYbS7GT4tM234eCRx8xTsn8k?= =?us-ascii?Q?EaexxUUMYxIERRWuDWdJVFjy0262GvMg8rL2V/Jc0FX9hJo6jf9CS9ytHaE6?= =?us-ascii?Q?vtRMyUTGRDm0k0qd60FbRT/v8iZcccNFAakTRqh7+KVyYjPw9xt9SkMPMahy?= =?us-ascii?Q?nM6TEU/EDv4oE9Ay9F3JWIgCMX8RSH3x8BVXI7uIZsGbZ+crNSzrpLNoeTW2?= =?us-ascii?Q?2/XUaalltfDjwzOyK6CFFDltuLOqbhT2Em314zO2KVewTVt7PnkjA0KjYQt9?= =?us-ascii?Q?eXMhkOAVpw0F476zfP1Lz2XIFc9n6qeM+Lauz5u/HeRvCKWJJNSa9fdMKOrM?= =?us-ascii?Q?RQbaFN1gmFaEVEzp7SIzu3yssGuuIRBHp7gcqLYrP1xGcaSAskdCh1W+M3hu?= =?us-ascii?Q?LrAAyzFZoQKcKuLnLe6qgdkE6BNDOLKlviMh9YjLSxQmvINjLk46U9918qjV?= =?us-ascii?Q?MBnivYvHFHHADD1A+zudjDYJCny2PiA6nJwWZ0LyhSv7c6GnKQ0EOz38hcch?= =?us-ascii?Q?QWxOPsHoO0dM4rctLdnHUOF7tdG2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adata: 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.18.0