linux-mips
[Top] [All Lists]

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

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH] Small fix for the Sibyte Mac driver
From: Manish Lachwani <mlachwani@mvista.com>
Date: Tue, 09 Nov 2004 12:50:52 -0800
Cc: linux-mips@linux-mips.org
In-reply-to: <20041109195953.GA25337@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20041108235148.GA20991@prometheus.mvista.com> <20041109195953.GA25337@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.2) Gecko/20040308
Ralf Baechle wrote:
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

Hi Ralf

Thanks for the response. To make it really simple and avoid lot of changes to the driver code, we can continue to do sbmac_set_iphdr_offset() before the call to register_netdev() and print the "...enabling TCP rcv checksum" after register_netdev().

Since we need the driver to print the device name correctly, this change can keep things really simple :)

Thanks
Manish Lachwani


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