Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2721996imj; Mon, 11 Feb 2019 07:30:45 -0800 (PST) X-Google-Smtp-Source: AHgI3IYWpsOQwTmXy4V797zxIjy13G7GioxLU1/sKE8B2h4TnNldtTtRM0jW9gyPzsKx7sJRc/Ce X-Received: by 2002:a17:902:a6:: with SMTP id a35mr38245483pla.201.1549899045228; Mon, 11 Feb 2019 07:30:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549899045; cv=none; d=google.com; s=arc-20160816; b=zgSos/euNnYuUKqGQOzc8d/QlEZfbLYAEThKWaRBaoV72g7jqLfcEFEeVpuZrS8FzO yr/HiqcJIAaLTq+Bit1ImZNyL+zp/RbtGykCpTtacug7WdPVlTITgyJuk6Lt8hGcIs6S 4yktz6oueiQq7hwdU8fTcL2oy8WH8y0kJqw5nItJ+9YU7vTs1PTdN4MmYkRmW+XerUeJ o0l2bY0eKETfYvtRLVbKKFffd8R3sxay8+/UXnalFldqFOe6mv/PhhMyGZcC48AXUAYS FoAIke/McQhmn4M591+5qEFuo4bsB+fjBy5LXdtdQEeVoYnP7r75Vv0CZbIIsFD2CyzD hwYg== 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=xwKtxnPlNFNGNfrFphFSKz/GSybgNsgBS8bj+lWaKSY=; b=kJ7dpqdMy/mdzUV3kmQmmphFxpYZ+MmQjzjhgYQeYQ6qEQMbHC8D2PFBHA4j9Qj2KE +bhe3Y+EoX3oj9LMLsfvnPNAndq0BliaZsi7Qyc8WZBxfteUeliTtOvQk/37bpkUhn5s E+MFNCtZ2xBXaNUqh2wDebP+VrdBUCftfKNhtT+R3Bja6mQrPOxlVXg3BtsqOzeTrgIS TY/MMnc9jwkLRgDmodE4yyYShF4/nR31bW4j87ThtP79DhqUO2Lf837xocxEPUYWAZBQ SD02pABHOxegVUljXdEO8xux2KqSKD8F985LUq9v0hWzf/HogMHLyagSRq/prlOk2UIr X7Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="huW7K/ZF"; 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 c131si9803416pga.358.2019.02.11.07.30.28; Mon, 11 Feb 2019 07:30:45 -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="huW7K/ZF"; 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 S2389322AbfBKO5O (ORCPT + 99 others); Mon, 11 Feb 2019 09:57:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:44572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388679AbfBKO5N (ORCPT ); Mon, 11 Feb 2019 09:57:13 -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 E4EB0222A8; Mon, 11 Feb 2019 14:57:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897032; bh=gxrcmFMq+iKSRNTZwlLiBNJF/2XMBk2dfAQN7VoVJQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=huW7K/ZFVYJbA5eyaqftwOeZyqNxUJW3eGT/BdPjpPM+OWlOfMFm7kD33SiQ4nu0V bkkXRmn3EcG0Cx7pw4EkhnFRtOw52w94oj8jS2J/uRjtdGtTThvt1DSQNvJfPVTPsv FJOSq+BPkGeN4Dh+0OTVmyIKTf7RTT/+cFJRHvtY= 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.14 069/205] IB/hfi1: Unreserve a reserved request when it is completed Date: Mon, 11 Feb 2019 15:17:47 +0100 Message-Id: <20190211141833.257445558@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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.14-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 818bac1a4056..d3b8cb92fd6d 100644 --- a/drivers/infiniband/hw/hfi1/rc.c +++ b/drivers/infiniband/hw/hfi1/rc.c @@ -1162,6 +1162,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) @@ -1214,6 +1215,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