Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/fibre-channel/ulp/fcp.c
          +++ new/usr/src/uts/common/io/fibre-channel/ulp/fcp.c
↓ open down ↓ 4051 lines elided ↑ open up ↑
4052 4052                                                  cdip = mdi_pi_get_client(
4053 4053                                                      PIP(plun->lun_cip));
4054 4054                                          }
4055 4055                                          if (cdip == NULL) {
4056 4056                                                  *rval = ENXIO;
4057 4057                                                  break;
4058 4058                                          }
4059 4059  
4060 4060                                          if (!i_ddi_devi_attached(cdip)) {
4061 4061                                                  mutex_exit(&plun->lun_mutex);
4062      -                                                delay(drv_usectohz(1000000));
     4062 +                                                delay(drv_sectohz(1));
4063 4063                                                  mutex_enter(&plun->lun_mutex);
4064 4064                                          } else {
4065 4065                                                  /*
4066 4066                                                   * This Lun is ready, lets
4067 4067                                                   * check the next one.
4068 4068                                                   */
4069 4069                                                  mutex_exit(&plun->lun_mutex);
4070 4070                                                  plun = plun->lun_next;
4071 4071                                                  while (plun && (plun->lun_state
4072 4072                                                      & FCP_LUN_OFFLINE)) {
↓ open down ↓ 350 lines elided ↑ open up ↑
4423 4423                   * link has gone from offline to online
4424 4424                   */
4425 4425                  FCP_TRACE(fcp_logq, pptr->port_instbuf,
4426 4426                      fcp_trace, FCP_BUF_LEVEL_3, 0,
4427 4427                      "link went online");
4428 4428  
4429 4429                  pptr->port_link_cnt++;
4430 4430  
4431 4431                  while (pptr->port_ipkt_cnt) {
4432 4432                          mutex_exit(&pptr->port_mutex);
4433      -                        delay(drv_usectohz(1000000));
     4433 +                        delay(drv_sectohz(1));
4434 4434                          mutex_enter(&pptr->port_mutex);
4435 4435                  }
4436 4436  
4437 4437                  pptr->port_topology = port_top;
4438 4438  
4439 4439                  /*
4440 4440                   * The state of the targets and luns accessible through this
4441 4441                   * port is updated.
4442 4442                   */
4443 4443                  fcp_update_state(pptr, FCP_LUN_BUSY | FCP_LUN_MARK,
↓ open down ↓ 333 lines elided ↑ open up ↑
4777 4777                                           * to get drained
4778 4778                                           */
4779 4779                                          mutex_exit(&ptgt->tgt_mutex);
4780 4780                                          mutex_exit(&pptr->port_mutex);
4781 4781  
4782 4782                                          mutex_enter(&ptgt->tgt_mutex);
4783 4783                                          while (ptgt->tgt_ipkt_cnt ||
4784 4784                                              fcp_outstanding_lun_cmds(ptgt)
4785 4785                                              == FC_SUCCESS) {
4786 4786                                                  mutex_exit(&ptgt->tgt_mutex);
4787      -                                                delay(drv_usectohz(1000000));
     4787 +                                                delay(drv_sectohz(1));
4788 4788                                                  mutex_enter(&ptgt->tgt_mutex);
4789 4789                                          }
4790 4790                                          mutex_exit(&ptgt->tgt_mutex);
4791 4791  
4792 4792                                          mutex_enter(&pptr->port_mutex);
4793 4793                                          mutex_enter(&ptgt->tgt_mutex);
4794 4794  
4795 4795                                          (void) fcp_offline_target(pptr, ptgt,
4796 4796                                              link_cnt, map_tag[i], 0, 0);
4797 4797                                  }
↓ open down ↓ 5202 lines elided ↑ open up ↑
10000 10000           */
10001 10001          mutex_enter(&fcp_global_mutex);
10002 10002          if (fcp_port_head == NULL) {
10003 10003                  fcp_read_blacklist(pinfo->port_dip, &fcp_lun_blacklist);
10004 10004          }
10005 10005          pptr->port_next = fcp_port_head;
10006 10006          fcp_port_head = pptr;
10007 10007          soft_state_linked++;
10008 10008  
10009 10009          if (fcp_watchdog_init++ == 0) {
10010      -                fcp_watchdog_tick = fcp_watchdog_timeout *
10011      -                    drv_usectohz(1000000);
     10010 +                fcp_watchdog_tick = drv_sectohz(fcp_watchdog_timeout);
10012 10011                  fcp_watchdog_id = timeout(fcp_watch, NULL,
10013 10012                      fcp_watchdog_tick);
10014 10013          }
10015 10014          mutex_exit(&fcp_global_mutex);
10016 10015  
10017 10016          /*
10018 10017           * Here an attempt is made to register with the name server, the new
10019 10018           * FCP capability.  That is done using an RTF_ID to the name server.
10020 10019           * It is done synchronously.  The function fcp_do_ns_registry()
10021 10020           * doesn't return till the name server responded.
↓ open down ↓ 269 lines elided ↑ open up ↑
10291 10290          while (pptr->port_tmp_cnt || pptr->port_ipkt_cnt ||
10292 10291              (pptr->port_state & FCP_STATE_IN_WATCHDOG)) {
10293 10292                  /*
10294 10293                   * Let's give sufficient time for reconfig/ipkt
10295 10294                   * to complete.
10296 10295                   */
10297 10296                  if (count++ >= FCP_ICMD_DEADLINE) {
10298 10297                          break;
10299 10298                  }
10300 10299                  mutex_exit(&pptr->port_mutex);
10301      -                delay(drv_usectohz(1000000));
     10300 +                delay(drv_sectohz(1));
10302 10301                  mutex_enter(&pptr->port_mutex);
10303 10302          }
10304 10303  
10305 10304          /*
10306 10305           * if the driver is still busy then fail to
10307 10306           * suspend/power down.
10308 10307           */
10309 10308          if (pptr->port_tmp_cnt || pptr->port_ipkt_cnt ||
10310 10309              (pptr->port_state & FCP_STATE_IN_WATCHDOG)) {
10311 10310                  pptr->port_state &= ~flag;
↓ open down ↓ 1893 lines elided ↑ open up ↑
12205 12204          mutex_exit(&pptr->port_mutex);
12206 12205  
12207 12206          /*
12208 12207           * Make a copy of ulp_port_info as fctl allocates
12209 12208           * a temp struct.
12210 12209           */
12211 12210          (void) fcp_cp_pinfo(pptr, pinfo);
12212 12211  
12213 12212          mutex_enter(&fcp_global_mutex);
12214 12213          if (fcp_watchdog_init++ == 0) {
12215      -                fcp_watchdog_tick = fcp_watchdog_timeout *
12216      -                    drv_usectohz(1000000);
     12214 +                fcp_watchdog_tick = drv_sectohz(fcp_watchdog_timeout);
12217 12215                  fcp_watchdog_id = timeout(fcp_watch,
12218 12216                      NULL, fcp_watchdog_tick);
12219 12217          }
12220 12218          mutex_exit(&fcp_global_mutex);
12221 12219  
12222 12220          /*
12223 12221           * Handle various topologies and link states.
12224 12222           */
12225 12223          switch (FC_PORT_STATE_MASK(pptr->port_phys_state)) {
12226 12224          case FC_STATE_OFFLINE:
↓ open down ↓ 4137 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX