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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3A61C433F5 for ; Wed, 13 Apr 2022 22:24:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237045AbiDMW03 (ORCPT ); Wed, 13 Apr 2022 18:26:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236741AbiDMW02 (ORCPT ); Wed, 13 Apr 2022 18:26:28 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B72C20F75; Wed, 13 Apr 2022 15:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649888645; x=1681424645; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=lQvTZgp3nYD8xLl9vXBiy5U1JTi15pjSvf2S1fGEa24=; b=JoykGhWm/siIjUA6C5Qj9T96jslV85f6DjqWrcTlA/KRuSqauOuwXHxK X4BoFDWtVDg4axsP3cV8Iw2Qf2sY/k1QowG/5CWGwYIX7WOTZnVtd7xKR KuDFjgv4oq2eg+pR4Su+m2VIjVDHfvGW9RHmxi/RazoBZBYX3PShk9aWt /QPHJOZRLpjav/+idVg6mlvhl4Sm/rmq/CgnPB0aUI/a11jwVQX5fGYhc fzQwMTZ+HnD2wTqWr6NO67G+IM1iaijVxB8XKpTRNkc8lQ/CsWvwltNps frPaWhg2M+k5+9MPQLejxokXOyiEfI+fHA5DiNaE/D1z5gd67aZ7S3vQD A==; X-IronPort-AV: E=McAfee;i="6400,9594,10316"; a="244676278" X-IronPort-AV: E=Sophos;i="5.90,258,1643702400"; d="scan'208";a="244676278" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2022 15:24:04 -0700 X-IronPort-AV: E=Sophos;i="5.90,258,1643702400"; d="scan'208";a="623854294" Received: from sdoyen-mobl1.amr.corp.intel.com (HELO localhost) ([10.213.179.195]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2022 15:24:04 -0700 Date: Wed, 13 Apr 2022 15:24:04 -0700 From: Ira Weiny To: "Fabio M. De Francesco" Cc: Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , Hans Verkuil , Tsuchiya Yuto , Martiros Shakhzadyan , Hans de Goede , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, outreachy@lists.linux.dev Subject: Re: [PATCH] staging: media: atomisp: Use kmap_local_page() in hmm_set() Message-ID: References: <20220413212210.18494-1-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220413212210.18494-1-fmdefrancesco@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Wed, Apr 13, 2022 at 11:22:10PM +0200, Fabio M. De Francesco wrote: > The use of kmap() is being deprecated in favor of kmap_local_page() > where it is feasible. In file pci/hmm/hmm.c, function hmm_set() calls > kmap() / kunmap() where kmap_local_page() can instead do the mapping. > > With kmap_local_page(), the mapping is per thread, CPU local and not > globally visible. Therefore, hmm_set()() is a function where the use > of kmap_local_page() in place of kmap() is correctly suited. > > Convert the calls of kmap() / kunmap() to kmap_local_page() / > kunmap_local(). > > Signed-off-by: Fabio M. De Francesco Reviewed-by: Ira Weiny > --- > drivers/staging/media/atomisp/pci/hmm/hmm.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/media/atomisp/pci/hmm/hmm.c b/drivers/staging/media/atomisp/pci/hmm/hmm.c > index 6394385b6637..46ac082cd3f1 100644 > --- a/drivers/staging/media/atomisp/pci/hmm/hmm.c > +++ b/drivers/staging/media/atomisp/pci/hmm/hmm.c > @@ -563,7 +563,7 @@ int hmm_set(ia_css_ptr virt, int c, unsigned int bytes) > idx = (virt - bo->start) >> PAGE_SHIFT; > offset = (virt - bo->start) - (idx << PAGE_SHIFT); > > - des = (char *)kmap(bo->page_obj[idx].page) + offset; > + des = (char *)kmap_local_page(bo->page_obj[idx].page) + offset; > > if ((bytes + offset) >= PAGE_SIZE) { > len = PAGE_SIZE - offset; > @@ -579,7 +579,7 @@ int hmm_set(ia_css_ptr virt, int c, unsigned int bytes) > > clflush_cache_range(des, len); > > - kunmap(bo->page_obj[idx].page); > + kunmap_local(des); > } > > return 0; > -- > 2.34.1 >