Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/pciex/hotplug/pciehpc.c
          +++ new/usr/src/uts/common/io/pciex/hotplug/pciehpc.c
↓ open down ↓ 1120 lines elided ↑ open up ↑
1121 1121                          /* check Link status */
1122 1122                          status =  pciehpc_reg_get16(ctrl_p,
1123 1123                              bus_p->bus_pcie_off +
1124 1124                              PCIE_LINKSTS);
1125 1125                          if (!(status & PCIE_LINKSTS_DLL_LINK_ACTIVE))
1126 1126                                  goto cleanup2;
1127 1127                  }
1128 1128          }
1129 1129  
1130 1130          /* wait 1 sec for link to come up */
1131      -        delay(drv_usectohz(1000000));
     1131 +        delay(drv_sectohz(1));
1132 1132  
1133 1133          /* check power is really turned ON */
1134 1134          control =  pciehpc_reg_get16(ctrl_p,
1135 1135              bus_p->bus_pcie_off + PCIE_SLOTCTL);
1136 1136  
1137 1137          if (control & PCIE_SLOTCTL_PWR_CONTROL) {
1138 1138                  PCIE_DBG("slot %d fails to turn on power on connect\n",
1139 1139                      slot_p->hs_phy_slot_num);
1140 1140  
1141 1141                  goto cleanup1;
↓ open down ↓ 18 lines elided ↑ open up ↑
1160 1160                  status =  pciehpc_reg_get16(ctrl_p,
1161 1161                      bus_p->bus_pcie_off + PCIE_SLOTSTS);
1162 1162  
1163 1163                  if (!(status & PCIE_SLOTSTS_EMI_LOCK_SET)) {
1164 1164                          control =  pciehpc_reg_get16(ctrl_p,
1165 1165                              bus_p->bus_pcie_off + PCIE_SLOTCTL);
1166 1166                          control |= PCIE_SLOTCTL_EMI_LOCK_CONTROL;
1167 1167                          pciehpc_issue_hpc_command(ctrl_p, control);
1168 1168  
1169 1169                          /* wait 1 sec after toggling the state of EMI lock */
1170      -                        delay(drv_usectohz(1000000));
     1170 +                        delay(drv_sectohz(1));
1171 1171                  }
1172 1172          }
1173 1173  
1174 1174          *result = slot_p->hs_info.cn_state =
1175 1175              DDI_HP_CN_STATE_POWERED;
1176 1176  
1177 1177          return (DDI_SUCCESS);
1178 1178  
1179 1179  cleanup2:
1180 1180          control =  pciehpc_reg_get16(ctrl_p,
↓ open down ↓ 88 lines elided ↑ open up ↑
1269 1269                  status =  pciehpc_reg_get16(ctrl_p,
1270 1270                      bus_p->bus_pcie_off + PCIE_SLOTSTS);
1271 1271  
1272 1272                  if (status & PCIE_SLOTSTS_EMI_LOCK_SET) {
1273 1273                          control =  pciehpc_reg_get16(ctrl_p,
1274 1274                              bus_p->bus_pcie_off + PCIE_SLOTCTL);
1275 1275                          control |= PCIE_SLOTCTL_EMI_LOCK_CONTROL;
1276 1276                          pciehpc_issue_hpc_command(ctrl_p, control);
1277 1277  
1278 1278                          /* wait 1 sec after toggling the state of EMI lock */
1279      -                        delay(drv_usectohz(1000000));
     1279 +                        delay(drv_sectohz(1));
1280 1280                  }
1281 1281          }
1282 1282  
1283 1283          /* get the current state of the slot */
1284 1284          pciehpc_get_slot_state(slot_p);
1285 1285  
1286 1286          *result = slot_p->hs_info.cn_state;
1287 1287  
1288 1288          return (DDI_SUCCESS);
1289 1289  
↓ open down ↓ 1049 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX