Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/fibre-channel/fca/qlc/ql_api.c
          +++ new/usr/src/uts/common/io/fibre-channel/fca/qlc/ql_api.c
↓ open down ↓ 1490 lines elided ↑ open up ↑
1491 1491                  ha->tran = tran;
1492 1492  
1493 1493                  /* Acquire global state lock. */
1494 1494                  GLOBAL_STATE_LOCK();
1495 1495  
1496 1496                  /* Add adapter structure to link list. */
1497 1497                  ql_add_link_b(&ql_hba, &ha->hba);
1498 1498  
1499 1499                  /* Start one second driver timer. */
1500 1500                  if (ql_timer_timeout_id == NULL) {
1501      -                        ql_timer_ticks = drv_usectohz(1000000);
     1501 +                        ql_timer_ticks = drv_sectohz(1);
1502 1502                          ql_timer_timeout_id = timeout(ql_timer, (void *)0,
1503 1503                              ql_timer_ticks);
1504 1504                  }
1505 1505  
1506 1506                  /* Release global state lock. */
1507 1507                  GLOBAL_STATE_UNLOCK();
1508 1508  
1509 1509                  /* Determine and populate HBA fru info */
1510 1510                  ql_setup_fruinfo(ha);
1511 1511  
↓ open down ↓ 454 lines elided ↑ open up ↑
1966 1966  
1967 1967                  break;
1968 1968  
1969 1969          case DDI_SUSPEND:
1970 1970                  ADAPTER_STATE_LOCK(ha);
1971 1971  
1972 1972                  delay_cnt = 0;
1973 1973                  ha->flags |= ADAPTER_SUSPENDED;
1974 1974                  while (ha->flags & ADAPTER_TIMER_BUSY && delay_cnt++ < 10) {
1975 1975                          ADAPTER_STATE_UNLOCK(ha);
1976      -                        delay(drv_usectohz(1000000));
     1976 +                        delay(drv_sectohz(1));
1977 1977                          ADAPTER_STATE_LOCK(ha);
1978 1978                  }
1979 1979                  if (ha->busy || ha->flags & ADAPTER_TIMER_BUSY) {
1980 1980                          ha->flags &= ~ADAPTER_SUSPENDED;
1981 1981                          ADAPTER_STATE_UNLOCK(ha);
1982 1982                          rval = DDI_FAILURE;
1983 1983                          cmn_err(CE_WARN, "!%s(%d): Fail suspend"
1984 1984                              " busy %xh flags %xh", QL_NAME, ha->instance,
1985 1985                              ha->busy, ha->flags);
1986 1986                          break;
↓ open down ↓ 9875 lines elided ↑ open up ↑
11862 11862                      FTO_INSERT_TIME_STAMP);
11863 11863                  if (rval != QL_SUCCESS) {
11864 11864                          EL(ha, "f/w extended trace insert"
11865 11865                              "time stamp failed: %xh\n", rval);
11866 11866                  }
11867 11867          }
11868 11868  
11869 11869          if (lock_needed == TRUE) {
11870 11870                  /* Acquire mailbox register lock. */
11871 11871                  MBX_REGISTER_LOCK(ha);
11872      -                timer = (ha->mcp->timeout + 2) * drv_usectohz(1000000);
     11872 +                timer = drv_sectohz(ha->mcp->timeout + 2);
11873 11873  
11874 11874                  /* Check for mailbox available, if not wait for signal. */
11875 11875                  while (ha->mailbox_flags & MBX_BUSY_FLG) {
11876 11876                          ha->mailbox_flags = (uint8_t)
11877 11877                              (ha->mailbox_flags | MBX_WANT_FLG);
11878 11878  
11879 11879                          /* 30 seconds from now */
11880 11880                          if (cv_reltimedwait(&ha->cv_mbx_wait, &ha->mbx_mutex,
11881 11881                              timer, TR_CLOCK_TICK) == -1) {
11882 11882                                  /*
↓ open down ↓ 4014 lines elided ↑ open up ↑
15897 15897                  mem->cookies = NULL;
15898 15898          }
15899 15899          mem->cookie_count = 0;
15900 15900  
15901 15901          QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
15902 15902  }
15903 15903  
15904 15904  static int
15905 15905  ql_suspend_adapter(ql_adapter_state_t *ha)
15906 15906  {
15907      -        clock_t timer = 32 * drv_usectohz(1000000);
     15907 +        clock_t timer = drv_sectohz(32);
15908 15908  
15909 15909          QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
15910 15910  
15911 15911          /*
15912 15912           * First we will claim mbox ownership so that no
15913 15913           * thread using mbox hangs when we disable the
15914 15914           * interrupt in the middle of it.
15915 15915           */
15916 15916          MBX_REGISTER_LOCK(ha);
15917 15917  
↓ open down ↓ 2031 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX