linux-mips
[Top] [All Lists]

Re: [PATCH] Small fix for the Sibyte Mac driver

To: Manish Lachwani <mlachwani@prometheus.mvista.com>
Subject: Re: [PATCH] Small fix for the Sibyte Mac driver
From: Ralf Baechle <ralf@linux-mips.org>
Date: Tue, 9 Nov 2004 20:59:53 +0100
Cc: linux-mips@linux-mips.org
In-reply-to: <20041108235148.GA20991@prometheus.mvista.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20041108235148.GA20991@prometheus.mvista.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.1i
On Mon, Nov 08, 2004 at 03:51:48PM -0800, Manish Lachwani wrote:

> Attached is a small patch for the Sibyte MAC Driver. This helps
> print the device name correctly

> -     /* This is needed for PASS2 for Rx H/W checksum feature */
> -     sbmac_set_iphdr_offset(sc);
> -
>       err = register_netdev(dev);
>       if (err)
>               goto out_uninit;
>  
> +     /* This is needed for PASS2 for Rx H/W checksum feature */
> +     sbmac_set_iphdr_offset(sc);
> +

Your patch introduces a race condition - the NIC needs to be fully setup
before register_netdev.  By the time register_netdev returns the driver
could possibly already be opened and traffic be flowing.  What's usually
done is using the PCI device's name as obtained through pci_name().
Which in this case fails, so maybe you should convert the driver to a
platform_device() and print platform_device->name instead.  The Titan GE
driver which I think you're familiar with already use platform_device ;-)

  Ralf

<Prev in Thread] Current Thread [Next in Thread>