NVMe: don't try to read csts when failing to reset it
authorShawn Lin <shawn.lin@rock-chips.com>
Mon, 19 Dec 2016 10:42:01 +0000 (18:42 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 21 Dec 2016 03:22:23 +0000 (11:22 +0800)
We could find the external abort for trying to access
nvme's BAR space to check the csts, but it's possible
that the link state is forbidden to access the BAR when
failing to reset it. So we should reuse the former csts
to print the log instead of doing that again.

Change-Id: I34438a726381e588eb21149b1aab76a66ef0e665
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
drivers/nvme/host/pci.c

index c851bc53831c1267c0cccab074e5cd141b1d5825..8bb2c666eb4c0a050a05cbc33e6dba4d01f30047 100644 (file)
@@ -2217,8 +2217,8 @@ static int nvme_kthread(void *data)
                                                        csts & NVME_CSTS_CFS) {
                                if (!__nvme_reset(dev)) {
                                        dev_warn(dev->dev,
-                                               "Failed status: %x, reset controller\n",
-                                               readl(&dev->bar->csts));
+                                               "Failed status: 0x%x, reset controller\n",
+                                               csts);
                                }
                                continue;
                        }