netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] e100 oops in 2.4.20
@ 2003-02-05  8:12 Michael Rozhavsky
  2003-02-05  8:22 ` Michael Rozhavsky
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Rozhavsky @ 2003-02-05  8:12 UTC (permalink / raw)
  To: linux.nics; +Cc: netdev

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

Hi,

In 2.4.20 with CONFIG_NET_CARRIER_NETLINK compiled when I'm loading e100
module I'm receiving consistent OOPS.

The reason for this is e100_update_link_state() on device init calls to
netif_carrier_on() or netif_carrier_off() while dev->carrier_task is not
initialized yet (will be initialized on register_netdev) and thus it
causes NULL pointer exception.

[<c8adbfc8>] e100_find_speed_duplex
[<c8adc46d>] e100_auto_neg
[<c8adc4bd>] e100_phy_set_speed_duplex
[<c8adc5b2>] e100_phy_set_loopback
[<c8ad6ddb>] e100_hw_init
[<c8ad6d61>] e100_init
[<c8ad62d8>] e100_found1

I'm not sure that my fix is elegant but it works for me.


--
  Michael Rozhavsky
  Senior Software Engineer
  MRV International
  Tel: +972 (4) 993-6248
  Fax: +972 (4) 989-0564
  http://www.mrv.com

[-- Attachment #2: e100_phy.c.diff --]
[-- Type: text/plain, Size: 760 bytes --]

--- linux-2.4.20/drivers/net/e100/e100_phy.c	2002-11-29 01:53:13.000000000 +0200
+++ linux-2.4.20-test/drivers/net/e100/e100_phy.c	2003-02-05 09:38:07.000000000 +0200
@@ -963,14 +963,16 @@
 
 	/* Logical AND PHY link & netif_running */
 	link = e100_get_link_state(bdp) && netif_running(bdp->device);
-
-	if (link) {
-		if (!netif_carrier_ok(bdp->device))
-			netif_carrier_on(bdp->device);
-	} else {
-		if (netif_carrier_ok(bdp->device))
-			netif_carrier_off(bdp->device);
-	}
+#ifdef CONFIG_NET_CARRIER_NETLINK
+	if (bdp->device->carrier_task)
+#endif
+		if (link) {
+			if (!netif_carrier_ok(bdp->device))
+				netif_carrier_on(bdp->device);
+		} else {
+			if (netif_carrier_ok(bdp->device))
+				netif_carrier_off(bdp->device);
+		}
 
 	return link;
 }

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

* Re: [PATCH] e100 oops in 2.4.20
  2003-02-05  8:12 [PATCH] e100 oops in 2.4.20 Michael Rozhavsky
@ 2003-02-05  8:22 ` Michael Rozhavsky
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Rozhavsky @ 2003-02-05  8:22 UTC (permalink / raw)
  To: linux.nics; +Cc: netdev

Please ignore this message.

On Wed, Feb 05, 2003 at 10:12:10AM +0200, Michael Rozhavsky wrote:
> Hi,
> 
> In 2.4.20 with CONFIG_NET_CARRIER_NETLINK compiled when I'm loading e100
> module I'm receiving consistent OOPS.
> 
> The reason for this is e100_update_link_state() on device init calls to
> netif_carrier_on() or netif_carrier_off() while dev->carrier_task is not
> initialized yet (will be initialized on register_netdev) and thus it
> causes NULL pointer exception.
> 
> [<c8adbfc8>] e100_find_speed_duplex
> [<c8adc46d>] e100_auto_neg
> [<c8adc4bd>] e100_phy_set_speed_duplex
> [<c8adc5b2>] e100_phy_set_loopback
> [<c8ad6ddb>] e100_hw_init
> [<c8ad6d61>] e100_init
> [<c8ad62d8>] e100_found1
> 
> I'm not sure that my fix is elegant but it works for me.
> 
> 
> --
>   Michael Rozhavsky
>   Senior Software Engineer
>   MRV International
>   Tel: +972 (4) 993-6248
>   Fax: +972 (4) 989-0564
>   http://www.mrv.com

> --- linux-2.4.20/drivers/net/e100/e100_phy.c	2002-11-29 01:53:13.000000000 +0200
> +++ linux-2.4.20-test/drivers/net/e100/e100_phy.c	2003-02-05 09:38:07.000000000 +0200
> @@ -963,14 +963,16 @@
>  
>  	/* Logical AND PHY link & netif_running */
>  	link = e100_get_link_state(bdp) && netif_running(bdp->device);
> -
> -	if (link) {
> -		if (!netif_carrier_ok(bdp->device))
> -			netif_carrier_on(bdp->device);
> -	} else {
> -		if (netif_carrier_ok(bdp->device))
> -			netif_carrier_off(bdp->device);
> -	}
> +#ifdef CONFIG_NET_CARRIER_NETLINK
> +	if (bdp->device->carrier_task)
> +#endif
> +		if (link) {
> +			if (!netif_carrier_ok(bdp->device))
> +				netif_carrier_on(bdp->device);
> +		} else {
> +			if (netif_carrier_ok(bdp->device))
> +				netif_carrier_off(bdp->device);
> +		}
>  
>  	return link;
>  }

--
  Michael Rozhavsky
  Senior Software Engineer
  MRV International
  Tel: +972 (4) 993-6248
  Fax: +972 (4) 989-0564
  http://www.mrv.com

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

end of thread, other threads:[~2003-02-05  8:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-05  8:12 [PATCH] e100 oops in 2.4.20 Michael Rozhavsky
2003-02-05  8:22 ` Michael Rozhavsky

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