From patchwork Thu Aug 1 03:34:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashish Mhetre X-Patchwork-Id: 1967394 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=mURWs+ep; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.48.161; helo=sy.mirrors.kernel.org; envelope-from=linux-tegra+bounces-3148-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [147.75.48.161]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WZF2w5X4Mz1yYq for ; Thu, 1 Aug 2024 13:35:04 +1000 (AEST) 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C3691B208A1 for ; Thu, 1 Aug 2024 03:35:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1E5AE13213E; Thu, 1 Aug 2024 03:35:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="mURWs+ep" X-Original-To: linux-tegra@vger.kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2053.outbound.protection.outlook.com [40.107.223.53]) (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 50E3D1EB4A0; Thu, 1 Aug 2024 03:34:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722483299; cv=fail; b=E+SwYZnYEeTwH+tPk1KxJ1r9eiZf1DctSngrVJ/zvW7axUbBXoWrjbr319CbSawgpKoI/POFOy7DVI9wlomvGnWKu3s1sXzwcXLTUB773ULI+sVJZAjHRkv2URwFVC+0ZnihnSWs9rnY3h81MbEsLXc7QHRWFIG69m3lP9RmHLM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722483299; c=relaxed/simple; bh=jDNmRwOTHblC5WHvyK1XQ9RCaX4kSnUSOsckzwPD9c0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Rg5s13hItxqjx8kThgnx1MXXtOSIsoqdzxwE4poRtvZKKNmPVdAjA08A9cSxA3VVotTOKlUqc8qKfBofme24qL2SbMi3FdHnUO95K72YAfRWxoJCmGExAAG/IWU+xJ3E8+Lgl0ctc8Beo72NYFGIVrSyN8M+Ry8C3rgLy57zT14= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=mURWs+ep; arc=fail smtp.client-ip=40.107.223.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZgDILRUl2FjQqLpFuPPmwz2urB6NzmdJjFg60Om6c8hUA7Q9h2QfyLTsDadA2PLhJvEnzgXHpvdRDnWL0JDcaz79NaqkBkhCvPaDst6i4MTIfDMkdR9JbaCzMINpNhKTjDPomOEKx5RD6xHcdA8M7ub8gTHpCwVwJwEOd1/7+x0LTD6+S4NnOhCPNlBtLYyZZgx8DEED/RZTJEqnoMwdzVOFhzRYquHDLZJfeKDM1FPPsP2S4hnk2AC4c+jtODiXxz5T64jcH3VkIAuTx9MvRcQS1YEqj+pJb1uryQt+kfEj+eiolaDdf1expk1Ts5u/oBGtmOqOV4hfJp1c/X4TnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Z/JYYuNywcOlvbc7IRcLncHn6vGzXZYzbS9x8PuOD4Y=; b=n1Euq9VsARcmtiDCy4dXhnmSCvN7lWWzW85eGBC++m8vI6INIoxewntGaFYXLFM8sM/C5ijXm3hp7xZyACOF54OTUYVLhTMvL1Sed/gtPye2O4j6Q+iOUkczWzaMtDttDILNQ4yn1maE4ulYxoi6oQcblB0ZzOFQjS3wrv7WeNKXHxN1PN5ftrzJadvHt1EepZrw7a9KP3kDzuH3zERz1IB8SyU19kkVTdQUOivQpkGoueHPvVg06/JDWv0xxAYtbcZ3CkvHJVnljN64NX2EibqWJOeYdKr70sCr7iRlNUXHw+5uqg06JKOho7BlhRzxf2QEfnVhNIOiqilaVNYGag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z/JYYuNywcOlvbc7IRcLncHn6vGzXZYzbS9x8PuOD4Y=; b=mURWs+ep64grWcsL+UiNdEaoQGwGIw9VISTTkTLx/cjPqdwEZOR3jvIhQNBvNpKPwzfsZsApRRKocEL2cSC8UkDthidRkjIYUCbxtV/qTwN9lg0GK+krapCHmtVVjY+YugE+tw+dCC8by4ygDMq6fflrp69zo7iPwGXvt8N7Tma/QyonBVHhGJoVS8+BBU8VfN3zr+p3qxXe4VXiVNP8vRY0VghADx8Djibc5zH/00GvFTo7ggZV/0T6gYBwMq3qXbAB9WSA6wn+kBpd+76iCF0mB5TrT/6Hl3S+ZvzQO2Lg86W0MT6T5Flm/RrvaiAQC9fdqU+lwUPHD8LFNMm+mg== Received: from CH0PR03CA0001.namprd03.prod.outlook.com (2603:10b6:610:b0::6) by SN7PR12MB7909.namprd12.prod.outlook.com (2603:10b6:806:340::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Thu, 1 Aug 2024 03:34:55 +0000 Received: from CH3PEPF00000011.namprd21.prod.outlook.com (2603:10b6:610:b0:cafe::1c) by CH0PR03CA0001.outlook.office365.com (2603:10b6:610:b0::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22 via Frontend Transport; Thu, 1 Aug 2024 03:34:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CH3PEPF00000011.mail.protection.outlook.com (10.167.244.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.0 via Frontend Transport; Thu, 1 Aug 2024 03:34:54 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 31 Jul 2024 20:34:43 -0700 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 31 Jul 2024 20:34:42 -0700 Received: from build-amhetre-20240731T045122751.internal (10.127.8.10) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 31 Jul 2024 20:34:42 -0700 From: Ashish Mhetre To: , , CC: , , , , Ashish Mhetre Subject: [PATCH V2 2/2] include: linux: Update gather only if it's not NULL Date: Thu, 1 Aug 2024 03:34:32 +0000 Message-ID: <20240801033432.106837-2-amhetre@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240801033432.106837-1-amhetre@nvidia.com> References: <20240801033432.106837-1-amhetre@nvidia.com> Precedence: bulk X-Mailing-List: linux-tegra@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NVConfidentiality: public X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PEPF00000011:EE_|SN7PR12MB7909:EE_ X-MS-Office365-Filtering-Correlation-Id: 58137d62-c4d0-4eea-9853-08dcb1dae910 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: g40+F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+pHUzNLvg9/QWRNuBsv2dKlCvV4pBccxiOXthZG058RyDV5U/KgeZqmjBbWXUu51f4KqRP4mblOZJzYodpbDx8aDhewbzh+TBK8ejl2hZomDFngnWPnmqSE49Zs3A+/U0UU9dhVvo9fLgvHtoREoJegtLu9HiicC3umkxlPJSwQhuaB3vsjD4KvEYRfrHSBSFCLbV28JwvKGHkwKN0hGC/hC8KEuzFaRV54QdlWj/LuQVDPilGh9e1B4ofeMUABsOptJi/VRIXXNsCz16UwlSds7853Ue1cYIwrXADkdYhP+QbkLNenI+b+iziPaF0/pUJZdsErTbr6dnvR1uy6Ptv2PW4vwAK2sZBflz26TGWRnlwFgog+E/fev X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 03:34:54.9369 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 58137d62-c4d0-4eea-9853-08dcb1dae910 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH3PEPF00000011.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7909 Gather can be NULL when unmap is called for freeing old table while mapping. If it's NULL then there is no need to add page for syncing the TLB. Signed-off-by: Ashish Mhetre --- include/linux/iommu.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 4d47f2c33311..2a28c1ef8517 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -928,6 +928,9 @@ static inline void iommu_iotlb_gather_add_page(struct iommu_domain *domain, struct iommu_iotlb_gather *gather, unsigned long iova, size_t size) { + if (!gather) + return; + /* * If the new page is disjoint from the current range or is mapped at * a different granularity, then sync the TLB so that the gather