Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/scsi/targets/st.c
          +++ new/usr/src/uts/common/io/scsi/targets/st.c
↓ open down ↓ 1466 lines elided ↑ open up ↑
1467 1467                   * Wait for all outstanding I/O's to complete
1468 1468                   *
1469 1469                   * we wait on both ncmds and the wait queue for times
1470 1470                   * when we are flushing after persistent errors are
1471 1471                   * flagged, which is when ncmds can be 0, and the
1472 1472                   * queue can still have I/O's.  This way we preserve
1473 1473                   * order of biodone's.
1474 1474                   */
1475 1475                  wait_cmds_complete = ddi_get_lbolt();
1476 1476                  wait_cmds_complete +=
1477      -                    st_wait_cmds_complete * drv_usectohz(1000000);
     1477 +                    drv_sectohz(st_wait_cmds_complete);
1478 1478                  while (un->un_ncmds || un->un_quef ||
1479 1479                      (un->un_state == ST_STATE_RESOURCE_WAIT)) {
1480 1480  
1481 1481                          if (cv_timedwait(&un->un_tape_busy_cv, ST_MUTEX,
1482 1482                              wait_cmds_complete) == -1) {
1483 1483                                  /*
1484 1484                                   * Time expired then cancel the command
1485 1485                                   */
1486 1486                                  if (st_reset(un, RESET_LUN) == 0) {
1487 1487                                          if (un->un_last_throttle) {
↓ open down ↓ 5000 lines elided ↑ open up ↑
6488 6488                          ST_DEBUG2(ST_DEVINFO, st_label, SCSI_DEBUG,
6489 6489                              "st_start returning throttle = %d or ncmds = %d\n",
6490 6490                              un->un_throttle, un->un_ncmds);
6491 6491                          if (un->un_ncmds == 0) {
6492 6492                                  typedef void (*func)();
6493 6493                                  func fnc = (func)st_runout;
6494 6494  
6495 6495                                  scsi_log(ST_DEVINFO, st_label, SCSI_DEBUG,
6496 6496                                      "Sending delayed start to st_runout()\n");
6497 6497                                  mutex_exit(ST_MUTEX);
6498      -                                (void) timeout(fnc, un, drv_usectohz(1000000));
     6498 +                                (void) timeout(fnc, un, drv_sectohz(1));
6499 6499                                  mutex_enter(ST_MUTEX);
6500 6500                          }
6501 6501                          return;
6502 6502                  }
6503 6503          }
6504 6504  
6505 6505          /*
6506 6506           * If the buf has no scsi_pkt call st_make_cmd() to get one and
6507 6507           * build the command.
6508 6508           */
↓ open down ↓ 11100 lines elided ↑ open up ↑
17609 17609          int limit = st_retry_count;
17610 17610  
17611 17611          ST_FUNC(ST_DEVINFO, st_test_path_to_device);
17612 17612  
17613 17613          /*
17614 17614           * XXX Newer drives may not RESEVATION CONFLICT a TUR.
17615 17615           */
17616 17616          do {
17617 17617                  if (rval != 0) {
17618 17618                          mutex_exit(ST_MUTEX);
17619      -                        delay(drv_usectohz(1000000));
     17619 +                        delay(drv_sectohz(1));
17620 17620                          mutex_enter(ST_MUTEX);
17621 17621                  }
17622 17622                  rval = st_rcmd(un, SCMD_TEST_UNIT_READY, 0, SYNC_CMD);
17623 17623                  ST_RECOV(ST_DEVINFO, st_label, CE_NOTE,
17624 17624                      "ping TUR returned 0x%x", rval);
17625 17625                  limit--;
17626 17626          } while (((rval == EACCES) || (rval == EBUSY)) && limit);
17627 17627  
17628 17628          if (un->un_status == KEY_NOT_READY || un->un_mediastate == MTIO_EJECTED)
17629 17629                  rval = 0;
↓ open down ↓ 963 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX