From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 354E9C3DA4A for ; Mon, 19 Aug 2024 14:46:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F146110E2AF; Mon, 19 Aug 2024 14:46:40 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="hsK3OwcD"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id B0ACD10E2AF; Mon, 19 Aug 2024 14:46:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724078800; x=1755614800; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=dXCbV8piiQWmpeCw7SmqLNnEnUsqlk0VIhuEgQxA6PM=; b=hsK3OwcDcsXqjp2Oz6XqtkXy6x319HHQZwjNivLNV772NE03bzIcSbMl 4hFlY+MmZXqq0VbUTzZu7yNmsV+YCXi1aLElRA1uawKNXCjsAHU6Pt0lN sxnijlPYrvUA1whujtuE6oupqSQR0FczAsOf676G9zX7BLsxbtkuzu/ui 7hmBqlJTaBpcyIKbuffpjd61GBXoqNGnEZ0J1ZXmKlnljRjUXg6N+sSO+ QNhGyd5LNRSRO/0/RvCwYWvqYk0zLqZkWSAunxRRrazwxN758qfZhQxcg Pr6hjeg/pg3q5ZKqI0BEHqW5axR8cq3FsBnaZocNc1E+FNjKchI1AxOJH A==; X-CSE-ConnectionGUID: nR0RRZkuRS+HJJWq03RvQQ== X-CSE-MsgGUID: g3WRa+bSQ6ix7tKwDBlajw== X-IronPort-AV: E=McAfee;i="6700,10204,11169"; a="33486461" X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="33486461" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 07:46:40 -0700 X-CSE-ConnectionGUID: YjRvIG5vQqm1nA1Q9yWRug== X-CSE-MsgGUID: KVivW2jVSsWN+Vtoldbyvg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="60975171" Received: from peterval-mobl1.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.124.114.37]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 07:46:39 -0700 Date: Mon, 19 Aug 2024 07:28:45 -0700 Message-ID: <87le0s8u3m.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Thorsten Blum Cc: lucas.demarchi@intel.com, thomas.hellstrom@linux.intel.com, rodrigo.vivi@intel.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [RESEND PATCH] drm/xe/oa: Use vma_pages() helper function in xe_oa_mmap() In-Reply-To: <20240819095751.539645-2-thorsten.blum@toblux.com> References: <20240819095751.539645-2-thorsten.blum@toblux.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Mon, 19 Aug 2024 02:57:52 -0700, Thorsten Blum wrote: > > Use the vma_pages() helper function and remove the following > Coccinelle/coccicheck warning reported by vma_pages.cocci: > > WARNING: Consider using vma_pages helper on vma > > Reviewed-by: Ashutosh Dixit > Signed-off-by: Thorsten Blum Sorry Thorsten, looks like we forgot to merge it last time. I have merged this just now. Thanks for the patch. > --- > drivers/gpu/drm/xe/xe_oa.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c > index 6d69f751bf78..133292a9d687 100644 > --- a/drivers/gpu/drm/xe/xe_oa.c > +++ b/drivers/gpu/drm/xe/xe_oa.c > @@ -1244,8 +1244,7 @@ static int xe_oa_mmap(struct file *file, struct vm_area_struct *vma) > vm_flags_mod(vma, VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP | VM_DONTCOPY, > VM_MAYWRITE | VM_MAYEXEC); > > - xe_assert(stream->oa->xe, bo->ttm.ttm->num_pages == > - (vma->vm_end - vma->vm_start) >> PAGE_SHIFT); > + xe_assert(stream->oa->xe, bo->ttm.ttm->num_pages == vma_pages(vma)); > for (i = 0; i < bo->ttm.ttm->num_pages; i++) { > ret = remap_pfn_range(vma, start, page_to_pfn(bo->ttm.ttm->pages[i]), > PAGE_SIZE, vma->vm_page_prot); > -- > 2.46.0 >