Re: au1000_lowlevel_probe on au1000_eth.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux