Print this page
LOCAL: devfs_clean before trying to offline to release refs to dev_info

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/devcfg.c
          +++ new/usr/src/uts/common/os/devcfg.c
↓ open down ↓ 5882 lines elided ↑ open up ↑
5883 5883          }
5884 5884  
5885 5885          if (flags & NDI_POST_EVENT) {
5886 5886                  if (i_ddi_devi_attached(pdip)) {
5887 5887                          if (ddi_get_eventcookie(dip, DDI_DEVI_REMOVE_EVENT,
5888 5888                              &cookie) == NDI_SUCCESS)
5889 5889                                  (void) ndi_post_event(dip, dip, cookie, NULL);
5890 5890                  }
5891 5891          }
5892 5892  
     5893 +        /*
     5894 +         * dv_mknod places a hold on the dev_info_t for each devfs node
     5895 +         * created.  If we're to succeed in detaching this device, we must
     5896 +         * first release all outstanding references held by devfs.
     5897 +         */
     5898 +        (void) devfs_clean(pdip, NULL, DV_CLEAN_FORCE);
     5899 +
5893 5900          if (i_ddi_detachchild(dip, flags) != DDI_SUCCESS) {
5894 5901                  if (flags & NDI_DEVI_OFFLINE) {
5895 5902                          RIO_DEBUG((CE_NOTE, "devi_detach_node: offline failed."
5896 5903                              " Calling e_ddi_offline_finalize with result=%d. "
5897 5904                              "dip=%p", DDI_FAILURE, (void *)dip));
5898 5905                          e_ddi_offline_finalize(dip, DDI_FAILURE);
5899 5906                  }
5900 5907                  return (NDI_FAILURE);
5901 5908          }
5902 5909  
↓ open down ↓ 3285 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX