From: Hans de Goede <hdegoede@redhat.com>
To: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Tsuchiya Yuto <kitakar@gmail.com>,
Martiros Shakhzadyan <vrzh@vrzh.net>,
linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org, Ira Weiny <ira.weiny@intel.com>,
outreachy@lists.linux.dev
Subject: Re: [PATCH] staging: media: atomisp: Use kmap_local_page() in hmm_set()
Date: Wed, 20 Apr 2022 13:07:05 +0200 [thread overview]
Message-ID: <0b04ad1a-e442-1728-ef2c-bab386a4c64c@redhat.com> (raw)
In-Reply-To: <20220413212210.18494-1-fmdefrancesco@gmail.com>
Hi,
On 4/13/22 23:22, 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 <fmdefrancesco@gmail.com>
I've successfully tested this on both the front and back cams
of a chuwi hi8 tablet:
Tested-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> 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;
prev parent reply other threads:[~2022-04-20 11:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-13 21:22 [PATCH] staging: media: atomisp: Use kmap_local_page() in hmm_set() Fabio M. De Francesco
2022-04-13 22:24 ` Ira Weiny
2022-04-20 11:07 ` Hans de Goede [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0b04ad1a-e442-1728-ef2c-bab386a4c64c@redhat.com \
--to=hdegoede@redhat.com \
--cc=fmdefrancesco@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=ira.weiny@intel.com \
--cc=kitakar@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=outreachy@lists.linux.dev \
--cc=sakari.ailus@linux.intel.com \
--cc=vrzh@vrzh.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).