Skip to contentSkip to conversation

Fix dead 21041 ethernet after ifconfig down

PATCH Applied Thomas Bogendoerfer 3 participants 3 messages Sep 12, 2008 – Sep 13, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix dead 21041 ethernet after ifconfig down

The de2104x did a pci_disable_device() in it's close function, but the open function never does a pci_enable_device() and assumes that the device is already enabled. Considering that downing the interface is just a temporary thing the pci_disable_device() isn't a pretty good idea and removing it from the close function just fixes the bug.

---

 drivers/net/tulip/de2104x.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/net/tulip/de2104x.c +0 -1
index 9281d06..f54c450 100644
@@ -1418,7 +1418,6 @@ static int de_close (struct net_device *dev)
 
 	de_free_rings(de);
 	de_adapter_sleep(de);
-	pci_disable_device(de->pdev);
 	return 0;
 }
 
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Thomas Bogendoerfer

The de2104x did a pci_disable_device() in it's close function, but the open function never does a pci_enable_device() and assumes that the device is already enabled. Considering that downing the interface is just a temporary thing the pci_disable_device() isn't a pretty good idea and removing it from the close function just fixes the bug.

Thomas,
Thanks for the patch!

The de2104 driver is calling pci_enable_device() in it's .probe routine and calls pci_disable_device in it's .remove function.
It never occurred to me a NIC driver would call either pci function from someplace else as well.

Quoted 1 line
Quoted 17 lines

---

 drivers/net/tulip/de2104x.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/net/tulip/de2104x.c +0 -1
index 9281d06..f54c450 100644
@@ -1418,7 +1418,6 @@ static int de_close (struct net_device *dev)
 
 	de_free_rings(de);
 	de_adapter_sleep(de);
-	pci_disable_device(de->pdev);
 	return 0;
 }
 
Applied
#2 lore raw
Quoted 30 lines · Grant Grundler
Quoted 5 lines · Thomas Bogendoerfer

The de2104x did a pci_disable_device() in it's close function, but the open function never does a pci_enable_device() and assumes that the device is already enabled. Considering that downing the interface is just a temporary thing the pci_disable_device() isn't a pretty good idea and removing it from the close function just fixes the bug.

Thomas,
Thanks for the patch!

The de2104 driver is calling pci_enable_device() in it's .probe routine and calls pci_disable_device in it's .remove function.
It never occurred to me a NIC driver would call either pci function from someplace else as well.

Quoted 1 line
Quoted 11 lines

---

 drivers/net/tulip/de2104x.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/net/tulip/de2104x.c +0 -0
index 9281d06..f54c450 100644
@@ -1418,7 +1418,6 @@ static int de_close (struct net_device *dev)
 
Quoted 3 lines

drivers/net/tulip/de2104x.c static int de_close (struct net_device *dev) · line 1421

Quoted 3 lines
drivers/net/tulip/de2104x.c +0 -1
 	de_free_rings(de);
 	de_adapter_sleep(de);
-	pci_disable_device(de->pdev);

applied