Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1900530pxb; Thu, 16 Sep 2021 19:35:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxug/iQ8mEBcfzSlh8iw38XExc/At1JcIbESr5yNudYrj+GEz+OIMlliv4ZOmD/m9hzP84w X-Received: by 2002:a05:6602:2e13:: with SMTP id o19mr6849565iow.9.1631846148217; Thu, 16 Sep 2021 19:35:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631846148; cv=none; d=google.com; s=arc-20160816; b=u1tzkB+m7zIcVNzXG4fOcBRBU2G98ZXI8vILd37ZWyo84BHrzqrOkNUpYyD7Cz1cs0 yOj23KodDC1UvVv/Q9nEE2dl5+K0Qur5m+Uoom7oe4kitM3DmMFuRE4tNlRhfLwNG2xT YMWW6x6m1UKYHLSXpA3bvsEnqHi55AN9PAENIG864GvhUj144wiRbIGGMEN4V/vAlEoj PEtxkZYgw0Z650g9/au1SYtmpS7w4qrOGXbUQECVUGbxwnEMWhvznimE5u3CBKLTrZFF DY8A6fs5BXwBLrVFafXPvDqhTM3qyNzlJCKzXpQ0gIkYXpweyDx/pZMyhXFCXbsNVPtM TtqQ== 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=Ala8hQz0qMVKd4g1YkwOk7XCz189UaCNXf4t6l86jUc=; b=KvYMK5xp1ZhSWUm+cl1cML1NrDCrZqPq5tfKR5XQhrS6Qbz+IBGtM2PzjFIBrY9H2u Jho3f137cOYx26Y5fL5y0tyrkJY2htB58N3G3gpun6QhC9Gv/SY8qkW80ej8NeKrWaYy lA8IOEXxHVGna7Mpf9ttyBanvlrQG1DfbGNwkYXYkZINO943F+gycjJiRrEJfKo8YxjX 2dpVvCBKDJzg2aUwy671BUfji8yBWu3p15DG5ufCJwRZkSZ0IYj/dUifblwTEyMRqyn9 v2MY6iFpyWz1gKkOqdoBETCpjqtOW/aS2BiefdAX4JepsDUCNkt+NUq0FMLJS/O7bPPQ 9nCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WmU+PBBW; 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 y10si4452155ion.41.2021.09.16.19.35.37; Thu, 16 Sep 2021 19:35:48 -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=WmU+PBBW; 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 S1348222AbhIPRZc (ORCPT + 99 others); Thu, 16 Sep 2021 13:25:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:41022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240999AbhIPRRY (ORCPT ); Thu, 16 Sep 2021 13:17:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DBDE361B68; Thu, 16 Sep 2021 16:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631810439; bh=u3MTLEp+sdwGmRrY2/LeZpkiPJfV2IR5DNYyhxUL090=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WmU+PBBWVOPyQSnaBQ19Fafu1nhQ/in6BUPAI4llC3ChPZqe1JSHToR6c1ebsb1q5 HZZ4rwM1mkNBn16G8qH3HLSd3XlUW0vE0mNuezFtcj1khXhjtIKpv4ohFcEU6siYYF mVeGLMdsbRaAf/L0tw2djju37tbeHujStAjhct/M= 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.14 142/432] RDMA/hns: Fix query destination qpn Date: Thu, 16 Sep 2021 17:58:11 +0200 Message-Id: <20210916155815.575754284@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155810.813340753@linuxfoundation.org> References: <20210916155810.813340753@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 e788a3cd5787aca74e0ee00202d4dca64b43f043 ] The bit width of dqpn is 24 bits, using u8 will cause truncation error. Fixes: 926a01dc000d ("RDMA/hns: Add QP operations support for hip08 SoC") Link: https://lore.kernel.org/r/1629985056-57004-2-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_hw_v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 21c82f5aff04..bf4d9f6658ff 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -5136,7 +5136,7 @@ static int hns_roce_v2_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, qp_attr->rq_psn = hr_reg_read(&context, QPC_RX_REQ_EPSN); qp_attr->sq_psn = (u32)hr_reg_read(&context, QPC_SQ_CUR_PSN); - qp_attr->dest_qp_num = (u8)hr_reg_read(&context, QPC_DQPN); + qp_attr->dest_qp_num = hr_reg_read(&context, QPC_DQPN); qp_attr->qp_access_flags = ((hr_reg_read(&context, QPC_RRE)) << V2_QP_RRE_S) | ((hr_reg_read(&context, QPC_RWE)) << V2_QP_RWE_S) | -- 2.30.2