Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755247AbYJHKQV (ORCPT ); Wed, 8 Oct 2008 06:16:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753618AbYJHKQI (ORCPT ); Wed, 8 Oct 2008 06:16:08 -0400 Received: from smarthost01.mail.zen.net.uk ([212.23.3.140]:53658 "EHLO smarthost01.mail.zen.net.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752974AbYJHKQH (ORCPT ); Wed, 8 Oct 2008 06:16:07 -0400 Date: Wed, 8 Oct 2008 11:16:00 +0100 From: Ben Hutchings To: Andreas Oberritter Cc: Jeff Garzik , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] 8139too: move wmb before TX DMA start Message-ID: <20081008101558.GH7331@solarflare.com> References: <48EC64E1.5070806@linuxtv.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48EC64E1.5070806@linuxtv.org> User-Agent: Mutt/1.4.1i X-Originating-Smarthost01-IP: [82.69.137.158] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1203 Lines: 33 Andreas Oberritter wrote: > From: Andreas Oberritter > > 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 > > 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/