diff options
author | Stephen Hanson <Stephen.Hanson@Sun.COM> | 2010-06-14 02:22:19 -0700 |
---|---|---|
committer | Stephen Hanson <Stephen.Hanson@Sun.COM> | 2010-06-14 02:22:19 -0700 |
commit | e58a33b62cd4c9a6815fd752ce58b5f389289da1 (patch) | |
tree | 00800f7caff390a4939df0c6d22abc0387e6875c /usr/src/uts/common | |
parent | 4a0fa5460e94a33980ceffce0ba3db8802570449 (diff) | |
download | illumos-joyent-e58a33b62cd4c9a6815fd752ce58b5f389289da1.tar.gz |
6935604 io-retire should prevent attach of faulty persistent devices
6930157 Remove fmadm's reliance on taking topo snapshots
6881991 SMART faults could preserve asc/ascq in fault payload
6955664 eversholt matching should not be performed for scsi-device nodes
6958085 defect.sunos.fmd.module not visible via fmadm faulty
6958856 fmd performance issue if "fmstat -m" called while disgnosis going on
Diffstat (limited to 'usr/src/uts/common')
-rw-r--r-- | usr/src/uts/common/os/devcfg.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/usr/src/uts/common/os/devcfg.c b/usr/src/uts/common/os/devcfg.c index 2b3314bd13..8b8ec8477d 100644 --- a/usr/src/uts/common/os/devcfg.c +++ b/usr/src/uts/common/os/devcfg.c @@ -166,6 +166,12 @@ int driver_conf_allow_path_alias = 1; */ int identify_9e = 0; +/* + * Add flag so behaviour of preventing attach for retired persistant nodes + * can be disabled. + */ +int retire_prevents_attach = 1; + int mtc_off; /* turn off mt config */ int quiesce_debug = 0; @@ -213,7 +219,7 @@ static void ndi_devi_exit_and_wait(dev_info_t *dip, int circular, clock_t end_time); static int ndi_devi_unbind_driver(dev_info_t *dip); -static void i_ddi_check_retire(dev_info_t *dip); +static int i_ddi_check_retire(dev_info_t *dip); static void quiesce_one_device(dev_info_t *, void *); @@ -1560,7 +1566,17 @@ i_ndi_config_node(dev_info_t *dip, ddi_node_state_t state, uint_t flag) i_ddi_set_node_state(dip, DS_PROBED); break; case DS_PROBED: - i_ddi_check_retire(dip); + /* + * If node is retired and persistent, then prevent + * attach. We can't do this for non-persistent nodes + * as we would lose evidence that the node existed. + */ + if (i_ddi_check_retire(dip) == 1 && + ndi_dev_is_persistent_node(dip) && + retire_prevents_attach == 1) { + rv = DDI_FAILURE; + break; + } atomic_add_long(&devinfo_attach_detach, 1); if ((rv = attach_node(dip)) == DDI_SUCCESS) i_ddi_set_node_state(dip, DS_ATTACHED); @@ -8579,7 +8595,7 @@ mark_and_fence(dev_info_t *dip, void *arg) * To be called only by framework attach code on first attach attempt. * */ -static void +static int i_ddi_check_retire(dev_info_t *dip) { char *path; @@ -8611,8 +8627,10 @@ i_ddi_check_retire(dev_info_t *dip) */ if (e_ddi_device_retired(path) == 0) { RIO_VERBOSE((CE_NOTE, "device is NOT retired: path=%s", path)); + if (DEVI(dip)->devi_flags & DEVI_RETIRED) + (void) e_ddi_unretire_device(path); kmem_free(path, MAXPATHLEN); - return; + return (0); } RIO_DEBUG((CE_NOTE, "attach: device is retired: path=%s", path)); @@ -8638,6 +8656,7 @@ i_ddi_check_retire(dev_info_t *dip) constraint = 1; if (MDI_PHCI(dip)) mdi_phci_retire_finalize(dip, phci_only, &constraint); + return (1); } |