|
|
764884 |
From 3146dd6503fbb87b311caae47eeac739dc59bfd3 Mon Sep 17 00:00:00 2001
|
|
|
764884 |
From: Potnuri Bharat Teja <bharat@chelsio.com>
|
|
|
764884 |
Date: Mon, 4 Nov 2019 17:18:25 +0530
|
|
|
764884 |
Subject: [PATCH rdma-core 09/13] cxgb4: always query device before
|
|
|
764884 |
initializing chip version
|
|
|
764884 |
|
|
|
764884 |
[ Upstream commit df720f3658ca49aea89cb6e8f11980f30574d10a ]
|
|
|
764884 |
|
|
|
764884 |
chip_version may be initialized wrongly if alloc_context() is
|
|
|
764884 |
invoked multiple times. therefore always query device to derive the
|
|
|
764884 |
correct chip_version.
|
|
|
764884 |
|
|
|
764884 |
Fixes: c7e71b250268 ("cxgb4: fix chipversion initialization")
|
|
|
764884 |
Signed-off-by: Rahul Kundu <rahul.kundu@chelsio.com>
|
|
|
764884 |
Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
|
|
|
764884 |
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
|
|
|
764884 |
---
|
|
|
764884 |
providers/cxgb4/dev.c | 9 +++------
|
|
|
764884 |
1 file changed, 3 insertions(+), 6 deletions(-)
|
|
|
764884 |
|
|
|
764884 |
diff --git a/providers/cxgb4/dev.c b/providers/cxgb4/dev.c
|
|
|
764884 |
index 4d02c7a9..ecd87e6c 100644
|
|
|
764884 |
--- a/providers/cxgb4/dev.c
|
|
|
764884 |
+++ b/providers/cxgb4/dev.c
|
|
|
764884 |
@@ -143,14 +143,11 @@ static struct verbs_context *c4iw_alloc_context(struct ibv_device *ibdev,
|
|
|
764884 |
}
|
|
|
764884 |
|
|
|
764884 |
verbs_set_ops(&context->ibv_ctx, &c4iw_ctx_common_ops);
|
|
|
764884 |
+ if (ibv_cmd_query_device(&context->ibv_ctx.context, &attr,
|
|
|
764884 |
+ &raw_fw_ver, &qcmd, sizeof(qcmd)))
|
|
|
764884 |
+ goto err_unmap;
|
|
|
764884 |
|
|
|
764884 |
if (!rhp->mmid2ptr) {
|
|
|
764884 |
- int ret;
|
|
|
764884 |
-
|
|
|
764884 |
- ret = ibv_cmd_query_device(&context->ibv_ctx.context, &attr,
|
|
|
764884 |
- &raw_fw_ver, &qcmd, sizeof(qcmd));
|
|
|
764884 |
- if (ret)
|
|
|
764884 |
- goto err_unmap;
|
|
|
764884 |
rhp->max_mr = attr.max_mr;
|
|
|
764884 |
rhp->mmid2ptr = calloc(attr.max_mr, sizeof(void *));
|
|
|
764884 |
if (!rhp->mmid2ptr) {
|
|
|
764884 |
--
|
|
|
764884 |
2.20.1
|
|
|
764884 |
|