Print this page
NEX-18492 Disk can't be restored in pool if disappeared under active I/O
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
NEX-18264 devi_detach_node() should be aware that device class can be NULL
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
NEX-18214 unplug of multipathed disks doesn't produce EC_DEV_REMOVE/ESC_DISK event (fix build)
NEX-18214 unplug of multipathed disks doesn't produce EC_DEV_REMOVE/ESC_DISK event
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Revert "NEX-18214 unplug of multipathed disks doesn't produce EC_DEV_REMOVE/ESC_DISK event"
This reverts commit b0f7e47b60b115c1bb6c07dc5aa150cc519790e7.
NEX-18214 unplug of multipathed disks doesn't produce EC_DEV_REMOVE/ESC_DISK event
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Dan Fields <dan.fields@nexenta.com>
NEX-17446 cleanup of hot unplugged disks fails intermittently
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
NEX-15925 pseudonex, rootnex, and friends don't need to log useless device announcements
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
NEX-15146 Retired device is not listed after appliance reboot
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Dmitry Savitsky <dmitry.savitsky@nexenta.com>
OS-164 Add ddi property to allow device
retire to succeed when device is in use

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/devcfg.c
          +++ new/usr/src/uts/common/os/devcfg.c
↓ open down ↓ 10 lines elided ↑ open up ↑
  11   11   * and limitations under the License.
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
       21 +
  21   22  /*
  22   23   * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  23      - * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
  24   24   * Copyright 2012 Garrett D'Amore <garrett@damore.org>.  All rights reserved.
  25   25   * Copyright (c) 2013, Joyent, Inc. All rights reserved.
       26 + * Copyright 2018 Nexenta Systems, Inc.
  26   27   * Copyright (c) 2016 by Delphix. All rights reserved.
  27   28   */
  28   29  
  29   30  #include <sys/note.h>
  30   31  #include <sys/t_lock.h>
  31   32  #include <sys/cmn_err.h>
  32   33  #include <sys/instance.h>
  33   34  #include <sys/conf.h>
  34   35  #include <sys/stat.h>
  35   36  #include <sys/ddi.h>
↓ open down ↓ 128 lines elided ↑ open up ↑
 164  165  /* Allow path-oriented alias driver binding on driver.conf enumerated nodes */
 165  166  int driver_conf_allow_path_alias = 1;
 166  167  
 167  168  /*
 168  169   * The following switch is for service people, in case a
 169  170   * 3rd party driver depends on identify(9e) being called.
 170  171   */
 171  172  int identify_9e = 0;
 172  173  
 173  174  /*
 174      - * Add flag so behaviour of preventing attach for retired persistant nodes
 175      - * can be disabled.
      175 + * Don't prevent attaching retired devices by default.
 176  176   */
 177      -int retire_prevents_attach = 1;
      177 +int retire_prevents_attach = 0;
 178  178  
 179  179  int mtc_off;                                    /* turn off mt config */
 180  180  
 181  181  int quiesce_debug = 0;
 182  182  
 183  183  boolean_t ddi_aliases_present = B_FALSE;
 184  184  ddi_alias_t ddi_aliases;
 185  185  uint_t tsd_ddi_redirect;
 186  186  
 187  187  #define DDI_ALIAS_HASH_SIZE     (2700)
↓ open down ↓ 290 lines elided ↑ open up ↑
 478  478          ASSERT(devi->devi_ct_count == -1);
 479  479          ASSERT(list_is_empty(&(devi->devi_ct)));
 480  480          cv_destroy(&(devi->devi_ct_cv));
 481  481          list_destroy(&(devi->devi_ct));
 482  482          /* free this last since contract_device_remove_dip() uses it */
 483  483          mutex_destroy(&(devi->devi_ct_lock));
 484  484          RIO_TRACE((CE_NOTE, "i_ddi_free_node: destroyed all contract fields: "
 485  485              "dip=%p, name=%s", (void *)dip, devi->devi_node_name));
 486  486  
 487  487          kmem_free(devi->devi_node_name, strlen(devi->devi_node_name) + 1);
 488      -
 489      -        /* free event data */
 490      -        if (devi->devi_ev_path)
 491      -                kmem_free(devi->devi_ev_path, MAXPATHLEN);
 492      -
 493  488          kmem_cache_free(ddi_node_cache, devi);
 494  489  }
 495  490  
 496  491  
 497  492  /*
 498  493   * Node state transitions
 499  494   */
 500  495  
 501  496  /*
 502  497   * Change the node name
↓ open down ↓ 850 lines elided ↑ open up ↑
1353 1348   */
1354 1349  static int
1355 1350  detach_node(dev_info_t *dip, uint_t flag)
1356 1351  {
1357 1352          struct devnames *dnp;
1358 1353          int             rv;
1359 1354  
1360 1355          ASSERT(DEVI_BUSY_OWNED(ddi_get_parent(dip)));
1361 1356          ASSERT(i_ddi_node_state(dip) == DS_ATTACHED);
1362 1357  
1363      -        /* check references */
1364      -        if (DEVI(dip)->devi_ref)
     1358 +        /* Check references */
     1359 +        if (DEVI(dip)->devi_ref != 0 && !DEVI_IS_GONE(dip))
1365 1360                  return (DDI_FAILURE);
1366 1361  
1367 1362          NDI_CONFIG_DEBUG((CE_CONT, "detach_node: 0x%p(%s%d)\n",
1368 1363              (void *)dip, ddi_driver_name(dip), ddi_get_instance(dip)));
1369 1364  
1370 1365          /*
1371 1366           * NOTE: If we are processing a pHCI node then the calling code
1372 1367           * must detect this and ndi_devi_enter() in (vHCI, parent(pHCI))
1373 1368           * order unless pHCI and vHCI are siblings.  Code paths leading
1374 1369           * here that must ensure this ordering include:
↓ open down ↓ 81 lines elided ↑ open up ↑
1456 1451  }
1457 1452  
1458 1453  /*
1459 1454   * Run dacf post_attach routines
1460 1455   */
1461 1456  static int
1462 1457  postattach_node(dev_info_t *dip)
1463 1458  {
1464 1459          int rval;
1465 1460  
     1461 +        DEVI_UNSET_GONE(dip);
     1462 +
1466 1463          /*
1467 1464           * For hotplug busses like USB, it's possible that devices
1468 1465           * are removed but dip is still around. We don't want to
1469 1466           * run dacf routines as part of detach failure recovery.
1470 1467           *
1471 1468           * Pretend success until we figure out how to prevent
1472 1469           * access to such devinfo nodes.
1473 1470           */
1474 1471          if (DEVI_IS_DEVICE_REMOVED(dip))
1475 1472                  return (DDI_SUCCESS);
↓ open down ↓ 2338 lines elided ↑ open up ↑
3814 3811   *      b /pci@8,700000/ib@1,1:port=1/ioc@xxxxxx,yyyyyyy:dhcp
3815 3812   * Case (a), we first look for minor node "port=1,pkey...".
3816 3813   * Failing that, we will pass "port=1,pkey..." to the bus_config
3817 3814   * entry point of ib (HCA) driver.
3818 3815   * Case (b), configure ib@1,1 as usual. Then invoke ib's bus_config
3819 3816   * with argument "ioc@xxxxxxx,yyyyyyy:port=1". After configuring
3820 3817   * the ioc, look for minor node dhcp. If not found, pass ":dhcp"
3821 3818   * to ioc's bus_config entry point.
3822 3819   */
3823 3820  int
3824      -resolve_pathname(char *pathname,
3825      -        dev_info_t **dipp, dev_t *devtp, int *spectypep)
     3821 +resolve_pathname(char *pathname, dev_info_t **dipp, dev_t *devtp,
     3822 +    int *spectypep)
3826 3823  {
3827 3824          int                     error;
3828 3825          dev_info_t              *parent, *child;
3829 3826          struct pathname         pn;
3830 3827          char                    *component, *config_name;
3831 3828          char                    *minorname = NULL;
3832 3829          char                    *prev_minor = NULL;
3833 3830          dev_t                   devt = NODEV;
3834 3831          int                     spectype;
3835 3832          struct ddi_minor_data   *dmn;
↓ open down ↓ 757 lines elided ↑ open up ↑
4593 4590                          (void) i_ndi_config_node(dip, DS_INITIALIZED, flags);
4594 4591                  dip = ddi_get_next_sibling(dip);
4595 4592          }
4596 4593          e_ddi_exit_instance();
4597 4594  }
4598 4595  
4599 4596  /*
4600 4597   * report device status
4601 4598   */
4602 4599  static void
4603      -i_ndi_devi_report_status_change(dev_info_t *dip, char *path)
     4600 +i_ndi_devi_report_status_change(dev_info_t *dip)
4604 4601  {
4605      -        char *status;
     4602 +        const char *status;
4606 4603  
4607 4604          if (!DEVI_NEED_REPORT(dip) ||
4608 4605              (i_ddi_node_state(dip) < DS_INITIALIZED) ||
4609 4606              ndi_dev_is_hidden_node(dip)) {
4610 4607                  return;
4611 4608          }
4612 4609  
4613 4610          /* Invalidate the devinfo snapshot cache */
4614 4611          i_ddi_di_cache_invalidate();
4615 4612  
↓ open down ↓ 6 lines elided ↑ open up ↑
4622 4619          } else if (DEVI_IS_BUS_QUIESCED(dip)) {
4623 4620                  status = "quiesced";
4624 4621          } else if (DEVI_IS_BUS_DOWN(dip)) {
4625 4622                  status = "down";
4626 4623          } else if (i_ddi_devi_attached(dip)) {
4627 4624                  status = "online";
4628 4625          } else {
4629 4626                  status = "unknown";
4630 4627          }
4631 4628  
4632      -        if (path == NULL) {
4633      -                path = kmem_alloc(MAXPATHLEN, KM_SLEEP);
4634      -                cmn_err(CE_CONT, "?%s (%s%d) %s\n",
4635      -                    ddi_pathname(dip, path), ddi_driver_name(dip),
4636      -                    ddi_get_instance(dip), status);
4637      -                kmem_free(path, MAXPATHLEN);
4638      -        } else {
4639      -                cmn_err(CE_CONT, "?%s (%s%d) %s\n",
4640      -                    path, ddi_driver_name(dip),
4641      -                    ddi_get_instance(dip), status);
4642      -        }
     4629 +        cmn_err(CE_CONT, "?%s%d %s\n", ddi_driver_name(dip),
     4630 +            ddi_get_instance(dip), status);
4643 4631  
4644 4632          mutex_enter(&(DEVI(dip)->devi_lock));
4645 4633          DEVI_REPORT_DONE(dip);
4646 4634          mutex_exit(&(DEVI(dip)->devi_lock));
4647 4635  }
4648 4636  
4649 4637  /*
4650 4638   * log a notification that a dev_info node has been configured.
4651 4639   */
4652 4640  static int
↓ open down ↓ 567 lines elided ↑ open up ↑
5220 5208                  else {
5221 5209                          /*
5222 5210                           * Delete .conf nodes and nodes that are not
5223 5211                           * well formed.
5224 5212                           */
5225 5213                          (void) ddi_remove_child(dip, 0);
5226 5214                  }
5227 5215                  return (NDI_FAILURE);
5228 5216          }
5229 5217  
5230      -        i_ndi_devi_report_status_change(dip, NULL);
     5218 +        i_ndi_devi_report_status_change(dip);
5231 5219  
5232 5220          /*
5233 5221           * log an event, but not during devfs lookups in which case
5234 5222           * NDI_NO_EVENT is set.
5235 5223           */
5236 5224          if ((flags & NDI_NO_EVENT) == 0 && !(DEVI_EVADD(dip))) {
5237 5225                  (void) i_log_devfs_add_devinfo(dip, flags);
5238 5226  
5239 5227                  mutex_enter(&(DEVI(dip)->devi_lock));
5240 5228                  DEVI_SET_EVADD(dip);
↓ open down ↓ 517 lines elided ↑ open up ↑
5758 5746                  break;
5759 5747          case LDI_EV_NONE:
5760 5748                  /* no matching LDI callbacks */
5761 5749                  RIO_DEBUG((CE_NOTE, "No LDI callbacks for dip=%p",
5762 5750                      (void *)dip));
5763 5751                  break;
5764 5752          default:
5765 5753                  ASSERT(retval == LDI_EV_NONE);
5766 5754          }
5767 5755  
     5756 +        /*
     5757 +         * In order to allow a device retire to succeed that is in use
     5758 +         */
     5759 +
     5760 +        if (ddi_getprop(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
     5761 +            "allow-unconstrained-retire", 0) == 1 && failure == 0) {
     5762 +                RIO_VERBOSE((CE_NOTE, "e_ddi_offline_notify(): setting "
     5763 +                    "constraint flag due to 'allow-unconstrained-retire' "
     5764 +                    "property on dip=%p", (void *)dip));
     5765 +                constraint = 1;
     5766 +        }
5768 5767  out:
5769 5768          mutex_enter(&(DEVI(dip)->devi_lock));
5770 5769          if ((DEVI(dip)->devi_flags & DEVI_RETIRING) && failure) {
5771 5770                  RIO_VERBOSE((CE_NOTE, "e_ddi_offline_notify(): setting "
5772 5771                      "BLOCKED flag. dip=%p", (void *)dip));
5773 5772                  DEVI(dip)->devi_flags |= DEVI_R_BLOCKED;
5774 5773                  if (DEVI(dip)->devi_flags & DEVI_R_CONSTRAINT) {
5775 5774                          RIO_VERBOSE((CE_NOTE, "e_ddi_offline_notify(): "
5776 5775                              "blocked. clearing RCM CONSTRAINT flag. dip=%p",
5777 5776                              (void *)dip));
↓ open down ↓ 145 lines elided ↑ open up ↑
5923 5922           * For DR, even bound nodes may need to have offline
5924 5923           * flag set.
5925 5924           */
5926 5925          if (flags & NDI_DEVI_OFFLINE) {
5927 5926                  mutex_enter(&(DEVI(dip)->devi_lock));
5928 5927                  DEVI_SET_DEVICE_OFFLINE(dip);
5929 5928                  mutex_exit(&(DEVI(dip)->devi_lock));
5930 5929          }
5931 5930  
5932 5931          if (i_ddi_node_state(dip) == DS_INITIALIZED) {
5933      -                struct dev_info *devi = DEVI(dip);
5934      -
5935      -                if (devi->devi_ev_path == NULL) {
5936      -                        devi->devi_ev_path = kmem_alloc(MAXPATHLEN, KM_SLEEP);
5937      -                        (void) ddi_pathname(dip, devi->devi_ev_path);
5938      -                }
5939 5932                  if (flags & NDI_DEVI_OFFLINE)
5940      -                        i_ndi_devi_report_status_change(dip,
5941      -                            devi->devi_ev_path);
     5933 +                        i_ndi_devi_report_status_change(dip);
5942 5934  
5943 5935                  if (need_remove_event(dip, flags)) {
5944      -                        /*
5945      -                         * instance and path data are lost in call to
5946      -                         * ddi_uninitchild
5947      -                         */
5948      -                        devi->devi_ev_instance = ddi_get_instance(dip);
5949      -
5950 5936                          mutex_enter(&(DEVI(dip)->devi_lock));
5951 5937                          DEVI_SET_EVREMOVE(dip);
5952 5938                          mutex_exit(&(DEVI(dip)->devi_lock));
     5939 +
     5940 +                        post_event = (flags & NDI_DEVI_REMOVE) ||
     5941 +                            DEVI_IS_GONE(dip);
5953 5942                  }
     5943 +
     5944 +                if (post_event) {
     5945 +                        /*
     5946 +                         * Instance and path data are lost in call to
     5947 +                         * ddi_uninitchild.
     5948 +                         */
     5949 +                        path = kmem_alloc(MAXPATHLEN, KM_SLEEP);
     5950 +                        (void) ddi_pathname(dip, path);
     5951 +                        class = i_ddi_strdup(i_ddi_devi_class(dip), KM_SLEEP);
     5952 +                        driver = i_ddi_strdup((char *)ddi_driver_name(dip),
     5953 +                            KM_SLEEP);
     5954 +                        instance = ddi_get_instance(dip);
     5955 +                }
5954 5956          }
5955 5957  
5956 5958          if (flags & (NDI_UNCONFIG | NDI_DEVI_REMOVE)) {
5957 5959                  ret = ddi_uninitchild(dip);
5958 5960                  if (ret == NDI_SUCCESS) {
5959 5961                          /*
5960 5962                           * Remove uninitialized pseudo nodes because
5961 5963                           * system props are lost and the node cannot be
5962 5964                           * reattached.
5963 5965                           */
5964 5966                          if (!ndi_dev_is_persistent_node(dip))
5965 5967                                  flags |= NDI_DEVI_REMOVE;
5966 5968  
5967      -                        if (flags & NDI_DEVI_REMOVE) {
5968      -                                /*
5969      -                                 * NOTE: If there is a consumer of LDI events,
5970      -                                 * ddi_uninitchild above would have failed
5971      -                                 * because of active devi_ref from ldi_open().
5972      -                                 */
5973      -
5974      -                                if (DEVI_EVREMOVE(dip)) {
5975      -                                        path = i_ddi_strdup(
5976      -                                            DEVI(dip)->devi_ev_path,
5977      -                                            KM_SLEEP);
5978      -                                        class =
5979      -                                            i_ddi_strdup(i_ddi_devi_class(dip),
5980      -                                            KM_SLEEP);
5981      -                                        driver =
5982      -                                            i_ddi_strdup(
5983      -                                            (char *)ddi_driver_name(dip),
5984      -                                            KM_SLEEP);
5985      -                                        instance = DEVI(dip)->devi_ev_instance;
5986      -                                        post_event = 1;
5987      -                                }
5988      -
     5969 +                        if (flags & NDI_DEVI_REMOVE)
5989 5970                                  ret = ddi_remove_child(dip, 0);
5990      -                                if (post_event && ret == NDI_SUCCESS) {
5991      -                                        /* Generate EC_DEVFS_DEVI_REMOVE */
5992      -                                        (void) i_log_devfs_remove_devinfo(path,
5993      -                                            class, driver, instance, flags);
5994      -                                }
5995      -                        }
5996      -
5997 5971                  }
5998 5972          }
5999 5973  
6000      -        if (path)
6001      -                strfree(path);
6002      -        if (class)
     5974 +        if (ret == NDI_SUCCESS && post_event) {
     5975 +                /* Generate EC_DEVFS/ESC_DEVFS_DEVI_REMOVE */
     5976 +                (void) i_log_devfs_remove_devinfo(path,
     5977 +                    class, driver, instance, flags);
     5978 +        }
     5979 +
     5980 +        if (path != NULL)
     5981 +                kmem_free(path, MAXPATHLEN);
     5982 +        if (class != NULL)
6003 5983                  strfree(class);
6004      -        if (driver)
     5984 +        if (driver != NULL)
6005 5985                  strfree(driver);
6006 5986  
     5987 +        /* Clean the flag on successful detach */
     5988 +        if (ret == NDI_SUCCESS)
     5989 +                DEVI_UNSET_GONE(dip);
     5990 +
6007 5991          return (ret);
6008 5992  }
6009 5993  
6010 5994  /*
6011 5995   * unconfigure immediate children of bus nexus device
6012 5996   */
6013 5997  static int
6014 5998  unconfig_immediate_children(
6015 5999          dev_info_t *dip,
6016 6000          dev_info_t **dipp,
↓ open down ↓ 555 lines elided ↑ open up ↑
6572 6556          int             circ, rval = 0;
6573 6557          dev_info_t      *pdip = ddi_get_parent(dip);
6574 6558          dev_info_t      *vdip = NULL;
6575 6559          int             v_circ;
6576 6560          struct brevq_node *brevq = NULL;
6577 6561  
6578 6562          ASSERT(pdip);
6579 6563  
6580 6564          flags |= NDI_DEVI_OFFLINE;
6581 6565  
     6566 +        if (flags & NDI_DEVI_GONE)
     6567 +                DEVI_SET_GONE(dip);
     6568 +
6582 6569          /*
6583 6570           * If child is pHCI and vHCI and pHCI are not siblings then enter vHCI
6584 6571           * before parent(pHCI) to avoid deadlock with mpxio Client power
6585 6572           * management operations.
6586 6573           */
6587 6574          if (MDI_PHCI(dip)) {
6588 6575                  vdip = mdi_devi_get_vdip(dip);
6589 6576                  if (vdip && (ddi_get_parent(vdip) != pdip))
6590 6577                          ndi_devi_enter(vdip, &v_circ);
6591 6578                  else
↓ open down ↓ 1501 lines elided ↑ open up ↑
8093 8080          mutex_enter(&global_vhci_lock);
8094 8081          i_link_vhci_node(dip);
8095 8082          mutex_exit(&global_vhci_lock);
8096 8083          i_ddi_set_node_state(dip, DS_READY);
8097 8084  
8098 8085          LOCK_DEV_OPS(&dnp->dn_lock);
8099 8086          dnp->dn_flags |= DN_DRIVER_HELD;
8100 8087          dnp->dn_head = dip;
8101 8088          UNLOCK_DEV_OPS(&dnp->dn_lock);
8102 8089  
8103      -        i_ndi_devi_report_status_change(dip, NULL);
     8090 +        i_ndi_devi_report_status_change(dip);
8104 8091  
8105 8092          return (dip);
8106 8093  }
8107 8094  
8108 8095  /*
8109 8096   * Maintain DEVI_DEVICE_REMOVED hotplug devi_state for remove/reinsert hotplug
8110 8097   * of open devices. Currently, because of tight coupling between the devfs file
8111 8098   * system and the Solaris device tree, a driver can't always make the device
8112 8099   * tree state (esp devi_node_state) match device hardware hotplug state. Until
8113 8100   * resolved, to overcome this deficiency we use the following interfaces that
↓ open down ↓ 26 lines elided ↑ open up ↑
8140 8127                  return (0);
8141 8128  
8142 8129          /* Mark the device as having been physically removed. */
8143 8130          mutex_enter(&(DEVI(dip)->devi_lock));
8144 8131          ndi_devi_set_hidden(dip);       /* invisible: lookup/snapshot */
8145 8132          DEVI_SET_DEVICE_REMOVED(dip);
8146 8133          DEVI_SET_EVREMOVE(dip);         /* this clears EVADD too */
8147 8134          mutex_exit(&(DEVI(dip)->devi_lock));
8148 8135  
8149 8136          /* report remove (as 'removed') */
8150      -        i_ndi_devi_report_status_change(dip, NULL);
     8137 +        i_ndi_devi_report_status_change(dip);
8151 8138  
8152 8139          /*
8153 8140           * Invalidate the cache to ensure accurate
8154 8141           * (di_state() & DI_DEVICE_REMOVED).
8155 8142           */
8156 8143          i_ddi_di_cache_invalidate();
8157 8144  
8158 8145          /*
8159 8146           * Generate sysevent for those interested in removal (either
8160 8147           * directly via private EC_DEVFS or indirectly via devfsadmd
↓ open down ↓ 16 lines elided ↑ open up ↑
8177 8164                  return (0);
8178 8165  
8179 8166          /* Mark the device as having been physically reinserted. */
8180 8167          mutex_enter(&(DEVI(dip)->devi_lock));
8181 8168          ndi_devi_clr_hidden(dip);       /* visible: lookup/snapshot */
8182 8169          DEVI_SET_DEVICE_REINSERTED(dip);
8183 8170          DEVI_SET_EVADD(dip);            /* this clears EVREMOVE too */
8184 8171          mutex_exit(&(DEVI(dip)->devi_lock));
8185 8172  
8186 8173          /* report insert (as 'online') */
8187      -        i_ndi_devi_report_status_change(dip, NULL);
     8174 +        i_ndi_devi_report_status_change(dip);
8188 8175  
8189 8176          /*
8190 8177           * Invalidate the cache to ensure accurate
8191 8178           * (di_state() & DI_DEVICE_REMOVED).
8192 8179           */
8193 8180          i_ddi_di_cache_invalidate();
8194 8181  
8195 8182          /*
8196 8183           * Generate sysevent for those interested in removal (either directly
8197 8184           * via EC_DEVFS or indirectly via devfsadmd generated EC_DEV).
↓ open down ↓ 848 lines elided ↑ open up ↑
9046 9033          }
9047 9034  out:
9048 9035          (void) tsd_set(tsd_ddi_redirect, NULL);
9049 9036  
9050 9037          return (currdip);
9051 9038  }
9052 9039  
9053 9040  char *
9054 9041  ddi_curr_redirect(char *curr)
9055 9042  {
9056      -        char    *alias;
     9043 +        char *alias;
9057 9044          int i;
9058 9045  
9059 9046          if (ddi_aliases_present == B_FALSE)
9060 9047                  return (NULL);
9061 9048  
9062 9049          if (tsd_get(tsd_ddi_redirect))
9063 9050                  return (NULL);
9064 9051  
9065 9052          (void) tsd_set(tsd_ddi_redirect, (void *)1);
9066 9053  
↓ open down ↓ 130 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX