From patchwork Fri Jul 1 08:52:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 934902 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p618qGrR015434 for ; Fri, 1 Jul 2011 08:52:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755632Ab1GAIwP (ORCPT ); Fri, 1 Jul 2011 04:52:15 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:51949 "EHLO relmlor3.renesas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755542Ab1GAIwO (ORCPT ); Fri, 1 Jul 2011 04:52:14 -0400 Received: from relmlir3.idc.renesas.com ([10.200.68.153]) by relmlor3.idc.renesas.com ( SJSMS) with ESMTP id <0LNN00567CN1NOA0@relmlor3.idc.renesas.com>; Fri, 01 Jul 2011 17:52:13 +0900 (JST) Received: from relmlac1.idc.renesas.com ([10.200.69.21]) by relmlir3.idc.renesas.com ( SJSMS) with ESMTP id <0LNN0027SCN1IPH0@relmlir3.idc.renesas.com>; Fri, 01 Jul 2011 17:52:13 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 53D1B80088; Fri, 01 Jul 2011 17:52:13 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 4F65380086; Fri, 01 Jul 2011 17:52:13 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id TAK19075; Fri, 01 Jul 2011 17:52:13 +0900 X-IronPort-AV: E=Sophos; i="4.65,456,1304262000"; d="scan'208"; a="34880491" Received: from unknown (HELO [172.30.8.157]) ([172.30.8.157]) by relmlii2.idc.renesas.com with ESMTP; Fri, 01 Jul 2011 17:52:13 +0900 Message-id: <4E0D8ABD.9030102@renesas.com> Date: Fri, 01 Jul 2011 17:52:13 +0900 From: Yoshihiro Shimoda User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-version: 1.0 To: davem@davemloft.net Cc: netdev@vger.kernel.org, SH-Linux Subject: [PATCH] net: sh_eth: remove __flush_purge_region Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 01 Jul 2011 08:52:16 +0000 (UTC) It is a function of SuperH architecture. There is no good to use the function on a driver generally. So, the driver uses dma_map_single() instead of __flush_purge_region. Signed-off-by: Yoshihiro Shimoda --- drivers/net/sh_eth.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index 8a72a97..09b5aa8 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c @@ -33,7 +33,6 @@ #include #include #include -#include #include "sh_eth.h" @@ -864,6 +863,8 @@ static int sh_eth_txfree(struct net_device *ndev) break; /* Free the original skb. */ if (mdp->tx_skbuff[entry]) { + dma_unmap_single(&ndev->dev, txdesc->addr, + txdesc->buffer_length, DMA_TO_DEVICE); dev_kfree_skb_irq(mdp->tx_skbuff[entry]); mdp->tx_skbuff[entry] = NULL; freeNum++; @@ -1487,13 +1488,12 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev) entry = mdp->cur_tx % TX_RING_SIZE; mdp->tx_skbuff[entry] = skb; txdesc = &mdp->tx_ring[entry]; - txdesc->addr = virt_to_phys(skb->data); /* soft swap. */ if (!mdp->cd->hw_swap) sh_eth_soft_swap(phys_to_virt(ALIGN(txdesc->addr, 4)), skb->len + 2); - /* write back */ - __flush_purge_region(skb->data, skb->len); + txdesc->addr = dma_map_single(&ndev->dev, skb->data, skb->len, + DMA_TO_DEVICE); if (skb->len < ETHERSMALL) txdesc->buffer_length = ETHERSMALL; else