From patchwork Fri Dec 10 23:23:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 12671313 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4B7BC433FE for ; Fri, 10 Dec 2021 23:24:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345117AbhLJX1s (ORCPT ); Fri, 10 Dec 2021 18:27:48 -0500 Received: from mga04.intel.com ([192.55.52.120]:19150 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345093AbhLJX1q (ORCPT ); Fri, 10 Dec 2021 18:27:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1639178650; x=1670714650; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aqh3fjrZFwZQdyV8F2E3MUV9jSvhWsBpM7NLkE5MlFc=; b=WK1WgV+BjOi5AxdBqyD5xr1zW6ydTlU6aseusa04SfAnUkFHX7nJGWfL gho1kBlRkTwqTsrNCWcPsLzbu8Av8b3rNp65gvdkW8zPhnH1lt4dFiUeF h86DHcwdLa17/Xlg1UfX/kIPBaeHsvzsPPZtrrDFngoWZmyn8q0HARhZV oUWbjcJ/MLN4CqXi3BFW56QWvI1v44uAPZsVI1K7zjIgZcIKTh32hpNox ey1PfHF+URwGumBNpzxBQtE94k/6atI6f7suy4AGdA3BkWf30DpROA3UP HRz4mrAbwoTZK6ePrSS0GkPRxrv7n4tvKlZEt5G2eLyJ0v49FdY/ZATQY w==; X-IronPort-AV: E=McAfee;i="6200,9189,10194"; a="237212364" X-IronPort-AV: E=Sophos;i="5.88,196,1635231600"; d="scan'208";a="237212364" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2021 15:24:10 -0800 X-IronPort-AV: E=Sophos;i="5.88,196,1635231600"; d="scan'208";a="463861444" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2021 15:24:09 -0800 From: ira.weiny@intel.com To: David Airlie , Daniel Vetter , Patrik Jakobsson , Rob Clark , Sean Paul Cc: Ira Weiny , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 2/7] drm/amd: Replace kmap() with kmap_local_page() Date: Fri, 10 Dec 2021 15:23:59 -0800 Message-Id: <20211210232404.4098157-3-ira.weiny@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211210232404.4098157-1-ira.weiny@intel.com> References: <20211210232404.4098157-1-ira.weiny@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Ira Weiny kmap() is being deprecated. These maps are thread local and can be replaced with kmap_local_page(). Replace kmap() with kmap_local_page() Signed-off-by: Ira Weiny --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index c875f1cdd2af..a3a2c73a44bb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -2281,9 +2281,9 @@ static ssize_t amdgpu_iomem_read(struct file *f, char __user *buf, if (p->mapping != adev->mman.bdev.dev_mapping) return -EPERM; - ptr = kmap(p); + ptr = kmap_local_page(p); r = copy_to_user(buf, ptr + off, bytes); - kunmap(p); + kunmap_local(ptr); if (r) return -EFAULT; @@ -2332,9 +2332,9 @@ static ssize_t amdgpu_iomem_write(struct file *f, const char __user *buf, if (p->mapping != adev->mman.bdev.dev_mapping) return -EPERM; - ptr = kmap(p); + ptr = kmap_local_page(p); r = copy_from_user(ptr + off, buf, bytes); - kunmap(p); + kunmap_local(ptr); if (r) return -EFAULT;