Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c
          +++ new/usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c
↓ open down ↓ 10051 lines elided ↑ open up ↑
10052 10052          /* Set all the throttles to zero */
10053 10053          for (ptgt = refhash_first(mpt->m_targets); ptgt != NULL;
10054 10054              ptgt = refhash_next(mpt->m_targets, ptgt)) {
10055 10055                  mptsas_set_throttle(mpt, ptgt, HOLD_THROTTLE);
10056 10056          }
10057 10057  
10058 10058          /* If there are any outstanding commands in the queue */
10059 10059          if (mpt->m_ncmds) {
10060 10060                  mpt->m_softstate |= MPTSAS_SS_DRAINING;
10061 10061                  mpt->m_quiesce_timeid = timeout(mptsas_ncmds_checkdrain,
10062      -                    mpt, (MPTSAS_QUIESCE_TIMEOUT * drv_usectohz(1000000)));
     10062 +                    mpt, drv_sectohz(MPTSAS_QUIESCE_TIMEOUT));
10063 10063                  if (cv_wait_sig(&mpt->m_cv, &mpt->m_mutex) == 0) {
10064 10064                          /*
10065 10065                           * Quiesce has been interrupted
10066 10066                           */
10067 10067                          mpt->m_softstate &= ~MPTSAS_SS_DRAINING;
10068 10068                          for (ptgt = refhash_first(mpt->m_targets); ptgt != NULL;
10069 10069                              ptgt = refhash_next(mpt->m_targets, ptgt)) {
10070 10070                                  mptsas_set_throttle(mpt, ptgt, MAX_THROTTLE);
10071 10071                          }
10072 10072                          mptsas_restart_hba(mpt);
↓ open down ↓ 54 lines elided ↑ open up ↑
10127 10127                          /*
10128 10128                           * The throttle may have been reset because
10129 10129                           * of a SCSI bus reset
10130 10130                           */
10131 10131                          for (ptgt = refhash_first(mpt->m_targets); ptgt != NULL;
10132 10132                              ptgt = refhash_next(mpt->m_targets, ptgt)) {
10133 10133                                  mptsas_set_throttle(mpt, ptgt, HOLD_THROTTLE);
10134 10134                          }
10135 10135  
10136 10136                          mpt->m_quiesce_timeid = timeout(mptsas_ncmds_checkdrain,
10137      -                            mpt, (MPTSAS_QUIESCE_TIMEOUT *
10138      -                            drv_usectohz(1000000)));
     10137 +                            mpt, drv_sectohz(MPTSAS_QUIESCE_TIMEOUT));
10139 10138                  }
10140 10139          }
10141 10140          mutex_exit(&mpt->m_mutex);
10142 10141  }
10143 10142  
10144 10143  /*ARGSUSED*/
10145 10144  static void
10146 10145  mptsas_dump_cmd(mptsas_t *mpt, mptsas_cmd_t *cmd)
10147 10146  {
10148 10147          int     i;
↓ open down ↓ 3475 lines elided ↑ open up ↑
13624 13623          } else if (dblk[4] == 'A') {
13625 13624                  NDBG20(("SATA drive has no NAA format GUID."));
13626 13625                  goto out;
13627 13626          } else {
13628 13627                  /* The data is not ready, wait and retry */
13629 13628                  inq83_retry--;
13630 13629                  if (inq83_retry <= 0) {
13631 13630                          goto out;
13632 13631                  }
13633 13632                  NDBG20(("The GUID is not ready, retry..."));
13634      -                delay(1 * drv_usectohz(1000000));
     13633 +                delay(drv_sectohz(1));
13635 13634                  goto inq83_retry;
13636 13635          }
13637 13636  out:
13638 13637          kmem_free(inq83, inq83_len);
13639 13638          return (sata_guid);
13640 13639  }
13641 13640  
13642 13641  static int
13643 13642  mptsas_inquiry(mptsas_t *mpt, mptsas_target_t *ptgt, int lun, uchar_t page,
13644 13643      unsigned char *buf, int len, int *reallen, uchar_t evpd)
↓ open down ↓ 1278 lines elided ↑ open up ↑
14923 14922                           */
14924 14923                          ddi_devid_free(devid);
14925 14924                          break;
14926 14925                  } else if (rval == DDI_NOT_WELL_FORMED) {
14927 14926                          /*
14928 14927                           * return value of ddi_devid_scsi_encode equal to
14929 14928                           * DDI_NOT_WELL_FORMED means DEVID_RETRY, it worth
14930 14929                           * to retry inquiry page 0x83 and get GUID.
14931 14930                           */
14932 14931                          NDBG20(("Not well formed devid, retry..."));
14933      -                        delay(1 * drv_usectohz(1000000));
     14932 +                        delay(drv_sectohz(1));
14934 14933                          continue;
14935 14934                  } else {
14936 14935                          mptsas_log(mpt, CE_WARN, "!Encode devid failed for "
14937 14936                              "path target:%x, lun:%x", target, lun);
14938 14937                          rval = DDI_FAILURE;
14939 14938                          goto create_lun;
14940 14939                  }
14941 14940          }
14942 14941  
14943 14942          if (i == mptsas_inq83_retry_timeout) {
↓ open down ↓ 1575 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX