Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755901AbZDTNeu (ORCPT ); Mon, 20 Apr 2009 09:34:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755344AbZDTNem (ORCPT ); Mon, 20 Apr 2009 09:34:42 -0400 Received: from smtp.zeuux.org ([210.51.160.52]:57288 "EHLO z.billxu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754939AbZDTNem (ORCPT ); Mon, 20 Apr 2009 09:34:42 -0400 X-Greylist: delayed 380 seconds by postgrey-1.27 at vger.kernel.org; Mon, 20 Apr 2009 09:34:41 EDT Date: Mon, 20 Apr 2009 21:28:00 +0800 From: Amos Kong To: jon.lin@vatics.com Cc: davem@davemloft.net, dada1@cosmosbay.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2.6.29.1 1/1] 8139too: fix HW initial flow Message-ID: <20090420132800.GA9119@ubuntu> References: <0E04AEADD178614A86F3017CC5FA693B4959924809@MS.vivotek.tw> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0E04AEADD178614A86F3017CC5FA693B4959924809@MS.vivotek.tw> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1583 Lines: 29 On Mon, Apr 20, 2009 at 08:58:01PM +0800, jon.lin@vatics.com wrote: >From: Jonathan Lin > >While ifconfig eth0 up kernel calls open() of 8139 driver(8139too.c). >In rtl8139_hw_start() of rtl8139_open(), 8139 driver enable RX before setting up the DMA buffer address. In this interval where RX was enabled and DMA buffer address is not yet set up, any incoming broadcast packet would be send to a strange physical address: >0x003e8800 which is the default value of DMA buffer address. >Unfortunately, this address is used by Linux kernel. So kernel panics. >This patch fix it by setting up DMA buffer address before RX enabled and everything is fine even under broadcast packets attack. > >Signed-off-by: Jonathan Lin Reviewed-by: Amos Kong >--- linux-2.6.29.1/drivers/net/8139too.c.orig 2009-04-19 17:50:38.000000000 +0800 >+++ linux-2.6.29.1/drivers/net/8139too.c 2009-04-19 17:52:51.000000000 +0800 >@@ -1382,6 +1382,10 @@ static void rtl8139_hw_start (struct net > RTL_W32_F (MAC0 + 0, le32_to_cpu (*(__le32 *) (dev->dev_addr + 0))); > RTL_W32_F (MAC0 + 4, le16_to_cpu (*(__le16 *) (dev->dev_addr + 4))); > >+ tp->cur_rx = 0; >+ /* init Rx ring buffer DMA address BEFORE Rx enabled*/ >+ RTL_W32_F (RxBuf, tp->rx_ring_dma); >+ ... -- 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/