From patchwork Mon Jul 12 06:07:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 475362 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62013C11F6C for ; Mon, 12 Jul 2021 07:52:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4C13D6138C for ; Mon, 12 Jul 2021 07:52:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348269AbhGLHza (ORCPT ); Mon, 12 Jul 2021 03:55:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:35486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350554AbhGLHvI (ORCPT ); Mon, 12 Jul 2021 03:51:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 45EC561A46; Mon, 12 Jul 2021 07:46:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626075973; bh=Ci28GTuQaGNWOQyEUaKdjuh/8/brGs9MOauW9RUo9B0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hTM7+iTVHv6PNC9YG1pDXfllSLnkJ54yfzc5pK/6kI8AKOVXhqBeTYe9WuYme8LiE +avZDEYt5bs/WCWEFQj/2PYPcQ0b7FP5qffmDG2//6K1M6+9EeH9QYiWNb55s/2mQ8 pOlYO8MtvoNwJPlg9e5FgNSg1FiGWeHhFInNWvqw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xi Wang , Weihang Li , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.13 427/800] RDMA/hns: Fix wrong timer context buffer page size Date: Mon, 12 Jul 2021 08:07:30 +0200 Message-Id: <20210712061012.550086354@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060912.995381202@linuxfoundation.org> References: <20210712060912.995381202@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Xi Wang [ Upstream commit 5e6370d7cc75134b0eb5b15916aab40b628db9e1 ] The HEM page size for QPC timer and CQC timer is always 4K and there's no need to calculate a different size by the hns driver, otherwise the ROCEE may access an invalid address. Fixes: 719d13415f59 ("RDMA/hns: Remove duplicated hem page size config code") Link: https://lore.kernel.org/r/1621589395-2435-4-git-send-email-liweihang@huawei.com Signed-off-by: Xi Wang Signed-off-by: Weihang Li Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 49bb4f51466c..d7289b6587f1 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -2092,12 +2092,6 @@ static void set_hem_page_size(struct hns_roce_dev *hr_dev) calc_pg_sz(caps->max_cqes, caps->cqe_sz, caps->cqe_hop_num, 1, &caps->cqe_buf_pg_sz, &caps->cqe_ba_pg_sz, HEM_TYPE_CQE); - if (caps->cqc_timer_entry_sz) - calc_pg_sz(caps->num_cqc_timer, caps->cqc_timer_entry_sz, - caps->cqc_timer_hop_num, caps->cqc_timer_bt_num, - &caps->cqc_timer_buf_pg_sz, - &caps->cqc_timer_ba_pg_sz, HEM_TYPE_CQC_TIMER); - /* SRQ */ if (caps->flags & HNS_ROCE_CAP_FLAG_SRQ) { calc_pg_sz(caps->num_srqs, caps->srqc_entry_sz,