From patchwork Sat Nov 29 20:44:17 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francois Romieu X-Patchwork-Id: 11423 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 9D05CDDDCA for ; Sun, 30 Nov 2008 07:44:47 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752458AbYK2Uon (ORCPT ); Sat, 29 Nov 2008 15:44:43 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752401AbYK2Uom (ORCPT ); Sat, 29 Nov 2008 15:44:42 -0500 Received: from electric-eye.fr.zoreil.com ([213.41.134.224]:40877 "EHLO electric-eye.fr.zoreil.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751270AbYK2Uom (ORCPT ); Sat, 29 Nov 2008 15:44:42 -0500 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by electric-eye.fr.zoreil.com (8.14.2/8.14.1) with ESMTP id mATKiHFF008617; Sat, 29 Nov 2008 21:44:17 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.14.2/8.14.2/Submit) id mATKiHkH008616; Sat, 29 Nov 2008 21:44:17 +0100 Date: Sat, 29 Nov 2008 21:44:17 +0100 From: Francois Romieu To: Alan Cox Cc: netdev@vger.kernel.org Subject: Re: Realtek 8169 problems with net booting Message-ID: <20081129204416.GA6401@electric-eye.fr.zoreil.com> References: <20081124181456.66a967d2@lxorguk.ukuu.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20081124181456.66a967d2@lxorguk.ukuu.org.uk> X-Organisation: Land of Sunshine Inc. User-Agent: Mutt/1.5.18 (2008-05-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Alan Cox : > On one box here it has always been the case that now and then the boot > with crash just after r8169 is loaded iff the BIOS network rom (ie the > dhcp stuff) is enabled. Its erratic, hard to reproduce but I finally got > around to looking at the driver and have a question that seems to apply > to several network drivers [...] > The master bit is off when the driver is loaded it appears but surely the > driver should do > > twiddle a few bits > soft reset chip > pci_set_master You are right. Can you try the attached patch against 2.6.28-rc6 and tell if it makes a difference or not ? While I did not test it in a BIOS network boot configuration it did not crash trivially with these devices: RTL8168b/8111b / XID 38000000 RTL8110s / XID 04000000 Note to others: this patch needs testing with different chipsets (XID) before being included upstream. --- Ueimor From 67a7da6ddf8d2f8ca7f0be04a8d70e77e2dc7285 Mon Sep 17 00:00:00 2001 From: Francois Romieu Date: Sat, 29 Nov 2008 20:54:18 +0100 Subject: [PATCH] r8169: enable bus mastering after the chipset is reset Based on a suggestion by Alan Cox. Signed-off-by: Francois Romieu --- drivers/net/r8169.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 4b7cb38..b5a7358 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c @@ -2011,8 +2011,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) } } - pci_set_master(pdev); - /* ioremap MMIO region */ ioaddr = ioremap(pci_resource_start(pdev, region), R8169_REGS_SIZE); if (!ioaddr) { @@ -2039,6 +2037,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) msleep_interruptible(1); } + pci_set_master(pdev); + /* Identify chip attached to board */ rtl8169_get_mac_version(tp, ioaddr);