mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 4/5] macb: implement alloc_packet & free_packet
Date: Sun, 4 Mar 2012 13:08:41 +0100	[thread overview]
Message-ID: <20120304120841.GR3852@pengutronix.de> (raw)
In-Reply-To: <1330712410-26479-4-git-send-email-plagnioj@jcrosoft.com>

On Fri, Mar 02, 2012 at 07:20:09PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> We need to have a non cached buffer.
> Need when MMU enabled.
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  drivers/net/macb.c |   19 ++++++++++++++++---
>  1 files changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> index d79da72..9b54afa 100644
> --- a/drivers/net/macb.c
> +++ b/drivers/net/macb.c
> @@ -50,6 +50,7 @@
>  #include <mach/board.h>
>  #include <linux/clk.h>
>  #include <linux/err.h>
> +#include <asm/mmu.h>
>  
>  #include "macb.h"
>  
> @@ -391,6 +392,16 @@ static int macb_set_ethaddr(struct eth_device *edev, unsigned char *adr)
>  	return 0;
>  }
>  
> +static void *macb_alloc_packet(struct eth_device* edev)
> +{
> +	return dma_alloc_coherent(PKTSIZE);
> +}
> +
> +static void macb_free_packet(struct eth_device* edev, void *packet)
> +{
> +	dma_free_coherent(packet, PKTSIZE);
> +}

Why don't you use dma_flush_range/dma_clean_range like we do in other
drivers?

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-03-04 12:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02 18:20 [PATCH 1/5] net: use net_alloc_packet to allocate packet Jean-Christophe PLAGNIOL-VILLARD
2012-03-02 18:20 ` [PATCH 2/5] net: introduce net_free_packet to free the packet Jean-Christophe PLAGNIOL-VILLARD
2012-03-02 18:20 ` [PATCH 3/5] net: allow the drivers to specify the tx buffer allocator Jean-Christophe PLAGNIOL-VILLARD
2012-03-02 18:20 ` [PATCH 4/5] macb: implement alloc_packet & free_packet Jean-Christophe PLAGNIOL-VILLARD
2012-03-04 12:08   ` Sascha Hauer [this message]
2012-03-05 17:55     ` Jean-Christophe PLAGNIOL-VILLARD
2012-03-02 18:20 ` [PATCH 5/5] macb: add timeout on send Jean-Christophe PLAGNIOL-VILLARD
2012-03-06  8:29   ` Sascha Hauer
2012-03-07  9:21     ` Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120304120841.GR3852@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=plagnioj@jcrosoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox