archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2 1/1] r8169: fix lockdep warning when removing interface
@ 2013-07-22  7:53 Peter Wu
  2013-07-24 22:43 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Wu @ 2013-07-22  7:53 UTC (permalink / raw)
  To: netdev; +Cc: Francois Romieu, Realtek linux nic maintainers

The work queue is initialised in rtl_open (when the interface goes up),
but canceled in rtl_remove_one (when the PCI device gets removed). If
the network interface is not brought up, then the work queue struct is
not initialised. When the device is removed, the attempt to cancel the
uninitialised work queue causes a lockdep warning.

This patch fixes the issue by moving cancel_work_sync to rtl_close (to
match rtl_open). (Note that rtl_close is also called via
unregister_netdev in rtl_remove_one.)

Signed-off-by: Peter Wu <>
Acked-by: Francois Romieu <>
 drivers/net/ethernet/realtek/r8169.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c 
index 4106a74..880015c 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -6468,6 +6468,8 @@ static int rtl8169_close(struct net_device *dev)
+	cancel_work_sync(&tp->;
 	free_irq(pdev->irq, dev);
 	dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray,
@@ -6793,8 +6795,6 @@ static void rtl_remove_one(struct pci_dev *pdev)
-	cancel_work_sync(&tp->;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-24 22:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-22  7:53 [PATCH net v2 1/1] r8169: fix lockdep warning when removing interface Peter Wu
2013-07-24 22:43 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).