
From: Tianyang Zhang <zhangtianyang@loongson.cn> LoongArch inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IC6CVG CVE: NA -------------------------------- There is no guarantee of sequence between DMA and interrupts on the Loongson platform. Signed-off-by: songwenge <songwenge@loongson.cn> Signed-off-by: Tianyang Zhang <zhangtianyang@loongson.cn> Change-Id: Ide7456d6fdeb29a3b2b421ee54af27a8b13adad2 --- drivers/nvme/host/pci.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index b1310e69d07d..f5b44909c742 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -10,6 +10,9 @@ #include <linux/blk-mq.h> #include <linux/blk-mq-pci.h> #include <linux/blk-integrity.h> +#ifdef CONFIG_LOONGARCH +#include <linux/delay.h> +#endif #include <linux/dmi.h> #include <linux/init.h> #include <linux/interrupt.h> @@ -1079,6 +1082,13 @@ static irqreturn_t nvme_irq(int irq, void *data) struct nvme_queue *nvmeq = data; DEFINE_IO_COMP_BATCH(iob); +#ifdef CONFIG_LOONGARCH + /* + * There is no guarantee of sequence between DMA + * and interrupts on the Loongson platform. + */ + udelay(30); +#endif if (nvme_poll_cq(nvmeq, &iob)) { if (!rq_list_empty(iob.req_list)) nvme_pci_complete_batch(&iob); -- 2.33.0