Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758952AbbKTG2Y (ORCPT ); Fri, 20 Nov 2015 01:28:24 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:33300 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752125AbbKTG2W (ORCPT ); Fri, 20 Nov 2015 01:28:22 -0500 From: Wenwei Tao To: mb@lightnvm.io Cc: linux-kernel@vger.kernel.org Subject: [PATCH] nvme: lightnvm: use nvme admin queue Date: Fri, 20 Nov 2015 14:28:16 +0800 Message-Id: <1448000896-4526-1-git-send-email-ww.tao0320@gmail.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2353 Lines: 63 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 --- 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; -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/