#include <linux/io-64-nonatomic-hi-lo.h>
#include <linux/sed-opal.h>
#include <linux/pci-p2pdma.h>
+#include <linux/delay.h>
#include "trace.h"
#include "nvme.h"
{
int found = 0;
+ /*
+ * In some cases, such as udev trigger, cqe status may update
+ * a little bit later than MSI, which cause an irq handle missing.
+ * To workaound, here we will prefetch the status first, and wait
+ * 1us if we get nothing.
+ */
+ if (!nvme_cqe_pending(nvmeq))
+ udelay(1);
+
while (nvme_cqe_pending(nvmeq)) {
found++;
/*