All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] nvme: don't enable AEN if not supported
@ 2018-07-02 16:34 Weiping Zhang
  2018-07-03  6:42 ` Johannes Thumshirn
  2018-07-17 14:32 ` Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: Weiping Zhang @ 2018-07-02 16:34 UTC (permalink / raw)


Avoid excuting set_feature command if there is no supported bit in
Optional Asynchronous Events Supported (OAES).

Reviewed-by: Sagi Grimberg <sagi at grimberg.me>
Reviewed-by: Christoph Hellwig <hch at lst.de>
Signed-off-by: Weiping Zhang <zhangweiping at didichuxing.com>
---
Change since V1:
* Add extra variable supported_aens sugguested by Christoph.

 drivers/nvme/host/core.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index e541fe268bcf..5ff281cce2b9 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1041,14 +1041,17 @@ EXPORT_SYMBOL_GPL(nvme_set_queue_count);
 
 static void nvme_enable_aen(struct nvme_ctrl *ctrl)
 {
-	u32 result;
+	u32 result, supported_aens = ctrl->oaes & NVME_AEN_SUPPORTED;
 	int status;
 
-	status = nvme_set_features(ctrl, NVME_FEAT_ASYNC_EVENT,
-			ctrl->oaes & NVME_AEN_SUPPORTED, NULL, 0, &result);
+	if (!supported_aens)
+		return;
+
+	status = nvme_set_features(ctrl, NVME_FEAT_ASYNC_EVENT, supported_aens,
+			NULL, 0, &result);
 	if (status)
 		dev_warn(ctrl->device, "Failed to configure AEN (cfg %x)\n",
-			 ctrl->oaes & NVME_AEN_SUPPORTED);
+			 supported_aens);
 }
 
 static int nvme_submit_io(struct nvme_ns *ns, struct nvme_user_io __user *uio)
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2] nvme: don't enable AEN if not supported
  2018-07-02 16:34 [PATCH v2] nvme: don't enable AEN if not supported Weiping Zhang
@ 2018-07-03  6:42 ` Johannes Thumshirn
  2018-07-17 14:14   ` Weiping Zhang
  2018-07-17 14:32 ` Christoph Hellwig
  1 sibling, 1 reply; 4+ messages in thread
From: Johannes Thumshirn @ 2018-07-03  6:42 UTC (permalink / raw)


Looks good,
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] 4+ messages in thread

* [PATCH v2] nvme: don't enable AEN if not supported
  2018-07-03  6:42 ` Johannes Thumshirn
@ 2018-07-17 14:14   ` Weiping Zhang
  0 siblings, 0 replies; 4+ messages in thread
From: Weiping Zhang @ 2018-07-17 14:14 UTC (permalink / raw)


Hi Christoph,

Will you pick this up for 4.19 ?

Johannes Thumshirn <jthumshirn at suse.de> ?2018?7?3??? ??2:42???
>
> Looks good,
> 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
>
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] nvme: don't enable AEN if not supported
  2018-07-02 16:34 [PATCH v2] nvme: don't enable AEN if not supported Weiping Zhang
  2018-07-03  6:42 ` Johannes Thumshirn
@ 2018-07-17 14:32 ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2018-07-17 14:32 UTC (permalink / raw)


Applied to nvme-4.18.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-17 14:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-02 16:34 [PATCH v2] nvme: don't enable AEN if not supported Weiping Zhang
2018-07-03  6:42 ` Johannes Thumshirn
2018-07-17 14:14   ` Weiping Zhang
2018-07-17 14:32 ` Christoph Hellwig

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.