Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/scsi/targets/sd.c
          +++ new/usr/src/uts/common/io/scsi/targets/sd.c
↓ open down ↓ 6206 lines elided ↑ open up ↑
6207 6207           *
6208 6208           * While waiting, no new commands will be accepted or sent because of
6209 6209           * the new state we set above.
6210 6210           *
6211 6211           * Wait till current operation has completed. If we are in the resource
6212 6212           * wait state (with an intr outstanding) then we need to wait till the
6213 6213           * intr completes and starts the next cmd. We want to wait for
6214 6214           * SD_WAIT_CMDS_COMPLETE seconds before failing the DDI_SUSPEND.
6215 6215           */
6216 6216          wait_cmds_complete = ddi_get_lbolt() +
6217      -            (sd_wait_cmds_complete * drv_usectohz(1000000));
     6217 +            drv_sectohz(sd_wait_cmds_complete);
6218 6218  
6219 6219          while (un->un_ncmds_in_transport != 0) {
6220 6220                  /*
6221 6221                   * Fail if commands do not finish in the specified time.
6222 6222                   */
6223 6223                  if (cv_timedwait(&un->un_disk_busy_cv, SD_MUTEX(un),
6224 6224                      wait_cmds_complete) == -1) {
6225 6225                          /*
6226 6226                           * Undo the state changes made above. Everything
6227 6227                           * must go back to it's original value.
↓ open down ↓ 612 lines elided ↑ open up ↑
6840 6840                           * because sdpower may have been called as a result
6841 6841                           * of a call to pm_raise_power from within sd_pm_entry.
6842 6842                           *
6843 6843                           * If a timeout handler is already active then
6844 6844                           * don't install another.
6845 6845                           */
6846 6846                          mutex_enter(&un->un_pm_mutex);
6847 6847                          if (un->un_pm_timeid == NULL) {
6848 6848                                  un->un_pm_timeid =
6849 6849                                      timeout(sd_pm_timeout_handler,
6850      -                                    un, intvlp * drv_usectohz(1000000));
     6850 +                                    un, drv_sectohz(intvlp));
6851 6851                                  mutex_exit(&un->un_pm_mutex);
6852 6852                                  (void) pm_busy_component(SD_DEVINFO(un), 0);
6853 6853                          } else {
6854 6854                                  mutex_exit(&un->un_pm_mutex);
6855 6855                          }
6856 6856                          if (got_semaphore_here != 0) {
6857 6857                                  sema_v(&un->un_semoclose);
6858 6858                          }
6859 6859                          /*
6860 6860                           * On exit put the state back to it's original value
↓ open down ↓ 24960 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX