mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 04:04:06 +00:00
drivers: nvme: Add precheck and delay for CQE pending status.
To workaroud the NVMe I/O timeout problem in bootup S10udev case which caused by the CQE update lantancy. Signed-off-by: Kevin.xie <kevin.xie@starfivetech.com>
This commit is contained in:
parent
139867421b
commit
c0855d2d61
1 changed files with 10 additions and 0 deletions
|
@ -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"
|
||||
|
@ -1060,6 +1061,15 @@ static inline int nvme_poll_cq(struct nvme_queue *nvmeq,
|
|||
{
|
||||
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++;
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue