Andrew Morton wrote: >Patrick Gefre wrote: > >> Hmm odd - thanks for fixing these. I had just applied all these patches >> to a cloned tree yesterday without any problems. >> Are there some differences between that tree >> (http://linux.bkbits.net/linux-2.5) and the one you were merging ? > > >There shouldn't be. Oh well. I'd appreciate it if you could test >2.6.1-mm1 on sn2 and let me know. > OK I think I see the problem - it looks like the 000 patch was missed. Here's a replacement for it - you can apply it at the end. I built and booted and for my minimal testing it looks good. # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1504 -> 1.1505 # arch/ia64/sn/io/hwgfs/hcl_util.c 1.2 -> 1.3 # arch/ia64/sn/io/hwgfs/hcl.c 1.8 -> 1.9 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/01/09 jbarnes@attica.americas.sgi.com 1.1505 # arch/ia64/sn/io/hwgfs/hcl.c # hwgfs cleanup # some oom checks and proper error returns # arch/ia64/sn/io/hwgfs/hcl_util.c # killed some dead code # -------------------------------------------- # diff -Nru a/arch/ia64/sn/io/hwgfs/hcl.c b/arch/ia64/sn/io/hwgfs/hcl.c --- a/arch/ia64/sn/io/hwgfs/hcl.c Fri Jan 9 15:20:56 2004 +++ b/arch/ia64/sn/io/hwgfs/hcl.c Fri Jan 9 15:20:56 2004 @@ -23,41 +23,16 @@ #include #include #include -#include #include #include #include -#define HCL_NAME "SGI-HWGRAPH COMPATIBILITY DRIVER" -#define HCL_TEMP_NAME "HCL_TEMP_NAME_USED_FOR_HWGRAPH_VERTEX_CREATE" -#define HCL_TEMP_NAME_LEN 44 -#define HCL_VERSION "1.0" - #define vertex_hdl_t hwgfs_handle_t + vertex_hdl_t hwgraph_root; vertex_hdl_t linux_busnum; - extern int pci_bus_cvlink_init(void); - -/* - * Debug flag definition. - */ -#define OPTION_NONE 0x00 -#define HCL_DEBUG_NONE 0x00000 -#define HCL_DEBUG_ALL 0x0ffff -#if defined(CONFIG_HCL_DEBUG) -static unsigned int hcl_debug_init __initdata = HCL_DEBUG_NONE; -#endif -static unsigned int hcl_debug = HCL_DEBUG_NONE; -#if defined(CONFIG_HCL_DEBUG) && !defined(MODULE) -static unsigned int boot_options = OPTION_NONE; -#endif - -invplace_t invplace_none = { - GRAPH_VERTEX_NONE, - GRAPH_VERTEX_PLACE_NONE, - NULL -}; +unsigned long hwgraph_debug_mask; /* * init_hcl() - Boot time initialization. @@ -71,11 +46,6 @@ extern int init_hwgfs_fs(void); int rv = 0; - if (IS_RUNNING_ON_SIMULATOR()) { - extern u64 klgraph_addr[]; - klgraph_addr[0] = 0xe000003000030000; - } - init_hwgfs_fs(); /* @@ -108,7 +78,6 @@ } /* - * Initialize the ifconfgi_net driver that does network devices * Persistent Naming. */ init_ioconfig_bus(); @@ -116,50 +85,6 @@ return 0; } - -/* - * hcl_setup() - Process boot time parameters if given. - * "hcl=" - * This routine gets called only if "hcl=" is given in the - * boot line and before init_hcl(). - * - * We currently do not have any boot options .. when we do, - * functionalities can be added here. - * - */ -static int __init hcl_setup(char *str) -{ - while ( (*str != '\0') && !isspace (*str) ) - { -#ifdef CONFIG_HCL_DEBUG - if (strncmp (str, "all", 3) == 0) { - hcl_debug_init |= HCL_DEBUG_ALL; - str += 3; - } else - return 0; -#endif - if (*str != ',') return 0; - ++str; - } - - return 1; - -} - -__setup("hcl=", hcl_setup); - - -/* - * Set device specific "fast information". - * - */ -void -hwgraph_fastinfo_set(vertex_hdl_t de, arbitrary_info_t fastinfo) -{ - labelcl_info_replace_IDX(de, HWGRAPH_FASTINFO, fastinfo, NULL); -} - - /* * Get device specific "fast information". * @@ -185,25 +110,6 @@ /* - * hwgraph_connectpt_set - Sets the connect point handle in de to the - * given connect_de handle. By default, the connect point of the - * node is the parent. This effectively changes this assumption. - */ -int -hwgraph_connectpt_set(vertex_hdl_t de, vertex_hdl_t connect_de) -{ - int rv; - - if (!de) - return(-1); - - rv = labelcl_info_connectpt_set(de, connect_de); - - return(rv); -} - - -/* * hwgraph_connectpt_get: Returns the entry's connect point. * */ @@ -407,39 +313,6 @@ return(0); } -#if 0 -/* - * hwgraph_edge_add - This routines has changed from the original conext. - * All it does now is to create a symbolic link from "from" to "to". - */ -/* ARGSUSED */ -int -hwgraph_edge_add(vertex_hdl_t from, vertex_hdl_t to, char *name) -{ - - char *path, *link; - vertex_hdl_t handle = NULL; - int rv, i; - - handle = hwgfs_find_handle(from, name, 0, 0, 0, 1); - if (handle) { - return(0); - } - - path = kmalloc(1024, GFP_KERNEL); - memset(path, 0x0, 1024); - link = kmalloc(1024, GFP_KERNEL); - memset(path, 0x0, 1024); - i = hwgfs_generate_path (to, link, 1024); - rv = hwgfs_mk_symlink (from, (const char *)name, - DEVFS_FL_DEFAULT, link, - &handle, NULL); - return(0); - - -} -#endif - int hwgraph_edge_add(vertex_hdl_t from, vertex_hdl_t to, char *name) { @@ -452,8 +325,14 @@ int i, count; path = kmalloc(1024, GFP_KERNEL); + if (!path) + return -ENOMEM; memset((char *)path, 0x0, 1024); link = kmalloc(1024, GFP_KERNEL); + if (!link) { + kfree(path); + return -ENOMEM; + } memset((char *)link, 0x0, 1024); i = hwgfs_generate_path (from, path, 1024); @@ -710,39 +589,6 @@ } /* - * hwgraph_path_to_vertex - Return the entry handle for the given - * pathname .. assume traverse symlinks too!. - */ -vertex_hdl_t -hwgraph_path_to_vertex(char *path) -{ - return(hwgfs_find_handle(NULL, /* start dir */ - path, /* path */ - 0, /* major */ - 0, /* minor */ - 0, /* char | block */ - 1)); /* traverse symlinks */ -} - -/* - * hwgraph_inventory_remove - Removes an inventory entry. - * - * Remove an inventory item associated with a vertex. It is the caller's - * responsibility to make sure that there are no races between removing - * inventory from a vertex and simultaneously removing that vertex. -*/ -int -hwgraph_inventory_remove( vertex_hdl_t de, - int class, - int type, - major_t controller, - minor_t unit, - int state) -{ - return(0); /* Just a Stub for IRIX code. */ -} - -/* * Find the canonical name for a given vertex by walking back through * connectpt's until we hit the hwgraph root vertex (or until we run * out of buffer space or until something goes wrong). @@ -791,32 +637,58 @@ char * vertex_to_name(vertex_hdl_t vhdl, char *buf, unsigned int buflen) { - if (hwgraph_vertex_name_get(vhdl, buf, buflen) == GRAPH_SUCCESS) - return(buf); - else - return(DEVNAME_UNKNOWN); + if (hwgraph_vertex_name_get(vhdl, buf, buflen) == GRAPH_SUCCESS) + return(buf); + else + return(DEVNAME_UNKNOWN); } -graph_error_t -hwgraph_edge_remove(vertex_hdl_t from, char *name, vertex_hdl_t *toptr) -{ - return(GRAPH_ILLEGAL_REQUEST); -} -graph_error_t -hwgraph_vertex_unref(vertex_hdl_t vhdl) +void +hwgraph_debug(char *file, char * function, int line, vertex_hdl_t vhdl1, vertex_hdl_t vhdl2, char *format, ...) { - return(GRAPH_ILLEGAL_REQUEST); -} + int pos; + char *hwpath; + va_list ap; + + if ( !hwgraph_debug_mask ) + return; + + hwpath = kmalloc(MAXDEVNAME, GFP_KERNEL); + if (!hwpath) { + printk("HWGRAPH_DEBUG kmalloc fails at %d ", __LINE__); + return; + } + + printk("HWGRAPH_DEBUG %s %s %d : ", file, function, line); + + if (vhdl1){ + memset(hwpath, 0, MAXDEVNAME); + pos = hwgfs_generate_path(vhdl1, hwpath, MAXDEVNAME); + printk("vhdl1 = %s : ", &hwpath[pos]); + } + + if (vhdl2){ + memset(hwpath, 0, MAXDEVNAME); + pos = hwgfs_generate_path(vhdl2, hwpath, MAXDEVNAME); + printk("vhdl2 = %s :", &hwpath[pos]); + } + + memset(hwpath, 0, MAXDEVNAME); + va_start(ap, format); + vsnprintf(hwpath, 500, format, ap); + va_end(ap); + hwpath[MAXDEVNAME -1] = (char)0; /* Just in case. */ + printk(" %s", hwpath); + kfree(hwpath); +} EXPORT_SYMBOL(hwgraph_mk_dir); EXPORT_SYMBOL(hwgraph_path_add); EXPORT_SYMBOL(hwgraph_register); EXPORT_SYMBOL(hwgraph_vertex_destroy); EXPORT_SYMBOL(hwgraph_fastinfo_get); -EXPORT_SYMBOL(hwgraph_fastinfo_set); -EXPORT_SYMBOL(hwgraph_connectpt_set); EXPORT_SYMBOL(hwgraph_connectpt_get); EXPORT_SYMBOL(hwgraph_info_add_LBL); EXPORT_SYMBOL(hwgraph_info_remove_LBL); diff -Nru a/arch/ia64/sn/io/hwgfs/hcl_util.c b/arch/ia64/sn/io/hwgfs/hcl_util.c --- a/arch/ia64/sn/io/hwgfs/hcl_util.c Fri Jan 9 15:20:56 2004 +++ b/arch/ia64/sn/io/hwgfs/hcl_util.c Fri Jan 9 15:20:56 2004 @@ -13,10 +13,8 @@ #include #include #include -#include #include #include -#include #include #include @@ -114,6 +112,7 @@ } } + /* ** If the specified device represents a node, return its ** compact node ID; otherwise, return CNODEID_NONE. @@ -152,25 +151,11 @@ (void)hwgraph_edge_add( hwgraph_all_cnodes, vhdl, cnodeid_buffer); + HWGRAPH_DEBUG((__FILE__, __FUNCTION__, __LINE__, hwgraph_all_cnodes, NULL, "Creating path vhdl1\n")); } } /* -** If the specified device represents a CPU, return its cpuid; -** otherwise, return CPU_NONE. -*/ -cpuid_t -cpuvertex_to_cpuid(vertex_hdl_t vhdl) -{ - arbitrary_info_t cpuid = CPU_NONE; - - (void)labelcl_info_get_LBL(vhdl, INFO_LBL_CPUID, NULL, &cpuid); - - return((cpuid_t)cpuid); -} - - -/* ** dev_to_name converts a vertex_hdl_t into a canonical name. If the vertex_hdl_t ** represents a vertex in the hardware graph, it is converted in the ** normal way for vertices. If the vertex_hdl_t is an old vertex_hdl_t (one which @@ -187,5 +172,4 @@ { return(vertex_to_name(dev, buf, buflen)); } -