Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2398180lqp; Sun, 24 Mar 2024 17:46:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWHkdFODzv02ax+osMRu5NSWiOE/TdvTG/BlkFf32tP8c3OvKIS84deIap5jBnfG57pr6QI5NjxCh0uARZ78hcFRYExtjhhjZAH8k8VsQ== X-Google-Smtp-Source: AGHT+IHYc04r2TkcraxmAxISfxSa+fCu9gsyl4phqGRF9XW2h9GqvquSBpeHHcTWuCBbzmGjBciR X-Received: by 2002:a05:622a:1a01:b0:431:5f31:eb89 with SMTP id f1-20020a05622a1a0100b004315f31eb89mr58164qtb.46.1711327595591; Sun, 24 Mar 2024 17:46:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711327595; cv=pass; d=google.com; s=arc-20160816; b=H0XWSEAvrhnhAQkL0tnsS+DEhj5CUH3mIsgX1ISDBietWc6Keb42v82Q//wl+Jv9T6 iU8sOW9OZctEmCvcKE3tvs4vSXjC4euN7wRKAii0+eaY8ByZy/esIR4/qFX8DI0XQ/dN h+NYMuUSDKf1xW93Eo1J9nzA4Jan6vm4AI/pfA2xxmViUSA78F+MPtJGc/FDJ2v1hxx8 LEuGw+xwE4K2WCdHThNZawTLWlO6rYgxaRDj4/B3VTBb3/em2uV+cRGwvo5zaL1ffZu/ qxXT01O56ITzrOdnPQZWgUrHJWb94oK5smxcfbYRX+z2RTgJvuhKZ/ld31jFLSd0jkv7 YyiQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=PPtAuJPWGbFHC3FiIpCFZRXrYo3vJDxrHvccqw3/H/I=; fh=/inM1FoqFuA19kzfK76qNvj4Zbw2Z1RkuOEPgrjIwBg=; b=z7FfO5jSqCC6bVmoqByoR9NE7Lp4n8ZzWs0PsptwReu9/igYWaw+dVdUBAo2KkhJoi otALUkjvfoXEJ8VCapZi6MxmRabX6ZEO1cJ3Cj5N9SXVDRJHzqkmjxdg/7++hu2ebxBp k0D5FSF7HE6vuT/PqwebOB4BRu3MUoAG++T8XoLZJUsWzCP6nSHKKz7vCpm9NAeiADHv ZYEPB/Ex6j5g6jh/AWcLE/6l4zDmS3NU/imgIYR59ZfK9LL3QI/HAsxLZHt079MAO1yH 8hLKIcjLiWw9dZX1Os9zpUx8oHprWypsBPUhZGx4DpDqhREefnJUd92o3tdJ8bQICYYI KeOw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t4dm6KrM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113476-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113476-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h10-20020a05622a170a00b004312419dda5si4448664qtk.763.2024.03.24.17.46.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:46:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113476-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t4dm6KrM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113476-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113476-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 476AA1C23FF1 for ; Mon, 25 Mar 2024 00:46:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 033AF1B4BF6; Sun, 24 Mar 2024 22:44:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="t4dm6KrM" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 141661B453F; Sun, 24 Mar 2024 22:44:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320277; cv=none; b=LgI79e2dvEceQZTP91q+11RCx2afriNgDRXrm/Hzv9r8n1j3o8ZJTaey9HWevOMxYMLnwJcSPqeIOWXkEcm75o0wptbDVQ/xnfjYyEabgQrd+0L2QaQbKUPBnYGIqH57izQxPwSfnrQdy3+qxOEvmZ+vakGowIHy9J05iKLuP7o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320277; c=relaxed/simple; bh=FyG+KOA3zwss0ROMKakELc5JW09kwZFpeal06o/3OWM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BXSdWkVohB887mCogMDgdGuiTgbf5FFuL75GSWaqKvpBPpE6GhgexwiNM7Ppt2gAKKFL3XGpelYjeLmi8WI8s5Of3Nzt+G164joNUPaUKJrrLSnsTEVOOTLnvCt+6gHv1OlVPiauBH+2b66hBjgSj1fl38gcfDqrhTLW0Z/79YU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=t4dm6KrM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 481D1C433B1; Sun, 24 Mar 2024 22:44:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320276; bh=FyG+KOA3zwss0ROMKakELc5JW09kwZFpeal06o/3OWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t4dm6KrM3QM3CAR6lkJ5M9mZM5cfOi1tO1bCCA/qE/St0Qam5WoMNrx/K1TuDJxbf 4VoAV6RgCx1Fr4YH7zJY0h5lj/yCXNCghYbX+LqIk64YAsywq5O41Fw9wiBsY5gM/c ReprdTbxRMo0BEAGzFysBPkTxSMJElo8lOE9tIen/RkN8Ylb4+areSMC/oF7FGO6v6 wr+3hiWFW2mNVuQ9PG69JaAmGjN7mXvY6KplpDDfqYGq4BRicSwRwqclpvW/bzPMrI O7VPlYrNmu/Cj1C6Xk7TeItAWwxAj6nYmfv0tt9c17QWMn7Pw5G9AUT/3b7kQnbN5e 7CrIp5aGNZFqQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Konstantin Taranov , Leon Romanovsky , Sasha Levin Subject: [PATCH 6.8 585/715] RDMA/mana_ib: Fix bug in creation of dma regions Date: Sun, 24 Mar 2024 18:32:44 -0400 Message-ID: <20240324223455.1342824-586-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Konstantin Taranov [ Upstream commit e02497fb654689049ba8b46f098f17d5f19e0b3c ] Use ib_umem_dma_offset() helper to calculate correct dma offset. Fixes: 0266a177631d ("RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter") Signed-off-by: Konstantin Taranov Link: https://lore.kernel.org/r/1709560361-26393-2-git-send-email-kotaranov@linux.microsoft.com Signed-off-by: Leon Romanovsky Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mana/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mana/main.c b/drivers/infiniband/hw/mana/main.c index faca092456fa3..7840c9e2631cc 100644 --- a/drivers/infiniband/hw/mana/main.c +++ b/drivers/infiniband/hw/mana/main.c @@ -358,7 +358,7 @@ int mana_ib_gd_create_dma_region(struct mana_ib_dev *dev, struct ib_umem *umem, sizeof(struct gdma_create_dma_region_resp)); create_req->length = umem->length; - create_req->offset_in_page = umem->address & (page_sz - 1); + create_req->offset_in_page = ib_umem_dma_offset(umem, page_sz); create_req->gdma_page_type = order_base_2(page_sz) - PAGE_SHIFT; create_req->page_count = num_pages_total; -- 2.43.0