Skip to contentSkip to conversation

b44 needs to reclaim its interrupt after swsusp

PATCH Pavel Machek 2 participants 3 messages Apr 21, 2004 – Apr 22, 2004 Network drivers

lore
Share & tools
lore
#0 lore raw

Hi!

b44 needs to free/reclaim its interrupt across suspend in order to work. This patch makes it work, but I'm not quite sure why its needed. Interrupt is listed as IO-APIC-level in /proc/interupts.

Pavel

drivers/net/b44.c +6 -1
@@ -1251,7 +1251,7 @@
 }
 
 #if 0
-/*static*/ void b44_dump_state(struct b44 *bp)
+void b44_dump_state(struct b44 *bp)
 {
 	u32 val32, val32_2, val32_3, val32_4, val32_5;
 	u16 val16;
@@ -1874,6 +1874,8 @@
 	b44_free_rings(bp);
 
 	spin_unlock_irq(&bp->lock);
+
+	free_irq(dev->irq, dev);
 	return 0;
 }
 
@@ -1887,6 +1889,9 @@
 
 	pci_restore_state(pdev, bp->pci_cfg_state);
 
+	if (request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev))
+		printk("b44: request_irq failed\n");
+
 	spin_lock_irq(&bp->lock);
 
 	b44_init_rings(bp);
Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#1 lore raw
Quoted 29 lines · Pavel Machek

Hi!

b44 needs to free/reclaim its interrupt across suspend in order to work. This patch makes it work, but I'm not quite sure why its needed. Interrupt is listed as IO-APIC-level in /proc/interupts.

Pavel

drivers/net/b44.c +3 -1
@@ -1251,7 +1251,7 @@
 }
 
 #if 0
-/*static*/ void b44_dump_state(struct b44 *bp)
+void b44_dump_state(struct b44 *bp)
 {
 	u32 val32, val32_2, val32_3, val32_4, val32_5;
 	u16 val16;
@@ -1874,6 +1874,8 @@
 	b44_free_rings(bp);
 
 	spin_unlock_irq(&bp->lock);
+
+	free_irq(dev->irq, dev);
 	return 0;
 }
 

drivers/net/b44.c line 1894

Quoted 6 lines
drivers/net/b44.c +3 -0
@@ -1887,6 +1889,9 @@
 
 	pci_restore_state(pdev, bp->pci_cfg_state);
 
+	if (request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev))
+		printk("b44: request_irq failed\n");
+

look ok, with minor nit: use KERN_xxx prefix in printk

#2 lore raw

Hi!

Quoted 11 lines
Quoted 11 lines
(quoted diff) +2 -0
@@ -1874,6 +1874,8 @@
 	b44_free_rings(bp);
 
 	spin_unlock_irq(&bp->lock);
+
+	free_irq(dev->irq, dev);
 	return 0;
 }
 
@@ -1887,6 +1889,9 @@
 
Quoted 7 lines

Review line 1894

Quoted 5 lines
(quoted diff) +3 -0
 	pci_restore_state(pdev, bp->pci_cfg_state);
 
+	if (request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev))
+		printk("b44: request_irq failed\n");
+

look ok, with minor nit: use KERN_xxx prefix in printk

Fixed, here's updated patch, please apply,
Pavel

drivers/net/b44.c renamed from linux/drivers/net/b44.c +6 -1
@@ -1252,7 +1252,7 @@
 }
 
 #if 0
-/*static*/ void b44_dump_state(struct b44 *bp)
+void b44_dump_state(struct b44 *bp)
 {
 	u32 val32, val32_2, val32_3, val32_4, val32_5;
 	u16 val16;
@@ -1875,6 +1875,8 @@
 	b44_free_rings(bp);
 
 	spin_unlock_irq(&bp->lock);
+
+	free_irq(dev->irq, dev);
 	return 0;
 }
 
@@ -1888,6 +1890,9 @@
 
 	pci_restore_state(pdev, bp->pci_cfg_state);
 
+	if (request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev))
+		printk(KERN_ERR PFX "%s: request_irq failed\n", dev->name);
+
 	spin_lock_irq(&bp->lock);
 
 	b44_init_rings(bp);
Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]