aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaike Wan <kaike.wan@intel.com>2018-06-04 14:43:54 -0400
committerJason Gunthorpe <jgg@mellanox.com>2018-06-04 17:25:27 -0400
commited71e86a8d66ec018d16047cdd507f95c89e257b (patch)
tree8896a00aef40343f9fb0a7f81eadeb3759175f48
parentdc2b2a917c3427223188ac476afc915831b1244c (diff)
IB/hfi1: Rename exp_lock to exp_mutex
The mutex exp_lock in struct hfi1_ctxtdata is used to protect all Expected TID data of a user context. This patch renames it to exp_mutex to better reflect its identity and prepare for upcoming patches. Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Harish Chegondi <harish.chegondi@intel.com> Signed-off-by: Kaike Wan <kaike.wan@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r--drivers/infiniband/hw/hfi1/hfi.h4
-rw-r--r--drivers/infiniband/hw/hfi1/init.c2
-rw-r--r--drivers/infiniband/hw/hfi1/user_exp_rcv.c10
3 files changed, 8 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/hfi1/hfi.h b/drivers/infiniband/hw/hfi1/hfi.h
index 5eb3bf0849c7..4ab8b5bfbed1 100644
--- a/drivers/infiniband/hw/hfi1/hfi.h
+++ b/drivers/infiniband/hw/hfi1/hfi.h
@@ -245,8 +245,8 @@ struct hfi1_ctxtdata {
245 struct exp_tid_set tid_used_list; 245 struct exp_tid_set tid_used_list;
246 struct exp_tid_set tid_full_list; 246 struct exp_tid_set tid_full_list;
247 247
248 /* lock protecting all Expected TID data */ 248 /* lock protecting all Expected TID data of user contexts */
249 struct mutex exp_lock; 249 struct mutex exp_mutex;
250 /* per-context configuration flags */ 250 /* per-context configuration flags */
251 unsigned long flags; 251 unsigned long flags;
252 /* per-context event flags for fileops/intr communication */ 252 /* per-context event flags for fileops/intr communication */
diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1/init.c
index 4a478ee0a79b..561ad66d0ab3 100644
--- a/drivers/infiniband/hw/hfi1/init.c
+++ b/drivers/infiniband/hw/hfi1/init.c
@@ -368,7 +368,7 @@ int hfi1_create_ctxtdata(struct hfi1_pportdata *ppd, int numa,
368 rcd->numa_id = numa; 368 rcd->numa_id = numa;
369 rcd->rcv_array_groups = dd->rcv_entries.ngroups; 369 rcd->rcv_array_groups = dd->rcv_entries.ngroups;
370 370
371 mutex_init(&rcd->exp_lock); 371 mutex_init(&rcd->exp_mutex);
372 372
373 hfi1_cdbg(PROC, "setting up context %u\n", rcd->ctxt); 373 hfi1_cdbg(PROC, "setting up context %u\n", rcd->ctxt);
374 374
diff --git a/drivers/infiniband/hw/hfi1/user_exp_rcv.c b/drivers/infiniband/hw/hfi1/user_exp_rcv.c
index 6a4c5142515a..dbe7d14a5c76 100644
--- a/drivers/infiniband/hw/hfi1/user_exp_rcv.c
+++ b/drivers/infiniband/hw/hfi1/user_exp_rcv.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright(c) 2015-2017 Intel Corporation. 2 * Copyright(c) 2015-2018 Intel Corporation.
3 * 3 *
4 * This file is provided under a dual BSD/GPLv2 license. When using or 4 * This file is provided under a dual BSD/GPLv2 license. When using or
5 * redistributing this file, you may do so under either license. 5 * redistributing this file, you may do so under either license.
@@ -375,7 +375,7 @@ int hfi1_user_exp_rcv_setup(struct hfi1_filedata *fd,
375 * From this point on, we are going to be using shared (between master 375 * From this point on, we are going to be using shared (between master
376 * and subcontexts) context resources. We need to take the lock. 376 * and subcontexts) context resources. We need to take the lock.
377 */ 377 */
378 mutex_lock(&uctxt->exp_lock); 378 mutex_lock(&uctxt->exp_mutex);
379 /* 379 /*
380 * The first step is to program the RcvArray entries which are complete 380 * The first step is to program the RcvArray entries which are complete
381 * groups. 381 * groups.
@@ -461,7 +461,7 @@ int hfi1_user_exp_rcv_setup(struct hfi1_filedata *fd,
461 } 461 }
462 } 462 }
463unlock: 463unlock:
464 mutex_unlock(&uctxt->exp_lock); 464 mutex_unlock(&uctxt->exp_mutex);
465nomem: 465nomem:
466 hfi1_cdbg(TID, "total mapped: tidpairs:%u pages:%u (%d)", tididx, 466 hfi1_cdbg(TID, "total mapped: tidpairs:%u pages:%u (%d)", tididx,
467 mapped_pages, ret); 467 mapped_pages, ret);
@@ -517,7 +517,7 @@ int hfi1_user_exp_rcv_clear(struct hfi1_filedata *fd,
517 if (IS_ERR(tidinfo)) 517 if (IS_ERR(tidinfo))
518 return PTR_ERR(tidinfo); 518 return PTR_ERR(tidinfo);
519 519
520 mutex_lock(&uctxt->exp_lock); 520 mutex_lock(&uctxt->exp_mutex);
521 for (tididx = 0; tididx < tinfo->tidcnt; tididx++) { 521 for (tididx = 0; tididx < tinfo->tidcnt; tididx++) {
522 ret = unprogram_rcvarray(fd, tidinfo[tididx], NULL); 522 ret = unprogram_rcvarray(fd, tidinfo[tididx], NULL);
523 if (ret) { 523 if (ret) {
@@ -530,7 +530,7 @@ int hfi1_user_exp_rcv_clear(struct hfi1_filedata *fd,
530 fd->tid_used -= tididx; 530 fd->tid_used -= tididx;
531 spin_unlock(&fd->tid_lock); 531 spin_unlock(&fd->tid_lock);
532 tinfo->tidcnt = tididx; 532 tinfo->tidcnt = tididx;
533 mutex_unlock(&uctxt->exp_lock); 533 mutex_unlock(&uctxt->exp_mutex);
534 534
535 kfree(tidinfo); 535 kfree(tidinfo);
536 return ret; 536 return ret;