Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/fibre-channel/fca/qlc/ql_mbx.c
          +++ new/usr/src/uts/common/io/fibre-channel/fca/qlc/ql_mbx.c
↓ open down ↓ 103 lines elided ↑ open up ↑
 104  104                  ha->mailbox_flags = (uint8_t)
 105  105                      (ha->mailbox_flags | MBX_WANT_FLG);
 106  106  
 107  107                  if (ha->task_daemon_flags & TASK_DAEMON_POWERING_DOWN) {
 108  108                          EL(vha, "failed availability cmd=%xh\n", mcp->mb[0]);
 109  109                          MBX_REGISTER_UNLOCK(ha);
 110  110                          return (QL_LOCK_TIMEOUT);
 111  111                  }
 112  112  
 113  113                  /* Set timeout after command that is running. */
 114      -                timer = (mcp->timeout + 20) * drv_usectohz(1000000);
      114 +                timer = drv_sectohz(mcp->timeout + 20);
 115  115                  cv_stat = cv_reltimedwait_sig(&ha->cv_mbx_wait,
 116  116                      &ha->pha->mbx_mutex, timer, TR_CLOCK_TICK);
 117  117                  if (cv_stat == -1 || cv_stat == 0) {
 118  118                          /*
 119  119                           * The timeout time 'timer' was
 120  120                           * reached without the condition
 121  121                           * being signaled.
 122  122                           */
 123  123                          ha->mailbox_flags = (uint8_t)(ha->mailbox_flags &
 124  124                              ~MBX_WANT_FLG);
↓ open down ↓ 34 lines elided ↑ open up ↑
 159  159                  WRT32_IO_REG(ha, hccr, HC24_SET_HOST_INT);
 160  160          } else {
 161  161                  WRT16_IO_REG(ha, hccr, HC_SET_HOST_INT);
 162  162          }
 163  163  
 164  164          /* Wait for command to complete. */
 165  165          if (ha->flags & INTERRUPTS_ENABLED &&
 166  166              !(ha->task_daemon_flags & (TASK_THREAD_CALLED |
 167  167              TASK_DAEMON_POWERING_DOWN)) &&
 168  168              !ddi_in_panic()) {
 169      -                timer = mcp->timeout * drv_usectohz(1000000);
      169 +                timer = drv_sectohz(mcp->timeout);
 170  170                  while (!(ha->mailbox_flags & (MBX_INTERRUPT | MBX_ABORT)) &&
 171  171                      !(ha->task_daemon_flags & ISP_ABORT_NEEDED)) {
 172  172  
 173  173                          if (cv_reltimedwait(&ha->cv_mbx_intr,
 174  174                              &ha->pha->mbx_mutex, timer, TR_CLOCK_TICK) == -1) {
 175  175                                  /*
 176  176                                   * The timeout time 'timer' was
 177  177                                   * reached without the condition
 178  178                                   * being signaled.
 179  179                                   */
↓ open down ↓ 4686 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX