Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/fibre-channel/impl/fp.c
          +++ new/usr/src/uts/common/io/fibre-channel/impl/fp.c
↓ open down ↓ 430 lines elided ↑ open up ↑
 431  431                          port->fp_soft_state &= ~FP_DETACH_INPROGRESS;
 432  432                          mutex_exit(&port->fp_mutex);
 433  433                          rval = DDI_FAILURE;
 434  434                          break;
 435  435                  }
 436  436  
 437  437                  mutex_enter(&port->fp_mutex);
 438  438                  for (cnt = 0; (port->fp_job_head) && (cnt < fp_cmd_wait_cnt);
 439  439                      cnt++) {
 440  440                          mutex_exit(&port->fp_mutex);
 441      -                        delay(drv_usectohz(1000000));
      441 +                        delay(drv_sectohz(1));
 442  442                          mutex_enter(&port->fp_mutex);
 443  443                  }
 444  444  
 445  445                  if (port->fp_job_head) {
 446  446                          mutex_exit(&port->fp_mutex);
 447  447                          rval = DDI_FAILURE;
 448  448                          break;
 449  449                  }
 450  450                  mutex_exit(&port->fp_mutex);
 451  451  
↓ open down ↓ 1059 lines elided ↑ open up ↑
1511 1511                  cmn_err(CE_WARN, "fp(%d): %d fp_cmd(s) is/are in progress"
1512 1512                      " Failing detach", port->fp_instance, port->fp_out_fpcmds);
1513 1513                  return (DDI_FAILURE);
1514 1514          }
1515 1515  
1516 1516          while ((port->fp_soft_state &
1517 1517              (FP_SOFT_IN_STATEC_CB | FP_SOFT_IN_UNSOL_CB)) &&
1518 1518              (delay_count < 30)) {
1519 1519                  mutex_exit(&port->fp_mutex);
1520 1520                  delay_count++;
1521      -                delay(drv_usectohz(1000000));
     1521 +                delay(drv_sectohz(1));
1522 1522                  mutex_enter(&port->fp_mutex);
1523 1523          }
1524 1524  
1525 1525          if (port->fp_soft_state &
1526 1526              (FP_SOFT_IN_STATEC_CB | FP_SOFT_IN_UNSOL_CB)) {
1527 1527                  port->fp_soft_state &= ~FP_DETACH_INPROGRESS;
1528 1528                  mutex_exit(&port->fp_mutex);
1529 1529  
1530 1530                  cmn_err(CE_WARN, "fp(%d): FCA callback in progress: "
1531 1531                      " Failing detach", port->fp_instance);
↓ open down ↓ 149 lines elided ↑ open up ↑
1681 1681           * if the callback processing completes may be another idea. Since
1682 1682           * most of the callback processing involves a lot of work, it
1683 1683           * is safe to just fail the SUSPEND operation. It is definitely
1684 1684           * not bad to fail the SUSPEND operation if the driver is busy.
1685 1685           */
1686 1686          delay_count = 0;
1687 1687          while ((port->fp_soft_state & (FP_SOFT_IN_STATEC_CB |
1688 1688              FP_SOFT_IN_UNSOL_CB)) && (delay_count < 30)) {
1689 1689                  mutex_exit(&port->fp_mutex);
1690 1690                  delay_count++;
1691      -                delay(drv_usectohz(1000000));
     1691 +                delay(drv_sectohz(1));
1692 1692                  mutex_enter(&port->fp_mutex);
1693 1693          }
1694 1694  
1695 1695          if (port->fp_soft_state & (FP_SOFT_IN_STATEC_CB |
1696 1696              FP_SOFT_IN_UNSOL_CB)) {
1697 1697                  mutex_exit(&port->fp_mutex);
1698 1698                  cmn_err(CE_WARN, "fp(%d): FCA callback in progress: "
1699 1699                      " Failing suspend", port->fp_instance);
1700 1700                  return (DDI_FAILURE);
1701 1701          }
↓ open down ↓ 13704 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX