Skip to content

Commit

Permalink
NVME workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoll committed Jan 26, 2024
1 parent 1f9ab18 commit 6f94a25
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/nvme/host/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#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"
Expand Down Expand Up @@ -1059,6 +1060,16 @@ static inline int nvme_poll_cq(struct nvme_queue *nvmeq,
{
int found = 0;

/*
* In some cases, such as JH7110 SoC working with Kingston SSD,
* the CQE status may update a little bit later than the MSI,
* which cause an IRQ handle missing.
* As a workaround, here we will check the status first, and wait
* 1us if we get nothing.
*/
if (!nvme_cqe_pending(nvmeq))
udelay(1);

while (nvme_cqe_pending(nvmeq)) {
found++;
/*
Expand Down

0 comments on commit 6f94a25

Please sign in to comment.