[PATCH 4/5] NVMe: Shutdown controller only for power-off
Christoph Hellwig
hch at infradead.org
Wed Dec 30 09:58:29 PST 2015
On Wed, Dec 30, 2015 at 10:27:50AM -0700, Keith Busch wrote:
> We don't need to shutdown a controller for a reset. A controller in a
> shutdown state may take longer to become ready than one that was simply
> disabled. This patch has the driver shut down a controller only if the
> device is about to be powered off or being removed. When the taking
> the controller down for a reset reason, the controller will be disabled
> instead.
>
> Function names have been updated in this patch to reflect their changed
> semantics.
Am I missing something? What happens to the calls to nvme_disable_queue
in nvme_disable_io_queues and nvme_wait_dq?
> -static void nvme_disable_queue(struct nvme_dev *dev, int qid)
> +static void nvme_disable_admin_queue(struct nvme_dev *dev, bool disable_ctrl)
> {
> - struct nvme_queue *nvmeq = dev->queues[qid];
> + struct nvme_queue *nvmeq = dev->queues[0];
>
> if (!nvmeq)
> return;
> if (nvme_suspend_queue(nvmeq))
> return;
>
> - /* Don't tell the adapter to delete the admin queue.
> - * Don't tell a removed adapter to delete IO queues. */
> - if (qid && readl(dev->bar + NVME_REG_CSTS) != -1) {
> - adapter_delete_sq(dev, qid);
> - adapter_delete_cq(dev, qid);
> - }
> + if (disable_ctrl)
> + nvme_disable_ctrl(&dev->ctrl,
> + lo_hi_readq(dev->bar + NVME_REG_CAP));
Why can't this be done outside this function, similar to the
shutdown case?
More information about the Linux-nvme
mailing list