• Home
  • Raw
  • Download

Lines Matching refs:qi

1120 	if (iommu->qi) {  in free_iommu()
1121 free_page((unsigned long)iommu->qi->desc); in free_iommu()
1122 kfree(iommu->qi->desc_status); in free_iommu()
1123 kfree(iommu->qi); in free_iommu()
1136 static inline void reclaim_free_desc(struct q_inval *qi) in reclaim_free_desc() argument
1138 while (qi->desc_status[qi->free_tail] == QI_DONE || in reclaim_free_desc()
1139 qi->desc_status[qi->free_tail] == QI_ABORT) { in reclaim_free_desc()
1140 qi->desc_status[qi->free_tail] = QI_FREE; in reclaim_free_desc()
1141 qi->free_tail = (qi->free_tail + 1) % QI_LENGTH; in reclaim_free_desc()
1142 qi->free_cnt++; in reclaim_free_desc()
1150 struct q_inval *qi = iommu->qi; in qi_check_fault() local
1153 if (qi->desc_status[wait_index] == QI_ABORT) in qi_check_fault()
1168 (unsigned long long)qi->desc[index].low, in qi_check_fault()
1169 (unsigned long long)qi->desc[index].high); in qi_check_fault()
1170 memcpy(&qi->desc[index], &qi->desc[wait_index], in qi_check_fault()
1191 if (qi->desc_status[head] == QI_IN_USE) in qi_check_fault()
1192 qi->desc_status[head] = QI_ABORT; in qi_check_fault()
1196 if (qi->desc_status[wait_index] == QI_ABORT) in qi_check_fault()
1213 struct q_inval *qi = iommu->qi; in qi_submit_sync() local
1218 if (!qi) in qi_submit_sync()
1221 hw = qi->desc; in qi_submit_sync()
1226 raw_spin_lock_irqsave(&qi->q_lock, flags); in qi_submit_sync()
1227 while (qi->free_cnt < 3) { in qi_submit_sync()
1228 raw_spin_unlock_irqrestore(&qi->q_lock, flags); in qi_submit_sync()
1230 raw_spin_lock_irqsave(&qi->q_lock, flags); in qi_submit_sync()
1233 index = qi->free_head; in qi_submit_sync()
1236 qi->desc_status[index] = qi->desc_status[wait_index] = QI_IN_USE; in qi_submit_sync()
1242 wait_desc.high = virt_to_phys(&qi->desc_status[wait_index]); in qi_submit_sync()
1246 qi->free_head = (qi->free_head + 2) % QI_LENGTH; in qi_submit_sync()
1247 qi->free_cnt -= 2; in qi_submit_sync()
1253 writel(qi->free_head << DMAR_IQ_SHIFT, iommu->reg + DMAR_IQT_REG); in qi_submit_sync()
1255 while (qi->desc_status[wait_index] != QI_DONE) { in qi_submit_sync()
1267 raw_spin_unlock(&qi->q_lock); in qi_submit_sync()
1269 raw_spin_lock(&qi->q_lock); in qi_submit_sync()
1272 qi->desc_status[index] = QI_DONE; in qi_submit_sync()
1274 reclaim_free_desc(qi); in qi_submit_sync()
1275 raw_spin_unlock_irqrestore(&qi->q_lock, flags); in qi_submit_sync()
1394 struct q_inval *qi = iommu->qi; in __dmar_enable_qi() local
1396 qi->free_head = qi->free_tail = 0; in __dmar_enable_qi()
1397 qi->free_cnt = QI_LENGTH; in __dmar_enable_qi()
1404 dmar_writeq(iommu->reg + DMAR_IQA_REG, virt_to_phys(qi->desc)); in __dmar_enable_qi()
1422 struct q_inval *qi; in dmar_enable_qi() local
1431 if (iommu->qi) in dmar_enable_qi()
1434 iommu->qi = kmalloc(sizeof(*qi), GFP_ATOMIC); in dmar_enable_qi()
1435 if (!iommu->qi) in dmar_enable_qi()
1438 qi = iommu->qi; in dmar_enable_qi()
1443 kfree(qi); in dmar_enable_qi()
1444 iommu->qi = NULL; in dmar_enable_qi()
1448 qi->desc = page_address(desc_page); in dmar_enable_qi()
1450 qi->desc_status = kzalloc(QI_LENGTH * sizeof(int), GFP_ATOMIC); in dmar_enable_qi()
1451 if (!qi->desc_status) { in dmar_enable_qi()
1452 free_page((unsigned long) qi->desc); in dmar_enable_qi()
1453 kfree(qi); in dmar_enable_qi()
1454 iommu->qi = NULL; in dmar_enable_qi()
1458 raw_spin_lock_init(&qi->q_lock); in dmar_enable_qi()
1739 if (!iommu->qi) in dmar_reenable_qi()