Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1691017pxb; Thu, 16 Sep 2021 13:05:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGmHaHsaXRvtV/IZgO+Cp74orSEzfIO0WoA+YRV+OTKtz64TgGygrB1NCJj9c0pjrkp2r+ X-Received: by 2002:a92:7f0a:: with SMTP id a10mr5471963ild.22.1631822743911; Thu, 16 Sep 2021 13:05:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631822743; cv=none; d=google.com; s=arc-20160816; b=a0CpEycnvoHp1nEt5Wy39HqS6JqmGWtiNHwm7eaORtf095JrKlm7HkcjcyqH3aJobU AXlD8qMyYZqSj1CuBvcYN1tUrCzu3IWCIGNFrv6IFprV6fBgzgRKTsnWnpnDQJ/F6tHp x2cdyGOKf8/nYksir/vwf6le4Isw+fCm3WNeg8gy9BOnwePuQ5V+St8LitviJ9EiKMTk nQwFcOGUQK0u3GFxDEaGn8ZQ2FqDuk8gDBPBzyMRDMQ4x6/1PLgcehhbidBLxNCxfRhr rEa2aoBBhsI2wvr1fpb4kn8Cw7cMY6Q3Voq8owkiYb9+aBPScjX0NXWTgeD7JiWy6hkR eYDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DtHzGg9Ox43wS1QB1ls4Yc3pq4aUlFuXg8GFhOcjdWw=; b=Z8vR9KSW7vV5QBnTZ0Qw0hqZ7gTtBy5aupQVcpqO2+y9KU8RvrO4jozKF/Fn/DSimC HIWfRjLGdpsB5JWRwH/IOUZT4MdMZU3Zcfz5/YTyhZjP1TI7+RQ2ONSG5hfWJcJRdFqu AVwHuUCdrSxwcExO8qNuAn+OebU308Z7ahrllXSYM1LyHbwHG4b33a9hlop9Z1HPXs2M HKsX7Lpr0rflM3i/HoBYaf0qDxM4M+DJNEgw2bGxQDq/Lkxft5fsO/WPBZnOIgeBo6aP R6+Oqccg1Ay1AffyWY0AUcM1RI14DVtAJ1fZImwlNh/BAldnifG2lqrhVH4mSbeGXYUR eLzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="gy8FmY/5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s124si3176342jaa.47.2021.09.16.13.05.07; Thu, 16 Sep 2021 13:05:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="gy8FmY/5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241182AbhIPQPT (ORCPT + 99 others); Thu, 16 Sep 2021 12:15:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:47416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235566AbhIPQJJ (ORCPT ); Thu, 16 Sep 2021 12:09:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7B62D61357; Thu, 16 Sep 2021 16:07:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808456; bh=B7hmzROZ2q5FW/UnPmYrUguLrogA8mOrEXTRK0wGW/M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gy8FmY/5Ap8HxjsniLVm1W8Rm24EzTHXAPkp/pMZ+ALnre9GwWlfsXqqx02RtGHRZ J/ZLfdwxBGBqTo2/QJLMxPSVtGwoQaqmKXOa2Bh0Z96Ygt8sBZ+PVE+iMEctMIYkgE DvtHSqnwn6A4essL6hp6bB1NKEMMiUTtUoBRog4A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wenpeng Liang , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.10 097/306] RDMA/hns: Fix QPs resp incomplete assignment Date: Thu, 16 Sep 2021 17:57:22 +0200 Message-Id: <20210916155757.372842193@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wenpeng Liang [ Upstream commit d2e0ccffcdd7209fc9881c8970d2a7e28dcb43b9 ] The resp passed to the user space represents the enable flag of qp, incomplete assignment will cause some features of the user space to be disabled. Fixes: 90ae0b57e4a5 ("RDMA/hns: Combine enable flags of qp") Fixes: aba457ca890c ("RDMA/hns: Support owner mode doorbell") Link: https://lore.kernel.org/r/1629985056-57004-3-git-send-email-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/hns/hns_roce_qp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_qp.c b/drivers/infiniband/hw/hns/hns_roce_qp.c index ef1452215b17..7ce9ad8aee1e 100644 --- a/drivers/infiniband/hw/hns/hns_roce_qp.c +++ b/drivers/infiniband/hw/hns/hns_roce_qp.c @@ -740,7 +740,6 @@ static int alloc_qp_db(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp, goto err_out; } hr_qp->en_flags |= HNS_ROCE_QP_CAP_SQ_RECORD_DB; - resp->cap_flags |= HNS_ROCE_QP_CAP_SQ_RECORD_DB; } if (user_qp_has_rdb(hr_dev, init_attr, udata, resp)) { @@ -752,7 +751,6 @@ static int alloc_qp_db(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp, goto err_sdb; } hr_qp->en_flags |= HNS_ROCE_QP_CAP_RQ_RECORD_DB; - resp->cap_flags |= HNS_ROCE_QP_CAP_RQ_RECORD_DB; } } else { /* QP doorbell register address */ @@ -959,6 +957,7 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev, } if (udata) { + resp.cap_flags = hr_qp->en_flags; ret = ib_copy_to_udata(udata, &resp, min(udata->outlen, sizeof(resp))); if (ret) { -- 2.30.2