[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <45C1E57A.40502@pobox.com>
Date: Thu, 01 Feb 2007 08:04:58 -0500
From: Jeff Garzik <jgarzik@...ox.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
CC: Francois Romieu <romieu@...zoreil.com>, netdev@...r.kernel.org,
Andrew Morton <akpm@...l.org>, Bernhard Walle <bwalle@...e.de>
Subject: Re: [PATCH] r8169: fix a race between PCI probe and dev_open
Linus Torvalds wrote:
>
> On Wed, 31 Jan 2007, Francois Romieu wrote:
>
>> Call chain:
>> -> rtl8169_init_one
>> -> register_netdev (dev_open starts to race...)
>> -> rtl8169_init_phy
>> -> rtl8169_set_speed
>> -> tp->set_speed
>> -> mod_timer(&tp->timer, ...) (if netif_running() is true)
>>
>> As netif_running() is true just before dev->open() is issued and the
>> timer is initialized during dev->open, mod_timer() meets an uninitialized
>> tp->timer and oopses.
>
> Doesn't this basically mean that *any* use of "rtl8169_set_speed()" is
> buggy?
No, just the first use, after which the one-time initialization occurs.
> Anyway, I'm going to wait for somebody smarter than me to ACK this patch.
> Jeff?
I would rather have something more like the attached patch, which
initializes the timer with the rest of the private-struct
initialization. Just like most other net drivers do.
And Herbert Xu wrote:
> Does rtl8169_init_phy need to occur after register_netdev? Normally
> register_netdev should be the very last thing in a probe routine.
Quite correct.
So... anybody wanna test my patch (didn't compile it, but it looks
right) and confirm that it fixes things?
Jeff
View attachment "patch" of type "text/plain" (891 bytes)
Powered by blists - more mailing lists