Skip to content

Commit 5e7c1b7

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Pull rdma fixes from Jason Gunthorpe: "First RDMA subsystem updates for 5.5-rc. A very small set of fixes, most people seem to still be recovering from December! Five small driver fixes: - Fix error flow with MR allocation in bnxt_re - An errata work around for bnxt_re - Misuse of the workqueue API in hfi1 - Protocol error in hfi1 - Regression in 5.5 related to the mmap rework with i40iw" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: i40iw: Remove setting of VMA private data and use rdma_user_mmap_io IB/hfi1: Adjust flow PSN with the correct resync_psn IB/hfi1: Don't cancel unused work item RDMA/bnxt_re: Fix Send Work Entry state check while polling completions RDMA/bnxt_re: Avoid freeing MR resources if dereg fails
2 parents 4a3033e + 9554de3 commit 5e7c1b7

File tree

5 files changed

+27
-16
lines changed

5 files changed

+27
-16
lines changed

drivers/infiniband/hw/bnxt_re/ib_verbs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3305,8 +3305,10 @@ int bnxt_re_dereg_mr(struct ib_mr *ib_mr, struct ib_udata *udata)
33053305
int rc;
33063306

33073307
rc = bnxt_qplib_free_mrw(&rdev->qplib_res, &mr->qplib_mr);
3308-
if (rc)
3308+
if (rc) {
33093309
dev_err(rdev_to_dev(rdev), "Dereg MR failed: %#x\n", rc);
3310+
return rc;
3311+
}
33103312

33113313
if (mr->pages) {
33123314
rc = bnxt_qplib_free_fast_reg_page_list(&rdev->qplib_res,

drivers/infiniband/hw/bnxt_re/qplib_fp.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2283,13 +2283,13 @@ static int bnxt_qplib_cq_process_req(struct bnxt_qplib_cq *cq,
22832283
/* Add qp to flush list of the CQ */
22842284
bnxt_qplib_add_flush_qp(qp);
22852285
} else {
2286+
/* Before we complete, do WA 9060 */
2287+
if (do_wa9060(qp, cq, cq_cons, sw_sq_cons,
2288+
cqe_sq_cons)) {
2289+
*lib_qp = qp;
2290+
goto out;
2291+
}
22862292
if (swq->flags & SQ_SEND_FLAGS_SIGNAL_COMP) {
2287-
/* Before we complete, do WA 9060 */
2288-
if (do_wa9060(qp, cq, cq_cons, sw_sq_cons,
2289-
cqe_sq_cons)) {
2290-
*lib_qp = qp;
2291-
goto out;
2292-
}
22932293
cqe->status = CQ_REQ_STATUS_OK;
22942294
cqe++;
22952295
(*budget)--;

drivers/infiniband/hw/hfi1/iowait.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ void iowait_init(struct iowait *wait, u32 tx_limit,
8181
void iowait_cancel_work(struct iowait *w)
8282
{
8383
cancel_work_sync(&iowait_get_ib_work(w)->iowork);
84-
cancel_work_sync(&iowait_get_tid_work(w)->iowork);
84+
/* Make sure that the iowork for TID RDMA is used */
85+
if (iowait_get_tid_work(w)->iowork.func)
86+
cancel_work_sync(&iowait_get_tid_work(w)->iowork);
8587
}
8688

8789
/**

drivers/infiniband/hw/hfi1/tid_rdma.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4633,6 +4633,15 @@ void hfi1_rc_rcv_tid_rdma_ack(struct hfi1_packet *packet)
46334633
*/
46344634
fpsn = full_flow_psn(flow, flow->flow_state.spsn);
46354635
req->r_ack_psn = psn;
4636+
/*
4637+
* If resync_psn points to the last flow PSN for a
4638+
* segment and the new segment (likely from a new
4639+
* request) starts with a new generation number, we
4640+
* need to adjust resync_psn accordingly.
4641+
*/
4642+
if (flow->flow_state.generation !=
4643+
(resync_psn >> HFI1_KDETH_BTH_SEQ_SHIFT))
4644+
resync_psn = mask_psn(fpsn - 1);
46364645
flow->resync_npkts +=
46374646
delta_psn(mask_psn(resync_psn + 1), fpsn);
46384647
/*

drivers/infiniband/hw/i40iw/i40iw_verbs.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ static void i40iw_dealloc_ucontext(struct ib_ucontext *context)
169169
static int i40iw_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
170170
{
171171
struct i40iw_ucontext *ucontext;
172-
u64 db_addr_offset;
173-
u64 push_offset;
172+
u64 db_addr_offset, push_offset, pfn;
174173

175174
ucontext = to_ucontext(context);
176175
if (ucontext->iwdev->sc_dev.is_pf) {
@@ -189,20 +188,19 @@ static int i40iw_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
189188

190189
if (vma->vm_pgoff == (db_addr_offset >> PAGE_SHIFT)) {
191190
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
192-
vma->vm_private_data = ucontext;
193191
} else {
194192
if ((vma->vm_pgoff - (push_offset >> PAGE_SHIFT)) % 2)
195193
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
196194
else
197195
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
198196
}
199197

200-
if (io_remap_pfn_range(vma, vma->vm_start,
201-
vma->vm_pgoff + (pci_resource_start(ucontext->iwdev->ldev->pcidev, 0) >> PAGE_SHIFT),
202-
PAGE_SIZE, vma->vm_page_prot))
203-
return -EAGAIN;
198+
pfn = vma->vm_pgoff +
199+
(pci_resource_start(ucontext->iwdev->ldev->pcidev, 0) >>
200+
PAGE_SHIFT);
204201

205-
return 0;
202+
return rdma_user_mmap_io(context, vma, pfn, PAGE_SIZE,
203+
vma->vm_page_prot, NULL);
206204
}
207205

208206
/**

0 commit comments

Comments
 (0)