From: Harish Chegondi Date: Fri, 22 Jan 2016 20:50:30 +0000 (-0800) Subject: IB/rdmavt: Allow reserving just one qpn X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fef2efd6b4951148cc8dd1df7b3e1ff2f13dd6df;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git IB/rdmavt: Allow reserving just one qpn qib needs to reserve only one qpn for non-verbs stuff. Also fixed the for loop to reserve the end qpn. Reviewed-by: Dennis Dalessandro Signed-off-by: Harish Chegondi Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c index 44485ada8281..ee19eae38d0b 100644 --- a/drivers/infiniband/sw/rdmavt/qp.c +++ b/drivers/infiniband/sw/rdmavt/qp.c @@ -79,7 +79,7 @@ static int init_qpn_table(struct rvt_dev_info *rdi, struct rvt_qpn_table *qpt) struct rvt_qpn_map *map; int ret = 0; - if (!(rdi->dparms.qpn_res_end > rdi->dparms.qpn_res_start)) + if (!(rdi->dparms.qpn_res_end >= rdi->dparms.qpn_res_start)) return -EINVAL; spin_lock_init(&qpt->lock); @@ -105,7 +105,7 @@ static int init_qpn_table(struct rvt_dev_info *rdi, struct rvt_qpn_table *qpt) rvt_pr_info(rdi, "Reserving QPNs from 0x%x to 0x%x for non-verbs use\n", rdi->dparms.qpn_res_start, rdi->dparms.qpn_res_end); - for (i = rdi->dparms.qpn_res_start; i < rdi->dparms.qpn_res_end; i++) { + for (i = rdi->dparms.qpn_res_start; i <= rdi->dparms.qpn_res_end; i++) { if (!map->page) { get_map_page(qpt, map); if (!map->page) {