Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_solaris.c
          +++ new/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_solaris.c
↓ open down ↓ 2641 lines elided ↑ open up ↑
2642 2642  
2643 2643                  /*
2644 2644                   * We must manually poll everything in this thread
2645 2645                   * to keep the driver going.
2646 2646                   */
2647 2647  
2648 2648                  /* Keep polling the chip until our IO is completed */
2649 2649                  /* Driver's timer will not function during panics. */
2650 2650                  /* Therefore, timer checks must be performed manually. */
2651 2651                  (void) drv_getparm(LBOLT, &time);
2652      -                timeout = time + drv_usectohz(1000000);
     2652 +                timeout = time + drv_sectohz(1);
2653 2653                  while (!(sbp->pkt_flags & PACKET_COMPLETED)) {
2654 2654                          EMLXS_SLI_POLL_INTR(hba);
2655 2655                          (void) drv_getparm(LBOLT, &time);
2656 2656  
2657 2657                          /* Trigger timer checks periodically */
2658 2658                          if (time >= timeout) {
2659 2659                                  emlxs_timer_checks(hba);
2660      -                                timeout = time + drv_usectohz(1000000);
     2660 +                                timeout = time + drv_sectohz(1);
2661 2661                          }
2662 2662                  }
2663 2663          } else {
2664 2664                  /* Wait for IO completion */
2665 2665                  /* The driver's timer will detect */
2666 2666                  /* any timeout and abort the I/O. */
2667 2667                  mutex_enter(&EMLXS_PKT_LOCK);
2668 2668                  while (!(sbp->pkt_flags & PACKET_COMPLETED)) {
2669 2669                          cv_wait(&EMLXS_PKT_CV, &EMLXS_PKT_LOCK);
2670 2670                  }
↓ open down ↓ 1086 lines elided ↑ open up ↑
3757 3757                           * interrrupts (hard or soft) and no timers
3758 3758                           */
3759 3759  
3760 3760                          /*
3761 3761                           * We must manually poll everything in this thread
3762 3762                           * to keep the driver going.
3763 3763                           */
3764 3764  
3765 3765                          /* Keep polling the chip until our IO is completed */
3766 3766                          (void) drv_getparm(LBOLT, &time);
3767      -                        timer = time + drv_usectohz(1000000);
     3767 +                        timer = time + drv_sectohz(1);
3768 3768                          while ((time < pkt_timeout) &&
3769 3769                              !(sbp->pkt_flags & PACKET_COMPLETED)) {
3770 3770                                  EMLXS_SLI_POLL_INTR(hba);
3771 3771                                  (void) drv_getparm(LBOLT, &time);
3772 3772  
3773 3773                                  /* Trigger timer checks periodically */
3774 3774                                  if (time >= timer) {
3775 3775                                          emlxs_timer_checks(hba);
3776      -                                        timer = time + drv_usectohz(1000000);
     3776 +                                        timer = time + drv_sectohz(1);
3777 3777                                  }
3778 3778                          }
3779 3779                  } else {
3780 3780                          /* Wait for IO completion or pkt_timeout */
3781 3781                          mutex_enter(&EMLXS_PKT_LOCK);
3782 3782                          pkt_ret = 0;
3783 3783                          while ((pkt_ret != -1) &&
3784 3784                              !(sbp->pkt_flags & PACKET_COMPLETED)) {
3785 3785                                  pkt_ret =
3786 3786                                      cv_timedwait(&EMLXS_PKT_CV,
↓ open down ↓ 252 lines elided ↑ open up ↑
4039 4039  
4040 4040                          emlxs_sli4_hba_reset_all(hba, 1);
4041 4041                  }
4042 4042  
4043 4043                  mutex_enter(&EMLXS_PORT_LOCK);
4044 4044                  hba->reset_state &= ~FC_PORT_RESET_INP;
4045 4045                  hba->reset_request &= ~(FC_PORT_RESET | FC_LINK_RESET);
4046 4046                  mutex_exit(&EMLXS_PORT_LOCK);
4047 4047  
4048 4048                  /* Wait for the timer thread to detect the error condition */
4049      -                delay(drv_usectohz(1000000));
     4049 +                delay(drv_sectohz(1));
4050 4050  
4051 4051                  /* Wait for the HBA to re-initialize */
4052 4052                  i = 0;
4053 4053                  mutex_enter(&EMLXS_PORT_LOCK);
4054 4054                  while (!(hba->flag & FC_ONLINE_MODE) && (i++ < 30)) {
4055 4055                          mutex_exit(&EMLXS_PORT_LOCK);
4056      -                        delay(drv_usectohz(1000000));
     4056 +                        delay(drv_sectohz(1));
4057 4057                          mutex_enter(&EMLXS_PORT_LOCK);
4058 4058                  }
4059 4059  
4060 4060                  if (!(hba->flag & FC_ONLINE_MODE)) {
4061 4061                          rval = FC_FAILURE;
4062 4062                  }
4063 4063  
4064 4064                  mutex_exit(&EMLXS_PORT_LOCK);
4065 4065  
4066 4066                  return (rval);
↓ open down ↓ 8345 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX