diff options
author | Eiji Ota <Eiji.Ota@Sun.COM> | 2009-06-03 13:39:36 -0700 |
---|---|---|
committer | Eiji Ota <Eiji.Ota@Sun.COM> | 2009-06-03 13:39:36 -0700 |
commit | 332f545bce1434913a4e2bffd942656ef0906846 (patch) | |
tree | 717bc1a6b28b9da09d4953091b35e181a1164691 /usr/src | |
parent | 050fa54035f294ec6c58427086e7635a70d94e07 (diff) | |
download | illumos-joyent-332f545bce1434913a4e2bffd942656ef0906846.tar.gz |
6728711 ibnex_ioc_create_pi() and ibnex_pseudo_create_pi() shouldn't call mdi_pi_offline() in error cases
6837153 assertion failed: rc == DDI_SUCCESS, file: ../../common/os/devcfg.c, line: 4067
6841284 hermon_inter_err_chk() needs some clean-ups
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/io/ib/adapters/hermon/hermon.c | 16 | ||||
-rw-r--r-- | usr/src/uts/common/io/ib/adapters/hermon/hermon_fm.c | 13 | ||||
-rw-r--r-- | usr/src/uts/common/io/ib/adapters/tavor/tavor.c | 5 | ||||
-rw-r--r-- | usr/src/uts/common/io/ib/ibnex/ibnex.c | 4 | ||||
-rw-r--r-- | usr/src/uts/common/io/ib/ibnex/ibnex_ioctl.c | 24 |
5 files changed, 49 insertions, 13 deletions
diff --git a/usr/src/uts/common/io/ib/adapters/hermon/hermon.c b/usr/src/uts/common/io/ib/adapters/hermon/hermon.c index effda2371d..6041660d65 100644 --- a/usr/src/uts/common/io/ib/adapters/hermon/hermon.c +++ b/usr/src/uts/common/io/ib/adapters/hermon/hermon.c @@ -56,8 +56,10 @@ int hermon_verbose = 0; /* Hermon HCA State Pointer */ void *hermon_statep; -int debug_vpd = 0; +int debug_vpd = 0; +/* Disable the internal error-check polling thread */ +int hermon_no_inter_err_chk = 0; /* * The Hermon "userland resource database" is common to instances of the @@ -1659,8 +1661,11 @@ hermon_hw_init(hermon_state_t *state) /* * Invoke a polling thread to check the error buffer periodically. */ - state->hs_fm_poll_thread = ddi_periodic_add(hermon_inter_err_chk, - (void *)state, FM_POLL_INTERVAL, DDI_IPL_0); + if (!hermon_no_inter_err_chk) { + state->hs_fm_poll_thread = ddi_periodic_add( + hermon_inter_err_chk, (void *)state, FM_POLL_INTERVAL, + DDI_IPL_0); + } cleanup = HERMON_DRV_CLEANUP_LEVEL5; @@ -4622,6 +4627,11 @@ hermon_quiesce(dev_info_t *dip) /* start fastreboot */ state->hs_quiescing = B_TRUE; + /* If it's in maintenance mode, do nothing but return with SUCCESS */ + if (!HERMON_IS_OPERATIONAL(state->hs_operational_mode)) { + return (DDI_SUCCESS); + } + /* suppress Hermon FM ereports */ if (hermon_get_state(state) & HCA_EREPORT_FM) { hermon_clr_state_nolock(state, HCA_EREPORT_FM); diff --git a/usr/src/uts/common/io/ib/adapters/hermon/hermon_fm.c b/usr/src/uts/common/io/ib/adapters/hermon/hermon_fm.c index 32aeebcac6..6954cd49cd 100644 --- a/usr/src/uts/common/io/ib/adapters/hermon/hermon_fm.c +++ b/usr/src/uts/common/io/ib/adapters/hermon/hermon_fm.c @@ -926,6 +926,10 @@ hermon_init_failure(hermon_state_t *state) if (!(hermon_get_state(state) & HCA_PIO_FM)) return (B_FALSE); + /* check if fatal errors occur during attach */ + if (state->hs_fm_async_fatal) + return (B_TRUE); + hdl = hermon_get_uarhdl(state); /* Get the PIO error against UAR I/O space */ ddi_fm_acc_err_get(hdl, &derr, DDI_FME_VERSION); @@ -1448,7 +1452,14 @@ hermon_inter_err_chk(void *arg) if (word != 0) { HERMON_FMANOTE(state, HERMON_FMA_INTERNAL); - hermon_fm_ereport(state, HCA_IBA_ERR, HCA_ERR_FATAL); + /* if fm_disable is on, Hermon FM functions don't work */ + if (state->hs_fm_disable) { + cmn_err(CE_PANIC, + "Hermon Fatal Internal Error. " + "Hermon state=0x%p", (void *)state); + } else { + hermon_fm_ereport(state, HCA_IBA_ERR, HCA_ERR_FATAL); + } } /* issue the ereport pended in the interrupt context */ diff --git a/usr/src/uts/common/io/ib/adapters/tavor/tavor.c b/usr/src/uts/common/io/ib/adapters/tavor/tavor.c index 5c6570d194..9c29ddb581 100644 --- a/usr/src/uts/common/io/ib/adapters/tavor/tavor.c +++ b/usr/src/uts/common/io/ib/adapters/tavor/tavor.c @@ -3489,6 +3489,11 @@ tavor_quiesce(dev_info_t *dip) /* start fastreboot */ state->ts_quiescing = B_TRUE; + /* If it's in maintenance mode, do nothing but return with SUCCESS */ + if (!TAVOR_IS_OPERATIONAL(state->ts_operational_mode)) { + return (DDI_SUCCESS); + } + /* Shutdown HCA ports */ if (tavor_hca_ports_shutdown(state, state->ts_cfg_profile->cp_num_ports) != TAVOR_CMD_SUCCESS) { diff --git a/usr/src/uts/common/io/ib/ibnex/ibnex.c b/usr/src/uts/common/io/ib/ibnex/ibnex.c index 88c03b4f09..c0e3b942e1 100644 --- a/usr/src/uts/common/io/ib/ibnex/ibnex.c +++ b/usr/src/uts/common/io/ib/ibnex/ibnex.c @@ -1735,14 +1735,14 @@ ibnex_bus_unconfig(dev_info_t *parent, ndp; ndp = ndp->node_next) { dip = ndp->node_dip; if (dip && (ddi_driver_major(dip) == major)) { - ibnex_offline_childdip(dip); + (void) ibnex_offline_childdip(dip); } } for (ndp = ibnex.ibnex_pseudo_node_head; ndp; ndp = ndp->node_next) { dip = ndp->node_dip; if (dip && (ddi_driver_major(dip) == major)) { - ibnex_offline_childdip(dip); + (void) ibnex_offline_childdip(dip); } } } diff --git a/usr/src/uts/common/io/ib/ibnex/ibnex_ioctl.c b/usr/src/uts/common/io/ib/ibnex/ibnex_ioctl.c index 5aecb859a1..85e7386e83 100644 --- a/usr/src/uts/common/io/ib/ibnex/ibnex_ioctl.c +++ b/usr/src/uts/common/io/ib/ibnex/ibnex_ioctl.c @@ -2625,7 +2625,7 @@ ibnex_ioc_fininode(dev_info_t *dip, ibnex_ioc_node_t *ioc_nodep) int ibnex_offline_childdip(dev_info_t *dip) { - int rval = MDI_SUCCESS; + int rval = MDI_SUCCESS, rval2; mdi_pathinfo_t *path = NULL, *temp; IBTF_DPRINTF_L4("ibnex", "\toffline_childdip; begin"); @@ -2637,15 +2637,25 @@ ibnex_offline_childdip(dev_info_t *dip) for (path = mdi_get_next_phci_path(dip, path); path; ) { IBTF_DPRINTF_L4("ibnex", "\toffline_childdip: " "offling path %p", path); - rval = mdi_pi_offline(path, NDI_UNCONFIG); - if (rval != MDI_SUCCESS) { - IBTF_DPRINTF_L2("ibnex", "\toffline_childdip: " - "mdi_pi_offline failed %p", dip); - break; + rval2 = MDI_SUCCESS; + if (MDI_PI_IS_ONLINE(path)) { + rval2 = mdi_pi_offline(path, NDI_UNCONFIG); + /* If it cannot be offlined, log this path and error */ + if (rval2 != MDI_SUCCESS) { + rval = rval2; + cmn_err(CE_WARN, + "!ibnex\toffline_childdip (0x%p): " + "mdi_pi_offline path (0x%p) failed with %d", + (void *)dip, (void *)path, rval2); + } } + /* prepare the next path */ temp = path; path = mdi_get_next_phci_path(dip, path); - (void) mdi_pi_free(temp, 0); + /* free the offline path */ + if (rval2 == MDI_SUCCESS) { + (void) mdi_pi_free(temp, 0); + } } return (rval); } |