Mercurial > illumos > illumos-gate
changeset 6682:74a1d9f2c2d3
6704019 revert T1 IO topology to use legacy hc
6704473 revert T1 mem faults to use mem scheme
author | sd77468 |
---|---|
date | Wed, 21 May 2008 16:14:27 -0700 |
parents | cdb2ffcb28d3 |
children | 2231b144c55a |
files | usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_dimm.c usr/src/lib/fm/topo/modules/sun4v/pcibus/pci_sun4v.c usr/src/lib/fm/topo/modules/sun4v/pcibus/pci_sun4v.h |
diffstat | 3 files changed, 104 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_dimm.c Wed May 21 16:00:05 2008 -0700 +++ b/usr/src/cmd/fm/modules/sun4/cpumem-diagnosis/cmd_dimm.c Wed May 21 16:14:27 2008 -0700 @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -83,11 +83,23 @@ { #ifdef sun4v nvlist_t *flt, *nvlfru; - nvlfru = cmd_mem2hc(hdl, dimm->dimm_asru_nvl); - flt = cmd_nvl_create_fault(hdl, fltnm, cert, - dimm->dimm_asru_nvl, nvlfru, NULL); - if (nvlfru != NULL) - nvlist_free(nvlfru); + /* + * Do NOT issue hc scheme FRU FMRIs for ultraSPARC-T1 platforms. + * The SP will misinterpret the FRU. Instead, reuse the ASRU FMRI + * + * Use the BR string as a distinguisher. BR (branch) is only + * present in ultraSPARC-T2/T2plus DIMM unums + */ + if (strstr(dimm->dimm_unum, "BR") == NULL) { + flt = cmd_nvl_create_fault(hdl, fltnm, cert, + dimm->dimm_asru_nvl, dimm->dimm_asru_nvl, NULL); + } else { + nvlfru = cmd_mem2hc(hdl, dimm->dimm_asru_nvl); + flt = cmd_nvl_create_fault(hdl, fltnm, cert, + dimm->dimm_asru_nvl, nvlfru, NULL); + if (nvlfru != NULL) + nvlist_free(nvlfru); + } return (cmd_fault_add_location(hdl, flt, dimm->dimm_unum)); #else return (cmd_nvl_create_fault(hdl, fltnm, cert, dimm->dimm_asru_nvl,
--- a/usr/src/lib/fm/topo/modules/sun4v/pcibus/pci_sun4v.c Wed May 21 16:00:05 2008 -0700 +++ b/usr/src/lib/fm/topo/modules/sun4v/pcibus/pci_sun4v.c Wed May 21 16:14:27 2008 -0700 @@ -20,13 +20,15 @@ */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" #include <fm/topo_mod.h> +#include <sys/fm/protocol.h> +#include <string.h> /* * Including the following file gives us definitions of the three * global arrays used to adjust labels, Slot_Rewrites, Physlot_Names, @@ -47,6 +49,77 @@ platform_pci_fru(topo_mod_t *mod, tnode_t *node, nvlist_t *in, nvlist_t **out) { + int err = 0; + uint64_t ptr; + did_t *dp, *pdp; + tnode_t *pnode; + char *nm, *plat, *pp, **cp; + const char *label; + int found_t1plat = 0; + topo_mod_dprintf(mod, "entering platform_pci_fru\n"); - return (pci_fru_compute(mod, node, in, out)); + + if (topo_prop_get_string(node, FM_FMRI_AUTHORITY, + FM_FMRI_AUTH_PRODUCT, &plat, &err) < 0) { + (void) topo_mod_seterrno(mod, err); + return (-1); + } + /* Delete the "SUNW," */ + pp = strchr(plat, ','); + if (pp == NULL) + pp = plat; + else + ++pp; + + /* Is this an UltraSPARC-T1 platform? */ + cp = usT1_plats; + while ((*cp != NULL) && (found_t1plat == 0)) { + if (strcmp(pp, *cp) == 0) + found_t1plat = 1; + cp++; + } + + topo_mod_strfree(mod, plat); + + /* + * On UltraSPARC-T1 systems, use the legacy hc scheme on + * the adapter slots to ensure ALOM on the SP can interpret + * the FRU correctly. For everything else, follow the normal + * code flow + */ + if (found_t1plat) { + *out = NULL; + nm = topo_node_name(node); + if (strcmp(nm, PCI_DEVICE) != 0 && + strcmp(nm, PCIEX_DEVICE) != 0 && + strcmp(nm, PCIEX_BUS) != 0) + return (0); + + if (nvlist_lookup_uint64(in, "nv1", &ptr) != 0) { + topo_mod_dprintf(mod, "label method argument " + "not found.\n"); + return (-1); + } + dp = (did_t *)(uintptr_t)ptr; + pnode = did_gettnode(dp); + pdp = did_find(mod, topo_node_getspecific(pnode)); + + /* + * Is there a slotname associated with the device? + */ + if ((label = pci_slotname_lookup(mod, pnode, dp, pdp)) + != NULL) { + nvlist_t *rnvl; + char buf[PATH_MAX]; + + (void) snprintf(buf, PATH_MAX, "hc:///component=%s", + label); + if (topo_mod_str2nvl(mod, buf, &rnvl) < 0) + return (-1); + *out = rnvl; + } + return (0); + } else { + return (pci_fru_compute(mod, node, in, out)); + } }
--- a/usr/src/lib/fm/topo/modules/sun4v/pcibus/pci_sun4v.h Wed May 21 16:00:05 2008 -0700 +++ b/usr/src/lib/fm/topo/modules/sun4v/pcibus/pci_sun4v.h Wed May 21 16:14:27 2008 -0700 @@ -204,6 +204,17 @@ plats_missing }; +char *usT1_plats[] = { + "Sun-Fire-T200", + "Netra-T2000", + "SPARC-Enterprise-T1000", + "SPARC-Enterprise-T2000", + "Sun-Fire-T1000", + "Netra-CP3060", + "Sun-Blade-T6300", + NULL +}; + slotnm_rewrite_t *Slot_Rewrites = NULL; physlot_names_t *Physlot_Names = &PhyslotNMs; missing_names_t *Missing_Names = &Missing;