lkml.org 
[lkml]   [2008]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] 8139too: move wmb before TX DMA start
Andreas Oberritter wrote:
> From: Andreas Oberritter <obi@linuxtv.org>
>
> The write barrier should be used before starting a DMA transfer. This fixes
> a problem, where almost all packets received on another machine had garbled
> content. Tested with an RTL8100C on a MIPS machine.
>
> Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
>
> diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
> index 53bd903..44344af 100644
> --- a/drivers/net/8139too.c
> +++ b/drivers/net/8139too.c
> @@ -1716,13 +1716,13 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
> }
>
> spin_lock_irqsave(&tp->lock, flags);
> + wmb();
[...]

All memory barriers need a comment to explain why and what they're doing.

Ben.

--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


\
 
 \ /
  Last update: 2008-10-08 12:19    [W:0.050 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site