Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/myri10ge/drv/myri10ge.c
          +++ new/usr/src/uts/common/io/myri10ge/drv/myri10ge.c
↓ open down ↓ 2207 lines elided ↑ open up ↑
2208 2208          int i, polling;
2209 2209  
2210 2210          old_down_cnt = mgp->down_cnt;
2211 2211          mb();
2212 2212          status = myri10ge_send_cmd(mgp, MXGEFW_CMD_ETHERNET_DOWN, &cmd);
2213 2213          if (status) {
2214 2214                  cmn_err(CE_WARN, "%s: Couldn't bring down link\n", mgp->name);
2215 2215          }
2216 2216  
2217 2217          while (old_down_cnt == *((volatile int *)&mgp->down_cnt)) {
2218      -                delay(1 * drv_usectohz(1000000));
     2218 +                delay(drv_sectohz(1));
2219 2219                  wait_time--;
2220 2220                  if (wait_time == 0)
2221 2221                          break;
2222 2222          }
2223 2223  again:
2224 2224          if (old_down_cnt == *((volatile int *)&mgp->down_cnt)) {
2225 2225                  cmn_err(CE_WARN, "%s: didn't get down irq\n", mgp->name);
2226 2226                  for (i = 0; i < mgp->num_slices; i++) {
2227 2227                          /*
2228 2228                           * take and release the rx lock to ensure
↓ open down ↓ 7 lines elided ↑ open up ↑
2236 2236                              mgp->name, i);
2237 2237                          mutex_exit(&mgp->ss[i].rx_lock);
2238 2238  
2239 2239                          /* verify that the poll handler is inactive */
2240 2240                          mutex_enter(&mgp->ss->poll_lock);
2241 2241                          polling = mgp->ss->rx_polling;
2242 2242                          mutex_exit(&mgp->ss->poll_lock);
2243 2243                          if (polling) {
2244 2244                                  printf("%s: slice %d is polling\n",
2245 2245                                      mgp->name, i);
2246      -                                delay(1 * drv_usectohz(1000000));
     2246 +                                delay(drv_sectohz(1));
2247 2247                                  goto again;
2248 2248                          }
2249 2249                  }
2250      -                delay(1 * drv_usectohz(1000000));
     2250 +                delay(drv_sectohz(1));
2251 2251                  if (old_down_cnt == *((volatile int *)&mgp->down_cnt)) {
2252 2252                          cmn_err(CE_WARN, "%s: Never got down irq\n", mgp->name);
2253 2253                  }
2254 2254          }
2255 2255  
2256 2256          for (i = 0; i < mgp->num_slices; i++)
2257 2257                  myri10ge_teardown_slice(&mgp->ss[i]);
2258 2258  
2259 2259          if (mgp->toeplitz_hash_table != NULL) {
2260 2260                  kmem_free(mgp->toeplitz_hash_table,
↓ open down ↓ 3609 lines elided ↑ open up ↑
5870 5870          mgp->pause = myri10ge_flow_control;
5871 5871          mutex_exit(&myri10ge_param_lock);
5872 5872  
5873 5873          mgp->max_read_request_4k = max_read_request_4k;
5874 5874          mgp->pcie_link_width = link_width;
5875 5875          mgp->running = MYRI10GE_ETH_STOPPED;
5876 5876          mgp->vso = vso;
5877 5877          mgp->dip = dip;
5878 5878          mgp->cfg_hdl = handle;
5879 5879  
5880      -        mgp->timer_ticks = 5 * drv_usectohz(1000000); /* 5 seconds */
     5880 +        mgp->timer_ticks = drv_sectohz(5);
5881 5881          myri10ge_test_physical(dip);
5882 5882  
5883 5883          /* allocate command page */
5884 5884          bytes = sizeof (*mgp->cmd);
5885 5885          mgp->cmd = (mcp_cmd_response_t *)
5886 5886              (void *)myri10ge_dma_alloc(dip, bytes,
5887 5887              &myri10ge_misc_dma_attr, &myri10ge_dev_access_attr,
5888 5888              DDI_DMA_CONSISTENT, DDI_DMA_RDWR|DDI_DMA_CONSISTENT,
5889 5889              &mgp->cmd_dma, 1, DDI_DMA_DONTWAIT);
5890 5890          if (mgp->cmd == NULL)
↓ open down ↓ 360 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX