public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Matias Bjørling" <mb@lightnvm.io>
To: Wenwei Tao <ww.tao0320@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvme: lightnvm: use nvme admin queue
Date: Fri, 20 Nov 2015 13:45:08 +0100	[thread overview]
Message-ID: <564F15D4.4010508@lightnvm.io> (raw)
In-Reply-To: <1448000896-4526-1-git-send-email-ww.tao0320@gmail.com>

On 11/20/2015 07:28 AM, Wenwei Tao wrote:
> According to Open-ChannelSSDInterfaceSpecification 0.1,
> NVMe-NVM admin commands use vendor specific admin opcodes
> of NVMe, so use the NVMe admin queue to dispatch these
> commands
>
> Signed-off-by: Wenwei Tao <ww.tao0320@gmail.com>
> ---
>   drivers/nvme/host/lightnvm.c | 13 +++++++------
>   1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
> index e0b7b95..7d1981d 100644
> --- a/drivers/nvme/host/lightnvm.c
> +++ b/drivers/nvme/host/lightnvm.c
> @@ -244,6 +244,7 @@ static int init_grps(struct nvm_id *nvm_id, struct nvme_nvm_id *nvme_nvm_id)
>   static int nvme_nvm_identity(struct request_queue *q, struct nvm_id *nvm_id)
>   {
>   	struct nvme_ns *ns = q->queuedata;
> +	struct nvme_dev *dev = ns->dev;
>   	struct nvme_nvm_id *nvme_nvm_id;
>   	struct nvme_nvm_command c = {};
>   	int ret;
> @@ -256,8 +257,8 @@ static int nvme_nvm_identity(struct request_queue *q, struct nvm_id *nvm_id)
>   	if (!nvme_nvm_id)
>   		return -ENOMEM;
>
> -	ret = nvme_submit_sync_cmd(q, (struct nvme_command *)&c, nvme_nvm_id,
> -						sizeof(struct nvme_nvm_id));
> +	ret = nvme_submit_sync_cmd(dev->admin_q, (struct nvme_command *)&c,
> +				nvme_nvm_id, sizeof(struct nvme_nvm_id));
>   	if (ret) {
>   		ret = -EIO;
>   		goto out;
> @@ -299,8 +300,8 @@ static int nvme_nvm_get_l2p_tbl(struct request_queue *q, u64 slba, u32 nlb,
>   		c.l2p.slba = cpu_to_le64(cmd_slba);
>   		c.l2p.nlb = cpu_to_le32(cmd_nlb);
>
> -		ret = nvme_submit_sync_cmd(q, (struct nvme_command *)&c,
> -								entries, len);
> +		ret = nvme_submit_sync_cmd(dev->admin_q,
> +				(struct nvme_command *)&c, entries, len);
>   		if (ret) {
>   			dev_err(dev->dev, "L2P table transfer failed (%d)\n",
>   									ret);
> @@ -343,8 +344,8 @@ static int nvme_nvm_get_bb_tbl(struct request_queue *q, int lunid,
>
>   	bitmap_zero(bb_bitmap, nr_blocks);
>
> -	ret = nvme_submit_sync_cmd(q, (struct nvme_command *)&c, bb_bitmap,
> -								bb_bitmap_size);
> +	ret = nvme_submit_sync_cmd(dev->admin_q, (struct nvme_command *)&c,
> +						bb_bitmap, bb_bitmap_size);
>   	if (ret) {
>   		dev_err(dev->dev, "get bad block table failed (%d)\n", ret);
>   		ret = -EIO;
>

Thanks Tao. I've added the bb set as well and a small fix to the l2p.

      reply	other threads:[~2015-11-20 12:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20  6:28 [PATCH] nvme: lightnvm: use nvme admin queue Wenwei Tao
2015-11-20 12:45 ` Matias Bjørling [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=564F15D4.4010508@lightnvm.io \
    --to=mb@lightnvm.io \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ww.tao0320@gmail.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