Skip to content

Commit 51a4f58

Browse files
committed
signal fence_w_ip only if iofence completes
1 parent 148dfe1 commit 51a4f58

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

iommu_ref_model/libiommu/src/iommu_command_queue.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -482,12 +482,6 @@ do_iofence_c(
482482
if ( PR == 1 || PW == 1 )
483483
iommu_to_hb_do_global_observability_sync(PR, PW);
484484

485-
// The wired-signaled-interrupt (WSI) bit when set to 1 causes a wired-interrupt from the command
486-
// queue to be generated on completion of IOFENCE.C. This bit is reserved if the IOMMU supports MSI
487-
if ( g_reg_file.cqcsr.fence_w_ip == 0 && WSI_BIT == 1 ) {
488-
g_reg_file.cqcsr.fence_w_ip = 1;
489-
generate_interrupt(COMMAND_QUEUE);
490-
}
491485
// The AV command operand indicates if ADDR[63:2] operand and DATA operands are valid.
492486
// If AV=1, the IOMMU writes DATA to memory at a 4-byte aligned address ADDR[63:2] * 4 as
493487
// a 4-byte store.
@@ -501,6 +495,12 @@ do_iofence_c(
501495
return 1;
502496
}
503497
}
498+
// The wired-signaled-interrupt (WSI) bit when set to 1 causes a wired-interrupt from the command
499+
// queue to be generated on completion of IOFENCE.C. This bit is reserved if the IOMMU supports MSI
500+
if ( g_reg_file.cqcsr.fence_w_ip == 0 && WSI_BIT == 1 ) {
501+
g_reg_file.cqcsr.fence_w_ip = 1;
502+
generate_interrupt(COMMAND_QUEUE);
503+
}
504504
return 0;
505505
}
506506
// Retry a pending IOFENCE if all invalidations received

0 commit comments

Comments
 (0)