* [PATCH v2 0/2] move nvme_cancel_io() to common code
@ 2016-05-18 21:05 Ming Lin
2016-05-18 21:05 ` [PATCH v2 1/2] nvme: update and rename nvme_cancel_io to nvme_cancel_request Ming Lin
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Ming Lin @ 2016-05-18 21:05 UTC (permalink / raw)
From: Ming Lin <ming.l@samsung.com>
So it can be used by fabrics driver also.
v2:
- not declare "ctrl"
- rename nvme_cancel_io to nvme_cancel_request
Ming Lin (2):
nvme: update and rename nvme_cancel_io to nvme_cancel_request
nvme: move nvme_cancel_request() to common code
drivers/nvme/host/core.c | 17 +++++++++++++++++
drivers/nvme/host/nvme.h | 1 +
drivers/nvme/host/pci.c | 20 ++------------------
3 files changed, 20 insertions(+), 18 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/2] nvme: update and rename nvme_cancel_io to nvme_cancel_request
2016-05-18 21:05 [PATCH v2 0/2] move nvme_cancel_io() to common code Ming Lin
@ 2016-05-18 21:05 ` Ming Lin
2016-05-20 7:46 ` Johannes Thumshirn
2016-05-18 21:05 ` [PATCH v2 2/2] nvme: move nvme_cancel_request() to common code Ming Lin
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Ming Lin @ 2016-05-18 21:05 UTC (permalink / raw)
From: Ming Lin <ming.l@samsung.com>
nvme_cancel_io is a bit confusing (given the distinction of io/admin),
so rename it to nvme_cancel_request.
And update it a bit to pass in struct nvme_ctrl, so it can be used
by Fabrics driver also.
Signed-off-by: Ming Lin <ming.l at samsung.com>
Reviewed-by: Christoph Hellwig <hch at lst.de>
Suggested-by: Sagi Grimberg <sagi at grimberg.me>
---
drivers/nvme/host/pci.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index a62c9c5..16da89d 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -925,14 +925,14 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved)
return BLK_EH_RESET_TIMER;
}
-static void nvme_cancel_io(struct request *req, void *data, bool reserved)
+static void nvme_cancel_request(struct request *req, void *data, bool reserved)
{
int status;
if (!blk_mq_request_started(req))
return;
- dev_dbg_ratelimited(((struct nvme_dev *) data)->ctrl.device,
+ dev_dbg_ratelimited(((struct nvme_ctrl *) data)->device,
"Cancelling I/O %d", req->tag);
status = NVME_SC_ABORT_REQ;
@@ -1720,8 +1720,8 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown)
}
nvme_pci_disable(dev);
- blk_mq_tagset_busy_iter(&dev->tagset, nvme_cancel_io, dev);
- blk_mq_tagset_busy_iter(&dev->admin_tagset, nvme_cancel_io, dev);
+ blk_mq_tagset_busy_iter(&dev->tagset, nvme_cancel_request, &dev->ctrl);
+ blk_mq_tagset_busy_iter(&dev->admin_tagset, nvme_cancel_request, &dev->ctrl);
mutex_unlock(&dev->shutdown_lock);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/2] nvme: move nvme_cancel_request() to common code
2016-05-18 21:05 [PATCH v2 0/2] move nvme_cancel_io() to common code Ming Lin
2016-05-18 21:05 ` [PATCH v2 1/2] nvme: update and rename nvme_cancel_io to nvme_cancel_request Ming Lin
@ 2016-05-18 21:05 ` Ming Lin
2016-05-20 7:45 ` Johannes Thumshirn
2016-05-26 7:16 ` [PATCH v2 0/2] move nvme_cancel_io() " Ming Lin
2016-05-26 15:47 ` Jens Axboe
3 siblings, 1 reply; 8+ messages in thread
From: Ming Lin @ 2016-05-18 21:05 UTC (permalink / raw)
From: Ming Lin <ming.l@samsung.com>
So it can be used by fabrics driver also.
Signed-off-by: Ming Lin <ming.l at samsung.com>
Reviewed-by: Christoph Hellwig <hch at lst.de>
---
drivers/nvme/host/core.c | 17 +++++++++++++++++
drivers/nvme/host/nvme.h | 1 +
drivers/nvme/host/pci.c | 16 ----------------
3 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index ac950d1..12835b3 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -59,6 +59,23 @@ static DEFINE_SPINLOCK(dev_list_lock);
static struct class *nvme_class;
+void nvme_cancel_request(struct request *req, void *data, bool reserved)
+{
+ int status;
+
+ if (!blk_mq_request_started(req))
+ return;
+
+ dev_dbg_ratelimited(((struct nvme_ctrl *) data)->device,
+ "Cancelling I/O %d", req->tag);
+
+ status = NVME_SC_ABORT_REQ;
+ if (blk_queue_dying(req->q))
+ status |= NVME_SC_DNR;
+ blk_mq_complete_request(req, status);
+}
+EXPORT_SYMBOL_GPL(nvme_cancel_request);
+
bool nvme_change_ctrl_state(struct nvme_ctrl *ctrl,
enum nvme_ctrl_state new_state)
{
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index fab6507..3f3945a 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -229,6 +229,7 @@ static inline bool nvme_req_needs_retry(struct request *req, u16 status)
(jiffies - req->start_time) < req->timeout;
}
+void nvme_cancel_request(struct request *req, void *data, bool reserved);
bool nvme_change_ctrl_state(struct nvme_ctrl *ctrl,
enum nvme_ctrl_state new_state);
int nvme_disable_ctrl(struct nvme_ctrl *ctrl, u64 cap);
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 16da89d..02105da 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -925,22 +925,6 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved)
return BLK_EH_RESET_TIMER;
}
-static void nvme_cancel_request(struct request *req, void *data, bool reserved)
-{
- int status;
-
- if (!blk_mq_request_started(req))
- return;
-
- dev_dbg_ratelimited(((struct nvme_ctrl *) data)->device,
- "Cancelling I/O %d", req->tag);
-
- status = NVME_SC_ABORT_REQ;
- if (blk_queue_dying(req->q))
- status |= NVME_SC_DNR;
- blk_mq_complete_request(req, status);
-}
-
static void nvme_free_queue(struct nvme_queue *nvmeq)
{
dma_free_coherent(nvmeq->q_dmadev, CQ_SIZE(nvmeq->q_depth),
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/2] nvme: move nvme_cancel_request() to common code
2016-05-18 21:05 ` [PATCH v2 2/2] nvme: move nvme_cancel_request() to common code Ming Lin
@ 2016-05-20 7:45 ` Johannes Thumshirn
0 siblings, 0 replies; 8+ messages in thread
From: Johannes Thumshirn @ 2016-05-20 7:45 UTC (permalink / raw)
On Wed, May 18, 2016@02:05:02PM -0700, Ming Lin wrote:
> From: Ming Lin <ming.l at samsung.com>
>
> So it can be used by fabrics driver also.
>
> Signed-off-by: Ming Lin <ming.l at samsung.com>
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>
--
Johannes Thumshirn Storage
jthumshirn at suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/2] nvme: update and rename nvme_cancel_io to nvme_cancel_request
2016-05-18 21:05 ` [PATCH v2 1/2] nvme: update and rename nvme_cancel_io to nvme_cancel_request Ming Lin
@ 2016-05-20 7:46 ` Johannes Thumshirn
0 siblings, 0 replies; 8+ messages in thread
From: Johannes Thumshirn @ 2016-05-20 7:46 UTC (permalink / raw)
On Wed, May 18, 2016@02:05:01PM -0700, Ming Lin wrote:
> From: Ming Lin <ming.l at samsung.com>
>
> nvme_cancel_io is a bit confusing (given the distinction of io/admin),
> so rename it to nvme_cancel_request.
>
> And update it a bit to pass in struct nvme_ctrl, so it can be used
> by Fabrics driver also.
>
> Signed-off-by: Ming Lin <ming.l at samsung.com>
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>
--
Johannes Thumshirn Storage
jthumshirn at suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 0/2] move nvme_cancel_io() to common code
2016-05-18 21:05 [PATCH v2 0/2] move nvme_cancel_io() to common code Ming Lin
2016-05-18 21:05 ` [PATCH v2 1/2] nvme: update and rename nvme_cancel_io to nvme_cancel_request Ming Lin
2016-05-18 21:05 ` [PATCH v2 2/2] nvme: move nvme_cancel_request() to common code Ming Lin
@ 2016-05-26 7:16 ` Ming Lin
2016-05-26 15:12 ` Keith Busch
2016-05-26 15:47 ` Jens Axboe
3 siblings, 1 reply; 8+ messages in thread
From: Ming Lin @ 2016-05-26 7:16 UTC (permalink / raw)
On Wed, May 18, 2016@2:05 PM, Ming Lin <mlin@kernel.org> wrote:
> From: Ming Lin <ming.l at samsung.com>
>
> So it can be used by fabrics driver also.
>
> v2:
> - not declare "ctrl"
> - rename nvme_cancel_io to nvme_cancel_request
>
> Ming Lin (2):
> nvme: update and rename nvme_cancel_io to nvme_cancel_request
> nvme: move nvme_cancel_request() to common code
Hi Keith,
Are you OK with these 2 patches?
Thanks,
Ming
>
> drivers/nvme/host/core.c | 17 +++++++++++++++++
> drivers/nvme/host/nvme.h | 1 +
> drivers/nvme/host/pci.c | 20 ++------------------
> 3 files changed, 20 insertions(+), 18 deletions(-)
>
> --
> 1.9.1
>
>
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 0/2] move nvme_cancel_io() to common code
2016-05-26 7:16 ` [PATCH v2 0/2] move nvme_cancel_io() " Ming Lin
@ 2016-05-26 15:12 ` Keith Busch
0 siblings, 0 replies; 8+ messages in thread
From: Keith Busch @ 2016-05-26 15:12 UTC (permalink / raw)
On Thu, May 26, 2016@12:16:33AM -0700, Ming Lin wrote:
> On Wed, May 18, 2016@2:05 PM, Ming Lin <mlin@kernel.org> wrote:
> > From: Ming Lin <ming.l at samsung.com>
> >
> > So it can be used by fabrics driver also.
> >
> > v2:
> > - not declare "ctrl"
> > - rename nvme_cancel_io to nvme_cancel_request
> >
> > Ming Lin (2):
> > nvme: update and rename nvme_cancel_io to nvme_cancel_request
> > nvme: move nvme_cancel_request() to common code
>
> Hi Keith,
>
> Are you OK with these 2 patches?
>
> Thanks,
> Ming
Looks fine to me.
Reviewed-by: Keith Busch <keith.bsuch at intel.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 0/2] move nvme_cancel_io() to common code
2016-05-18 21:05 [PATCH v2 0/2] move nvme_cancel_io() to common code Ming Lin
` (2 preceding siblings ...)
2016-05-26 7:16 ` [PATCH v2 0/2] move nvme_cancel_io() " Ming Lin
@ 2016-05-26 15:47 ` Jens Axboe
3 siblings, 0 replies; 8+ messages in thread
From: Jens Axboe @ 2016-05-26 15:47 UTC (permalink / raw)
On 05/18/2016 03:05 PM, Ming Lin wrote:
> From: Ming Lin <ming.l at samsung.com>
>
> So it can be used by fabrics driver also.
>
> v2:
> - not declare "ctrl"
> - rename nvme_cancel_io to nvme_cancel_request
>
> Ming Lin (2):
> nvme: update and rename nvme_cancel_io to nvme_cancel_request
> nvme: move nvme_cancel_request() to common code
Added for 4.8, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-05-26 15:47 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-18 21:05 [PATCH v2 0/2] move nvme_cancel_io() to common code Ming Lin
2016-05-18 21:05 ` [PATCH v2 1/2] nvme: update and rename nvme_cancel_io to nvme_cancel_request Ming Lin
2016-05-20 7:46 ` Johannes Thumshirn
2016-05-18 21:05 ` [PATCH v2 2/2] nvme: move nvme_cancel_request() to common code Ming Lin
2016-05-20 7:45 ` Johannes Thumshirn
2016-05-26 7:16 ` [PATCH v2 0/2] move nvme_cancel_io() " Ming Lin
2016-05-26 15:12 ` Keith Busch
2016-05-26 15:47 ` Jens Axboe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.