Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH v2] nvme: split nvme_uninit_ctrl into stop and uninit
Date: Wed, 5 Jul 2017 16:18:20 -0400	[thread overview]
Message-ID: <20170705201819.GA24413@localhost.localdomain> (raw)
In-Reply-To: <1499284138-595-1-git-send-email-sagi@grimberg.me>

On Wed, Jul 05, 2017@10:48:58PM +0300, Sagi Grimberg wrote:
> -void nvme_uninit_ctrl(struct nvme_ctrl *ctrl)
> +void nvme_stop_ctrl(struct nvme_ctrl *ctrl)
>  {
> +	nvme_stop_keep_alive(ctrl);
>  	flush_work(&ctrl->async_event_work);
>  	flush_work(&ctrl->scan_work);
> -	nvme_remove_namespaces(ctrl);
> +}
> +EXPORT_SYMBOL_GPL(nvme_stop_ctrl);
> +
> +void nvme_start_ctrl(struct nvme_ctrl *ctrl)
> +{
> +	if (ctrl->kato)
> +		nvme_start_keep_alive(ctrl);
> +
> +	if (ctrl->queue_count > 1) {
> +		nvme_queue_scan(ctrl);
> +		nvme_queue_async_events(ctrl);
> +		nvme_start_queues(ctrl);
> +	}
> +}
> +EXPORT_SYMBOL_GPL(nvme_start_ctrl);
>  
> +void nvme_uninit_ctrl(struct nvme_ctrl *ctrl)
> +{
>  	device_destroy(nvme_class, MKDEV(nvme_char_major, ctrl->instance));
>  
>  	spin_lock(&dev_list_lock);

Mostly fine, but I don't think we want to move nvme_unint_ctrl to the
'free_ctrl' path. The 'free_ctrl' is called only when all references are
dropped. 'nvme_unint_ctrl' prevents new references on the device being
removed, so this should be done even if active references exist.

      reply	other threads:[~2017-07-05 20:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-05 19:48 [PATCH v2] nvme: split nvme_uninit_ctrl into stop and uninit Sagi Grimberg
2017-07-05 20:18 ` Keith Busch [this message]

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=20170705201819.GA24413@localhost.localdomain \
    --to=keith.busch@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox