All of lore.kernel.org
 help / color / mirror / Atom feed
From: willy@linux.intel.com (Matthew Wilcox)
Subject: Intel NVMe reset issue
Date: Fri, 2 Nov 2012 11:09:05 -0400	[thread overview]
Message-ID: <20121102150905.GT4244@linux.intel.com> (raw)
In-Reply-To: <83DBBFBAD6CE2C4AA9C5DE7652017DE44BBEDBAE@corpmail1.na.ads.idt.com>

On Thu, Nov 01, 2012@09:45:33PM +0000, Panah, Khosrow wrote:
> Busch,
> 
> I used the 5 seconds as the worst case scenario to allow controller transition of CC.EN from 1 to 0. I concur that I have seen a timeout value specified in specification neither.

It's probably not in the latest ECN, but in the meeting last week, we
decided that the NVME_CAP_TIMEOUT applied to both the wait for RDY and
the wait for EN.  ie controller manufacturers should specify it to be
the maximum of the two waits.

By the way, this is not the 'Intel NVMe driver'.  This is the Linux
NVMe driver.  I only happen to work at Intel ... if I were to leave, I
would remain the NVMe maintainer.  NB: I have no plans to leave Intel :-)

> Khosrow
> 
> 
> -----Original Message-----
> From: Busch, Keith [mailto:keith.busch at intel.com] 
> Sent: Thursday, November 01, 2012 2:13 PM
> To: Panah, Khosrow; linux-nvme at lists.infradead.org
> Cc: Kong, Kwok
> Subject: RE: Intel NVMe reset issue
> 
> I think this looks good. Just curious, where does the 5 second timeout come from? That sounds reasonable to me, but I don't see that ECN033 specifies what the timeout should be for CSTS.RDY to transition from 1 to 0 after setting CC.EN to 0.
> 
> Reviewed-by: Keith Busch <keith.busch at intel.com>
> 
> > -----Original Message-----
> > From: linux-nvme-bounces at lists.infradead.org [mailto:linux-nvme- 
> > bounces at lists.infradead.org] On Behalf Of Panah, Khosrow
> > Sent: Thursday, November 01, 2012 12:37 PM
> > To: linux-nvme at lists.infradead.org
> > Cc: Kong, Kwok
> > Subject: Intel NVMe reset issue
> > 
> > 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
> > 
> > 
> > _______________________________________________
> > Linux-nvme mailing list
> > Linux-nvme at lists.infradead.org
> > http://merlin.infradead.org/mailman/listinfo/linux-nvme
> 
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://merlin.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2012-11-02 15:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
     [not found] ` <511F17E9-6921-4AF3-92F5-9A6448C03B90@sandisk.com>
2012-11-02 16:51   ` Kong, Kwok

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121102150905.GT4244@linux.intel.com \
    --to=willy@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.