Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2765600imj; Mon, 11 Feb 2019 08:08:55 -0800 (PST) X-Google-Smtp-Source: AHgI3IaM71efUnmtvUebYqNvHV5HTsoSDFO8syDBfIJxlmHvYAcGMfMNKhXUPVw/jr3445nhXdWI X-Received: by 2002:a17:902:f08b:: with SMTP id go11mr22625126plb.115.1549901335289; Mon, 11 Feb 2019 08:08:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549901335; cv=none; d=google.com; s=arc-20160816; b=EePVplrbDTpUxT2N9s9Kzl7LcEYNNArGU4mrlNEAI1MDCgGTRbnKOZSC2C1kHjS2LJ 24pg8GK/JcqGO5ZOie7eSHofFJ+cZXRTLuhs5ij9aXYritsK1vn9l1SOYLDWa1wXaBmk QoIBYjBTISnAHTbDUafvapnKPKk4Aoua0kAEkPuPrbuZTvkdE8iPLTqUYh2ixA2xa3rn V2rVfyuN0QwB46RYcQkLLxLGrheUVIh0CRNpM+O6GXqZJLa4ofS49KLBgEUplgGS39r6 47qDH/8G06YS+TopHbKck8Ldhm/04MDW2ZdTvN1EpZOplE6mCnTTp+WzeHpyKE/F7WLX 2wcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ynZFVZEDnZ446Yj8/TIE5Z2CZXoDk7BAXPZCGzMkaWo=; b=LWcS9Zwqw/zxk/UwFpgvumaT/2aRee0d5ybQyGyvh43ekHz6c9BTjydR/ttMTprQna Og9/xLueiscndipZRR//qp4xKOVEOqNZrwPytyDPLZEraVIoJwgW3bqws2Q3xa7RdVmk HJ+LbNBABWR0zBAgU8GPqVOhDkkoZdfZFKxOFoZKdNHaXwv73bGtWW36hgm3VM7GvX/c l43r/q74Ywlq6BpEcwhWHFfs46XA9Qe33pvftITD9rN5/jPoRVSZxpRgPGME/cKIgBYL enyogHB4K6vS3EdqQEqAb1MX/YMUtVNrbaFQBdcy6uO5KLxxJd0altLePcvsjPZdyaoC i1rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="VYNT/fKT"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z61si10730890plb.49.2019.02.11.08.08.38; Mon, 11 Feb 2019 08:08:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="VYNT/fKT"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729847AbfBKQH2 (ORCPT + 99 others); Mon, 11 Feb 2019 11:07:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:60432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727863AbfBKO0e (ORCPT ); Mon, 11 Feb 2019 09:26:34 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EEB5E20821; Mon, 11 Feb 2019 14:26:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895193; bh=a6TPrb6TInwE1Lu8PJL7WVUz3lh+FUr4fohOjbp55fs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VYNT/fKTY8FRiUzE6w3eDjmEO0DLYiSB2EQFvWuei6rsA7om8TJYQorcmM6PGO76f FhGOmdVsnvjMmjoYzmDFx3rEh6pu1iM/+TRvyROQURJGoBcM+nxIzflSnZemUs+xsO qndmaBhpLgxv63RrSAKue0xCkFtB6Cye4I6fL5GI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Marciniszyn , Kaike Wan , Dennis Dalessandro , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.20 125/352] IB/hfi1: Unreserve a reserved request when it is completed Date: Mon, 11 Feb 2019 15:15:52 +0100 Message-Id: <20190211141854.280655948@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit ca95f802ef5139722acc8d30aeaab6fe5bbe939e ] Currently, When a reserved operation is completed, its entry in the send queue will not be unreserved, which leads to the miscalculation of qp->s_avail and thus the triggering of a WARN_ON call trace. This patch fixes the problem by unreserving the reserved operation when it is completed. Fixes: 856cc4c237ad ("IB/hfi1: Add the capability for reserved operations") Reviewed-by: Mike Marciniszyn Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/hfi1/rc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/hw/hfi1/rc.c b/drivers/infiniband/hw/hfi1/rc.c index 188aa4f686a0..ea3aac264df9 100644 --- a/drivers/infiniband/hw/hfi1/rc.c +++ b/drivers/infiniband/hw/hfi1/rc.c @@ -1157,6 +1157,7 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct hfi1_opa_header *opah) if (cmp_psn(wqe->lpsn, qp->s_sending_psn) >= 0 && cmp_psn(qp->s_sending_psn, qp->s_sending_hpsn) <= 0) break; + rvt_qp_wqe_unreserve(qp, wqe); s_last = qp->s_last; trace_hfi1_qp_send_completion(qp, wqe, s_last); if (++s_last >= qp->s_size) @@ -1209,6 +1210,7 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp, u32 s_last; rvt_put_swqe(wqe); + rvt_qp_wqe_unreserve(qp, wqe); s_last = qp->s_last; trace_hfi1_qp_send_completion(qp, wqe, s_last); if (++s_last >= qp->s_size) -- 2.19.1