Print this page
XXXX introduce drv_sectohz


1049         if ((ret = px_lib_msi_getstate(dip, msi_num,
1050             &msi_state)) != DDI_SUCCESS) {
1051                 (void) px_rem_msiq_intr(dip, rdip,
1052                     hdlp, msiq_rec_type, msi_num, msiq_id);
1053 
1054                 mutex_exit(&ib_p->ib_ino_lst_mutex);
1055                 return (ret);
1056         }
1057 
1058         if (msi_state == PCI_MSI_STATE_DELIVERED) {
1059                 ih_p->ih_intr_flags |= PX_INTR_RETARGET;
1060                 old_ih_p->ih_intr_flags |= PX_INTR_RETARGET;
1061         }
1062 
1063         start_time = gethrtime();
1064         while (((ih_p->ih_intr_flags & PX_INTR_RETARGET) &&
1065             (old_ih_p->ih_intr_flags & PX_INTR_RETARGET)) ||
1066             (old_ih_p->ih_intr_flags & PX_INTR_PENDING)) {
1067 
1068                 /* Wait for one second */
1069                 delay(drv_usectohz(1000000));
1070 
1071                 end_time = gethrtime() - start_time;
1072                 if (end_time > px_ib_msix_retarget_timeout) {
1073                         cmn_err(CE_WARN, "MSIX retarget %x is not completed, "
1074                             "even after waiting %llx ticks\n",
1075                             msi_num, end_time);
1076                         break;
1077                 }
1078         }
1079 
1080         ih_p->ih_intr_flags &= ~(PX_INTR_RETARGET);
1081 
1082         mutex_exit(&ib_p->ib_ino_lst_mutex);
1083 
1084         ret = px_rem_msiq_intr(dip, rdip,
1085             hdlp, msiq_rec_type, msi_num, old_msiq_id);
1086 
1087         return (ret);
1088 }
1089 




1049         if ((ret = px_lib_msi_getstate(dip, msi_num,
1050             &msi_state)) != DDI_SUCCESS) {
1051                 (void) px_rem_msiq_intr(dip, rdip,
1052                     hdlp, msiq_rec_type, msi_num, msiq_id);
1053 
1054                 mutex_exit(&ib_p->ib_ino_lst_mutex);
1055                 return (ret);
1056         }
1057 
1058         if (msi_state == PCI_MSI_STATE_DELIVERED) {
1059                 ih_p->ih_intr_flags |= PX_INTR_RETARGET;
1060                 old_ih_p->ih_intr_flags |= PX_INTR_RETARGET;
1061         }
1062 
1063         start_time = gethrtime();
1064         while (((ih_p->ih_intr_flags & PX_INTR_RETARGET) &&
1065             (old_ih_p->ih_intr_flags & PX_INTR_RETARGET)) ||
1066             (old_ih_p->ih_intr_flags & PX_INTR_PENDING)) {
1067 
1068                 /* Wait for one second */
1069                 delay(drv_sectohz(1));
1070 
1071                 end_time = gethrtime() - start_time;
1072                 if (end_time > px_ib_msix_retarget_timeout) {
1073                         cmn_err(CE_WARN, "MSIX retarget %x is not completed, "
1074                             "even after waiting %llx ticks\n",
1075                             msi_num, end_time);
1076                         break;
1077                 }
1078         }
1079 
1080         ih_p->ih_intr_flags &= ~(PX_INTR_RETARGET);
1081 
1082         mutex_exit(&ib_p->ib_ino_lst_mutex);
1083 
1084         ret = px_rem_msiq_intr(dip, rdip,
1085             hdlp, msiq_rec_type, msi_num, old_msiq_id);
1086 
1087         return (ret);
1088 }
1089