[PATCH 11/12] nvme-pci: split the initial probe from the rest path
Keith Busch
kbusch at kernel.org
Wed Nov 9 09:00:57 PST 2022
On Wed, Nov 09, 2022 at 07:31:19AM +0100, Christoph Hellwig wrote:
> On Wed, Nov 09, 2022 at 05:14:02AM +0200, Sagi Grimberg wrote:
> >> - if (dev->online_queues > 1) {
> >> - nvme_pci_alloc_tag_set(dev);
> >> - nvme_dbbuf_set(dev);
> >> - } else {
> >> - dev_warn(dev->ctrl.device, "IO queues not created\n");
> >> - }
> >> + dev_warn(dev->ctrl.device, "IO queues lost\n");
> >> + nvme_mark_namespaces_dead(&dev->ctrl);
> >> + nvme_start_queues(&dev->ctrl);
> >> + nvme_remove_namespaces(&dev->ctrl);
> >
> > Is this needed? isn't nvme_remove coming soon?
> > In fact, shouldn't all these calls be in nvme_remove?
>
> This handles the case where a controller controller does not have I/O
> queues. For controllers that never had them (e.g. admin controllers)
> none of the three calls above is needed, but they deal with the
> case where a controller had queues, but they are going away. I'm
> not sure if that can happen, but it keeps the behavior of the existing
> code. Keith wrote it to deal with Intel controllers that can be in
> a degraded state where having the admin queue live even without I/O
> queues allows updating the firmware, so he might know more.
Right, firmware assert and other types of errors can put the controller
into a degraded state with only an admin-queue when it previously had
working IO queues. Keeping the admin queue active allows an admin to
pull logs for their bug reports.
More information about the Linux-nvme
mailing list