Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
          +++ new/usr/src/uts/common/io/fibre-channel/ulp/fcsm.c
↓ open down ↓ 759 lines elided ↑ open up ↑
 760  760                  if (fcsm_num_attaching || fcsm_num_detaching) {
 761  761                          int count;
 762  762  
 763  763                          FCSM_DEBUG(SMDL_TRACE, (CE_WARN, SM_LOG, NULL, NULL,
 764  764                              "detach: wait for port attach/detach to complete"));
 765  765  
 766  766                          count = 0;
 767  767                          while ((count++ <= 30) &&
 768  768                              (fcsm_num_attaching || fcsm_num_detaching)) {
 769  769                                  mutex_exit(&fcsm_global_mutex);
 770      -                                delay(drv_usectohz(1000000));
      770 +                                delay(drv_sectohz(1));
 771  771                                  mutex_enter(&fcsm_global_mutex);
 772  772                          }
 773  773  
 774  774                          /* Port attach/detach still in prog, so fail detach */
 775  775                          if (fcsm_num_attaching || fcsm_num_detaching) {
 776  776                                  mutex_exit(&fcsm_global_mutex);
 777  777                                  FCSM_DEBUG(SMDL_ERR, (CE_WARN, SM_LOG, NULL,
 778  778                                      NULL, "detach: Failing detach. port "
 779  779                                      "attach/detach in progress"));
 780  780                                  rval = DDI_FAILURE;
↓ open down ↓ 267 lines elided ↑ open up ↑
1048 1048  
1049 1049          /*
1050 1050           * If some commands are pending OR callback in progress, then
1051 1051           * wait for some finite amount of time for their completion.
1052 1052           * TODO: add more checks here to check for cmd timeout, offline
1053 1053           * timeout and other (??) threads.
1054 1054           */
1055 1055          count = 0;
1056 1056          while ((count++ <= 30) && (fcsm->sm_ncmds || fcsm->sm_cb_count)) {
1057 1057                  mutex_exit(&fcsm->sm_mutex);
1058      -                delay(drv_usectohz(1000000));
     1058 +                delay(drv_sectohz(1));
1059 1059                  mutex_enter(&fcsm->sm_mutex);
1060 1060          }
1061 1061          if (fcsm->sm_ncmds || fcsm->sm_cb_count) {
1062 1062                  fcsm->sm_flags &= ~flag;
1063 1063                  mutex_exit(&fcsm->sm_mutex);
1064 1064                  fcsm_display(CE_WARN, SM_LOG, fcsm, NULL,
1065 1065                      "port_detach: Failing suspend, port is busy");
1066 1066                  return (DDI_FAILURE);
1067 1067          }
1068 1068          if (flag == FCSM_DETACHING) {
↓ open down ↓ 492 lines elided ↑ open up ↑
1561 1561                                          break;
1562 1562                                  }
1563 1563                                  mutex_exit(&fcsm->sm_mutex);
1564 1564                          }
1565 1565                          if (count == 1) {
1566 1566                                  FCSM_DEBUG(SMDL_TRACE,
1567 1567                                      (CE_WARN, SM_LOG, NULL, NULL,
1568 1568                                      "fciocmd: instance 0x%x, "
1569 1569                                      "wait for port attach", instance));
1570 1570                          }
1571      -                        delay(drv_usectohz(1000000));
     1571 +                        delay(drv_sectohz(1));
1572 1572                          fcsm = ddi_get_soft_state(fcsm_state, instance);
1573 1573                  }
1574 1574                  if (count > 30) {
1575 1575                          FCSM_DEBUG(SMDL_TRACE, (CE_WARN, SM_LOG, NULL, NULL,
1576 1576                              "fciocmd: instance 0x%x, port not attached",
1577 1577                              instance));
1578 1578                          retval = ENXIO;
1579 1579                          break;
1580 1580                  }
1581 1581  
↓ open down ↓ 2042 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX