px_fm.c revision f41150baf74bdaf964ddfe42d865d3c2380b3623
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * CDDL HEADER START
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * The contents of this file are subject to the terms of the
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * Common Development and Distribution License (the "License").
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * You may not use this file except in compliance with the License.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * or http://www.opensolaris.org/os/licensing.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * See the License for the specific language governing permissions
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * and limitations under the License.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * When distributing Covered Code, include this CDDL HEADER in each
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * If applicable, add the following below this CDDL HEADER, with the
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * fields enclosed by brackets "[]" replaced with your own identifying
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * information: Portions Copyright [yyyy] [name of copyright owner]
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * CDDL HEADER END
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * Use is subject to license terms.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy#pragma ident "%Z%%M% %I% %E% SMI"
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy * PX Fault Management Architecture
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy (PCIE_AER_UCE_DLP | PCIE_AER_UCE_FCP | PCIE_AER_UCE_TO | \
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy PCIE_AER_UCE_RO | PCIE_AER_UCE_MTLP | PCIE_AER_UCE_ECRC)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy (PCIE_AER_UCE_TRAINING | PCIE_AER_UCE_SD | PCIE_AER_UCE_CA | \
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * Global panicing state variabled used to control if further error handling
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * should occur. If the system is already panic'ing or if PX itself has
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * recommended panic'ing the system, no further error handling should occur to
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * prevent the system from hanging.
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedystatic int px_pcie_ptlp(dev_info_t *dip, ddi_fm_error_t *derr,
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedystatic void px_pcie_log(dev_info_t *dip, px_err_pcie_t *regs);
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy#else /* DEBUG */
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy#endif /* DEBUG */
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * Initialize px FMA support
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy px_p->px_fm_cap = DDI_FM_EREPORT_CAPABLE | DDI_FM_ERRCB_CAPABLE |
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy DDI_FM_ACCCHK_CAPABLE | DDI_FM_DMACHK_CAPABLE;
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy * Initialize pci_target_queue for FMA handling of
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * check parents' capability
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy ddi_fm_init(dip, &px_p->px_fm_cap, &px_p->px_fm_ibc);
return (DDI_SUCCESS);
switch (fflag) {
case DDI_FLAGERR_ACC:
case DDI_CAUTIOUS_ACC :
static uint64_t
return (addr_low);
int i, acc_type = 0;
int range_len;
return (DDI_FM_FATAL);
return (DDI_FM_FATAL);
if (base_addr) {
case PCI_ADDR_CONFIG:
case PCI_ADDR_IO:
case PCI_ADDR_MEM64:
case PCI_ADDR_MEM32:
if (!acc_type) {
return (DDI_FM_OK);
bdf);
if (!px_die)
return (DDI_FM_OK);
return (DDI_FM_FATAL);
return (DDI_FM_OK);
return (DDI_FM_NONFATAL);
goto done;
ue_source = 0;
ce_source = 0;
NULL);
done:
return (DDI_INTR_CLAIMED);
int fab_err = 0;
return (fab_err);
switch (acctype) {
case DDI_FM_ERR_EXPECTED:
case DDI_FM_ERR_POKE:
membar_sync();
case DDI_FM_ERR_PEEK:
return (PX_PANIC);
return (PX_NO_PANIC);
return (PX_NO_ERROR);
#if defined(DEBUG)
return (PX_PANIC);
goto done;
goto done;
switch (tlp_cmd) {
case PCIE_TLP_TYPE_CPL:
case PCIE_TLP_TYPE_CPLLK:
case PCIE_TLP_TYPE_IO:
case PCIE_TLP_TYPE_MEM:
case PCIE_TLP_TYPE_MEMLK:
bdf);
done:
static pf_data_t *
if (idx > 0) {
return (pfd_p);
const void *arg2)
return (status);
const void *arg2)
int range_len;
if (range_addr) {
case PCI_ADDR_IO:
case PCI_ADDR_MEM64:
case PCI_ADDR_MEM32:
return (status);
const void *arg2)
return (status);
return (DDI_FAILURE);
return (DDI_FAILURE);
if (px_panicing) {
return (DDI_FAILURE);
return (DDI_SUCCESS);
if (panicstr) {
goto fabric;
if (!isTest)