Skip to contentSkip to conversation

r8169: restore mac addr in rtl8169_remove_one and rtl_shutdown

PATCH Applied Ivan Vecera 3 participants 5 messages Nov 24, 2009 – Nov 30, 2009

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

PATCH 1/1 r8169: restore mac addr in rtl8169_remove_one and rtl_shutdown

The newer chipsets (all PCI-E) are known that they need full power cycle (AC or battery removal) to reset MAC address to a hardwired one. Previous patch to address this problem loads the original MAC address from EEPROM. But it brought other problem for which it is necessary to introduce a new module parameter.
However, it might suffice to restore the initial MAC address before shutdown/reboot/kexec and when removing the module.

---
 drivers/net/r8169.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/net/r8169.c +7 -0
index b9221bd..0fe2fc9 100644
@@ -3235,6 +3235,10 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev)
 	flush_scheduled_work();
 
 	unregister_netdev(dev);
+
+	/* restore original MAC address */
+	rtl_rar_set(tp, dev->perm_addr);
+
 	rtl_disable_msi(pdev, tp);
 	rtl8169_release_board(pdev, dev, tp->mmio_addr);
 	pci_set_drvdata(pdev, NULL);
@@ -4881,6 +4885,9 @@ static void rtl_shutdown(struct pci_dev *pdev)
 
 	rtl8169_net_suspend(dev);
 
+	/* restore original MAC address */
+	rtl_rar_set(tp, dev->perm_addr);
+
 	spin_lock_irq(&tp->lock);
 
 	rtl8169_asic_down(ioaddr);
Signature · 1 line
1.6.4.4
maintainer
#1 lore raw

From: Ivan Vecera <[email protected]>
Date: Tue, 24 Nov 2009 19:26:06 +0100

Quoted 9 lines

The newer chipsets (all PCI-E) are known that they need full power cycle (AC or battery removal) to reset MAC address to a hardwired one. Previous patch to address this problem loads the original MAC address from EEPROM. But it brought other problem for which it is necessary to introduce a new module parameter.
However, it might suffice to restore the initial MAC address before shutdown/reboot/kexec and when removing the module.

Francois, any comments?

#2 lore raw

The Sun, Nov 29, 2009 at 12:21:57AM -0800, David Miller wrote :
[...]

Quoted 1 line

Francois, any comments?

It is low risk and manageable. Go for it.

The setup of my new internet connection is proving slower than expected. I am not terribly helpful yet.

Signature · 1 line
Ueimor
maintainer
#3 lore raw

From: Fran$(D+.(Bois romieu <[email protected]>
Date: Sun, 29 Nov 2009 15:39:02 +0100

Quoted 5 lines

The Sun, Nov 29, 2009 at 12:21:57AM -0800, David Miller wrote :
[...]

Quoted 1 line

Francois, any comments?

It is low risk and manageable. Go for it.

Ok, thanks for the review.

maintainer Applied
#4 lore raw
In reply to Ivan Vecera

From: Ivan Vecera <[email protected]>
Date: Tue, 24 Nov 2009 19:26:06 +0100

Quoted 9 lines

The newer chipsets (all PCI-E) are known that they need full power cycle (AC or battery removal) to reset MAC address to a hardwired one. Previous patch to address this problem loads the original MAC address from EEPROM. But it brought other problem for which it is necessary to introduce a new module parameter.
However, it might suffice to restore the initial MAC address before shutdown/reboot/kexec and when removing the module.

Applied, thanks.