Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/usb/usba/hubdi.c
          +++ new/usr/src/uts/common/io/usb/usba/hubdi.c
↓ open down ↓ 8597 lines elided ↑ open up ↑
8598 8598          mutex_exit(&child_ud->usb_mutex);
8599 8599  }
8600 8600  
8601 8601  /*
8602 8602   * hubd_wait_for_hotplug_exit:
8603 8603   *      Waiting for the exit of the running hotplug thread or ioctl thread.
8604 8604   */
8605 8605  static int
8606 8606  hubd_wait_for_hotplug_exit(hubd_t *hubd)
8607 8607  {
8608      -        clock_t         until = drv_usectohz(1000000);
     8608 +        clock_t         until = drv_sectohz(1);
8609 8609          int             rval;
8610 8610  
8611 8611          ASSERT(mutex_owned(HUBD_MUTEX(hubd)));
8612 8612  
8613 8613          if (hubd->h_hotplug_thread) {
8614 8614                  USB_DPRINTF_L3(DPRINT_MASK_HOTPLUG, hubd->h_log_handle,
8615 8615                      "waiting for hubd hotplug thread exit");
8616 8616                  rval = cv_reltimedwait(&hubd->h_cv_hotplug_dev,
8617 8617                      &hubd->h_mutex, until, TR_CLOCK_TICK);
8618 8618  
↓ open down ↓ 128 lines elided ↑ open up ↑
8747 8747                  if ((strcmp(devname, "scsa2usb") == 0) &&
8748 8748                      DEVI(child_dip)->devi_ref != 0) {
8749 8749                          while (i++ < hubdi_reset_delay) {
8750 8750                                  mutex_enter(HUBD_MUTEX(hubd));
8751 8751                                  rval = hubd_delete_child(hubd, reset_port,
8752 8752                                      NDI_DEVI_REMOVE, B_FALSE);
8753 8753                                  mutex_exit(HUBD_MUTEX(hubd));
8754 8754                                  if (rval == USB_SUCCESS)
8755 8755                                          break;
8756 8756  
8757      -                                delay(drv_usectohz(1000000)); /* 1s */
     8757 +                                delay(drv_sectohz(1));
8758 8758                          }
8759 8759                  }
8760 8760  
8761 8761                  ndi_devi_enter(ddi_get_parent(rh_dip), &prh_circ);
8762 8762                  ndi_devi_enter(rh_dip, &rh_circ);
8763 8763                  ndi_devi_enter(hdip, &circ);
8764 8764  
8765 8765                  mutex_enter(HUBD_MUTEX(hubd));
8766 8766  
8767 8767                  /* Then force detaching the device */
↓ open down ↓ 325 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX