[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080827192656.GA27499@electric-eye.fr.zoreil.com>
Date: Wed, 27 Aug 2008 21:26:56 +0200
From: Francois Romieu <romieu@...zoreil.com>
To: Stephen Hemminger <shemminger@...tta.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] 8139too: fix improper usage of workqueue
Stephen Hemminger <shemminger@...tta.com> :
> This driver was confused about how workqueue's work. It is save to
> schedule multiple times, and the flag (bitfield) was unnecessary and racy.
static void rtl8139_start_thread(struct rtl8139_private *tp)
{
tp->twistie = 0;
if (tp->chipset == CH_8139_K)
tp->twistie = 1;
else if (tp->drv_flags & HAS_LNK_CHNG)
return;
^^^^^^^
tp->have_thread = 1;
The use of the thread was dependent on RTL8129_CAPS. Now it will be
scheduled in the tx_timeout handler for RTL8139_CAPS too.
Speaking of race, the bitfield ('have_thread') is initialized through
rtl8139_open
-> rtl8139_start_thread
Do you mean that the tx_timeout handler can kick before the bitfield
is set ?
> The workqueue was never canceled either, so it is possible that the thread
> could run after driver was removes [OOPS].
The driver uses flush_scheduled_work() when the pci device is removed.
Where would the workqueue be scheduled after / during the removal ?
--
Ueimor
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists