linux-mips
[Top] [All Lists]

Re: au1000_lowlevel_probe on au1000_eth.c

To: Rodolfo Giometti <giometti@linux.it>, linux-mips@linux-mips.org
Subject: Re: au1000_lowlevel_probe on au1000_eth.c
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Date: Thu, 29 Jun 2006 19:03:51 +0400
In-reply-to: <20060627155914.GD10595@enneenne.com>
Organization: MontaVista Software Inc.
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20060626221441.GA10595@enneenne.com> <20060627155914.GD10595@enneenne.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
Hello.

Rodolfo Giometti wrote:
On Tue, Jun 27, 2006 at 12:14:41AM +0200, Rodolfo Giometti wrote:

I notice that during sleep/wakeup au1000_lowlevel_probe() tries to
access to variables arcs_cmdline,prom_envp & Co.. This sometime does
an oops.

Here my proposal to avoid oops during wake up.

   This is against your rewrite, if I don't mistake?

Ciao,

Rodolfo

WBR, Sergei

------------------------------------------------------------------------

diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 341fdc4..c49004a 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -1419,24 +1419,25 @@ au1000_lowlevel_probe(struct net_device /* Setup some variables for quick register address access */
        if (port_num == 0)
        {
-               /* check env variables first */
- if (!get_ethernet_addr(ethaddr)) { - memcpy(au1000_mac_addr, ethaddr, sizeof(au1000_mac_addr));
-               } else {
-                       /* Check command line */
-                       argptr = prom_getcmdline();
-                       if ((pmac = strstr(argptr, "ethaddr=")) == NULL) {
- printk(KERN_INFO "%s: No mac address found\n", - ndev->name);
-                               /* use the hard coded mac addresses */
+               if (!skip_prom) {
+                       /* check env variables first */
+ if (!get_ethernet_addr(ethaddr)) { + memcpy(au1000_mac_addr, ethaddr, sizeof(au1000_mac_addr));
                        } else {
-                               str2eaddr(ethaddr, pmac + strlen("ethaddr="));
- memcpy(au1000_mac_addr, ethaddr, - sizeof(au1000_mac_addr));
+                               /* Check command line */
+                               argptr = prom_getcmdline();
+                               if ((pmac = strstr(argptr, "ethaddr=")) == 
NULL) {
+ printk(KERN_INFO "%s: No mac address found\n", + ndev->name);
+                                       /* use the hard coded mac addresses */
+                               } else {
+                                       str2eaddr(ethaddr, pmac + 
strlen("ethaddr="));
+ memcpy(au1000_mac_addr, ethaddr, + sizeof(au1000_mac_addr));
+                               }
                        }

   Hrm, wouldn't it be better to put this stuff into a separate function then?

WBR, Sergei


<Prev in Thread] Current Thread [Next in Thread>