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

Bug#299074: Fw: Re: SunBlade D-I problems



tags 299074 patch
thanks

That'd be the case. My system has four sbus nodes. The first one is empty
other than the socal. The hme and esp are located on the second and fourth
busses.

Let me know when you get something to test for this and I'll give it a go
on the 4500. Would prefer 2.6 netboot images.

Hi Ben,

The patch against discover1-1.7.7 source package (it actually modifies the file which goes into the libdiscover1 library package) is attached. I am CC'ing it to Joshua Kwan for review.

As discover1 is a userspace utility, it is not not included in the netboot images, but downloaded from the mirror once the installation system is booted. So, you will need a running system to test this stuff. You can either build the package using the attached patch or download the updated packages from http://www.wooyd.org/debian/bug299074/. First, run the old discover using commands like

discover --enable sbus all
discover --enable sbus --module all

The first version will print out the names of all detected devices and disks, while the second will display the names of the modules, needed by the detected devices. After that install the updated packages and run the commands again. All your sbus devices should (hopefully) be visible then.

[0] http://www.wooyd.org/debian/bug299074/

Best regards,

Jurij Smakov                                        jurij@wooyd.org
Key: http://www.wooyd.org/pgpkey/                   KeyID: C99E03CC
diff -aur a/lib/sbus.c b/lib/sbus.c
--- a/lib/sbus.c	2005-01-08 19:16:37.000000000 -0500
+++ b/lib/sbus.c	2005-03-15 22:00:59.000000000 -0500
@@ -148,7 +148,7 @@
 
 struct sbus_info *sbus_detect(struct cards_lst *lst)
 {
-  int node, root;
+  int node, child_node;
 
   if(debug) {
     fprintf(stdout, "\nProbing SBUS devices...\n");
@@ -169,38 +169,34 @@
   if(!node) return sbus_result;                 /* No root node */
   if(!prom_getchild(node)) return sbus_result;  /* No root children */
   
-  root = prom_current_node;
-
-  /* sparc64 has its sbus node in the root. */
-  node = prom_searchsiblings("sbus");
-  if (node)
-  {
-    node = prom_getchild(node);
-    if (node)
-    {
-      prom_walk(node, lst);
-      return sbus_first;
-    }
-    else
-      return sbus_result;
-  }
-  else
-  {
-    /* force return to root, it existed 1ms before, why not now */
-    prom_current_node = root;
-    
-    node = prom_searchsiblings("iommu");
-    if(!node) return sbus_result;               /* No iommu node */
-    node = prom_getchild(node);                  
-    if(!node) return sbus_result;               /* No iommu children */
+  /* sparc64 can have multiple sbus entries in the root. */
+  do {
     node = prom_searchsiblings("sbus");
-    if(!node) return sbus_result;               /* No sbus node */
-    node = prom_getchild(node);
-    if(!node) return sbus_result;               /* No sbus children */
+    if(!node) break;
+    /* prom_getchild will reset prom_current_node... */
+    child_node = prom_getchild(node);
+    if (!child_node) continue; 
+    prom_walk(child_node, lst);
+    /* ...but prom_getsibling will reset it back */
+  } while(prom_getsibling(node));
+    
+  /* On sparc32 sbus lives under iommu */
+  /* Get back to the root node */
+  node = prom_getsibling(0);
+  if(!node) return sbus_first;                  /* No root node */
+  if(!prom_getchild(node)) return sbus_first;   /* No root children */
+ 
+  node = prom_searchsiblings("iommu");
+  if(!node) return sbus_first;                /* No iommu node */
+  node = prom_getchild(node);                  
+  if(!node) return sbus_first;                /* No iommu children */
+  node = prom_searchsiblings("sbus");
+  if(!node) return sbus_first;                /* No sbus node */
+  node = prom_getchild(node);
+  if(!node) return sbus_first;                /* No sbus children */
 
-    /* prom_walk walks the sbus node children and fills out the fields */
+  /* prom_walk walks the sbus node children and fills out the fields */
 
-    prom_walk(node, lst);
-    return sbus_first;
-  }
+  prom_walk(node, lst);
+  return sbus_first;
 }

Reply to: