netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/CFT] de2104x fixes
       [not found] <200311212051.32352.russell@coker.com.au>
@ 2003-11-21 18:50 ` Jeff Garzik
  2003-11-25 12:57   ` Rask Ingemann Lambertsen
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Garzik @ 2003-11-21 18:50 UTC (permalink / raw)
  To: russell; +Cc: Linux Kernel, rask, akpm, netdev

[-- Attachment #1: Type: text/plain, Size: 247 bytes --]

So, can people give this a test?  It includes a change that, I hope, 
addresses Russell's problem, as well as a patch from Rask.

	Jeff


P.S.  It would be great if people cc'd me on such bug reports ;-) 
Quicker to find and respond, these days.


[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 1792 bytes --]

===== drivers/net/tulip/de2104x.c 1.25 vs edited =====
--- 1.25/drivers/net/tulip/de2104x.c	Thu Sep 11 18:46:11 2003
+++ edited/drivers/net/tulip/de2104x.c	Fri Nov 21 13:48:17 2003
@@ -28,8 +28,8 @@
  */
 
 #define DRV_NAME		"de2104x"
-#define DRV_VERSION		"0.6"
-#define DRV_RELDATE		"Sep 1, 2003"
+#define DRV_VERSION		"0.9"
+#define DRV_RELDATE		"Nov 21, 2003"
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -1380,18 +1380,18 @@
 		return rc;
 	}
 
-	rc = de_init_hw(de);
+	rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev);
 	if (rc) {
-		printk(KERN_ERR "%s: h/w init failure, err=%d\n",
-		       dev->name, rc);
+		printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n",
+		       dev->name, dev->irq, rc);
 		goto err_out_free;
 	}
 
-	rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev);
+	rc = de_init_hw(de);
 	if (rc) {
-		printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n",
-		       dev->name, dev->irq, rc);
-		goto err_out_hw;
+		printk(KERN_ERR "%s: h/w init failure, err=%d\n",
+		       dev->name, rc);
+		goto err_out_free_irq;
 	}
 
 	netif_start_queue(dev);
@@ -1399,10 +1399,8 @@
 
 	return 0;
 
-err_out_hw:
-	spin_lock_irqsave(&de->lock, flags);
-	de_stop_hw(de);
-	spin_unlock_irqrestore(&de->lock, flags);
+err_out_free_irq:
+	free_irq (dev->irq, dev);
 
 err_out_free:
 	de_free_rings(de);
@@ -1571,13 +1569,17 @@
 	    (ecmd->advertising == de->media_advertise))
 		return 0; /* nothing to change */
 	    
-	de_link_down(de);
-	de_stop_rxtx(de);
+	if (netif_running(dev)) {
+		de_link_down(de);
+		de_stop_rxtx(de);
+	}
 	
 	de->media_type = new_media;
 	de->media_lock = media_lock;
 	de->media_advertise = ecmd->advertising;
-	de_set_media(de);
+
+	if (netif_running(dev))
+		de_set_media(de);
 	
 	return 0;
 }

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

* Re: [PATCH/CFT] de2104x fixes
  2003-11-21 18:50 ` [PATCH/CFT] de2104x fixes Jeff Garzik
@ 2003-11-25 12:57   ` Rask Ingemann Lambertsen
  0 siblings, 0 replies; 2+ messages in thread
From: Rask Ingemann Lambertsen @ 2003-11-25 12:57 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Linux Kernel, akpm, netdev

[-- Attachment #1: Type: text/plain, Size: 550 bytes --]

On Fri, Nov 21, 2003 at 01:50:24PM -0500, Jeff Garzik wrote:
> So, can people give this a test?  It includes a change that, I hope, 
> addresses Russell's problem, as well as a patch from Rask.

I have attached a patch which fixes two problems I found during compilation:
1) de_open() no longer uses the flags variable because the spinlocking is
   gone, but I forgot to remove the variable.
2) __de_set_settings() now references dev which is undefined.

The patch should be applied on top of your patch, Jeff.

-- 
Regards,
Rask Ingemann Lambertsen

[-- Attachment #2: de2104x-fix-for-jeff.patch --]
[-- Type: text/plain, Size: 874 bytes --]

--- linux-2.6.0-test8/drivers/net/tulip/de2104x.c-orig	Tue Nov 25 13:20:25 2003
+++ linux-2.6.0-test8/drivers/net/tulip/de2104x.c	Tue Nov 25 13:20:25 2003
@@ -1384,7 +1384,6 @@ static int de_open (struct net_device *d
 {
 	struct de_private *de = dev->priv;
 	int rc;
-	unsigned long flags;
 
 	if (netif_msg_ifup(de))
 		printk(KERN_DEBUG "%s: enabling interface\n", dev->name);
@@ -1601,7 +1600,7 @@ static int __de_set_settings(struct de_p
 	    (ecmd->advertising == de->media_advertise))
 		return 0; /* nothing to change */
 	    
-	if (netif_running(dev)) {
+	if (netif_running(de->dev)) {
 		de_link_down(de);
 		de_stop_rxtx(de);
 	}
@@ -1610,7 +1609,7 @@ static int __de_set_settings(struct de_p
 	de->media_lock = media_lock;
 	de->media_advertise = ecmd->advertising;
 
-	if (netif_running(dev))
+	if (netif_running(de->dev))
 		de_set_media(de);
 	
 	return 0;

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

end of thread, other threads:[~2003-11-25 12:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200311212051.32352.russell@coker.com.au>
2003-11-21 18:50 ` [PATCH/CFT] de2104x fixes Jeff Garzik
2003-11-25 12:57   ` Rask Ingemann Lambertsen

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).