All of lore.kernel.org
 help / color / mirror / Atom feed
* Intel NVMe reset issue
@ 2012-11-01 18:36 Panah, Khosrow
  2012-11-01 21:13 ` Busch, Keith
       [not found] ` <511F17E9-6921-4AF3-92F5-9A6448C03B90@sandisk.com>
  0 siblings, 2 replies; 5+ messages in thread
From: Panah, Khosrow @ 2012-11-01 18:36 UTC (permalink / raw)


All,

While testing Intel NVMe driver on Linux, I noticed there are instances controller fails to initialize IDT controller. The problem is related to Intel Linux driver does not wait for "Enable" bit to clear when attempting to setup admin queue.  I am suggesting the following changes to "nvme_configure_admin_queue" routine:

***************
*** 1039,1044 ****
--- 1058,1078 ----
        dev->ctrl_config |= NVME_CC_IOSQES | NVME_CC_IOCQES;

        writel(0, &dev->bar->cc);
+       timeout = (5 * HZ) + jiffies;
+       while (!result && (readl(&dev->bar->csts) & NVME_CSTS_RDY)) {
+               msleep(100);
+               if (fatal_signal_pending(current))
+                       result = -EINTR;
+               if (time_after(jiffies, timeout)) {
+                       dev_err(&dev->pci_dev->dev,
+                               "Device busy; aborting initialisation\n");
+                       result = -ENODEV;
+               }
+       }
+       if (result) {
+               nvme_free_queue_mem(nvmeq);
+               return result;
+       }
        writel(aqa, &dev->bar->aqa);
        writeq(nvmeq->sq_dma_addr, &dev->bar->asq);
        writeq(nvmeq->cq_dma_addr, &dev->bar->acq);

Khosrow

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-11-02 16:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-01 18:36 Intel NVMe reset issue Panah, Khosrow
2012-11-01 21:13 ` Busch, Keith
2012-11-01 21:45   ` Panah, Khosrow
2012-11-02 15:09     ` Matthew Wilcox
     [not found] ` <511F17E9-6921-4AF3-92F5-9A6448C03B90@sandisk.com>
2012-11-02 16:51   ` Kong, Kwok

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.