From: David Hildenbrand <david@redhat.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Linux Media Mailing List <linux-media@vger.kernel.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
Tomasz Figa <tfiga@chromium.org>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Jan Kara <jack@suse.cz>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] media: vb2: frame_vector.c: replace WARN_ONCE with a comment
Date: Thu, 17 Aug 2023 13:21:25 +0200 [thread overview]
Message-ID: <7ad62d3c-7bcb-5248-4fd9-bcab819d51d3@redhat.com> (raw)
In-Reply-To: <d5e1ee76-75b3-26cb-23ae-cf6ab40597b7@xs4all.nl>
On 17.08.23 12:41, Hans Verkuil wrote:
> The WARN_ONCE was issued also in cases that had nothing to do with VM_IO
> (e.g. if the start address was just a random value and uaccess fails with
> -EFAULT).
>
> There are no reports of WARN_ONCE being issued for actual VM_IO cases, so
> just drop it and instead add a note to the comment before the function.
>
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> ---
> diff --git a/drivers/media/common/videobuf2/frame_vector.c b/drivers/media/common/videobuf2/frame_vector.c
> index 0f430ddc1f67..fd87747be9b1 100644
> --- a/drivers/media/common/videobuf2/frame_vector.c
> +++ b/drivers/media/common/videobuf2/frame_vector.c
> @@ -31,6 +31,10 @@
> * different type underlying the specified range of virtual addresses.
> * When the function isn't able to map a single page, it returns error.
> *
> + * Note that get_vaddr_frames() cannot follow VM_IO mappings. It used
> + * to be able to do that, but that could (racily) return non-refcounted
> + * pfns.
> + *
> * This function takes care of grabbing mmap_lock as necessary.
> */
> int get_vaddr_frames(unsigned long start, unsigned int nr_frames, bool write,
> @@ -59,8 +63,6 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames, bool write,
> if (likely(ret > 0))
> return ret;
>
> - /* This used to (racily) return non-refcounted pfns. Let people know */
> - WARN_ONCE(1, "get_vaddr_frames() cannot follow VM_IO mapping");
> vec->nr_frames = 0;
> return ret ? ret : -EFAULT;
> }
>
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2023-08-17 11:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-17 10:41 Hans Verkuil
2023-08-17 11:21 ` David Hildenbrand [this message]
2023-08-17 11:41 ` Hans Verkuil
2023-08-17 14:56 ` Linus Torvalds
2023-08-17 15:02 ` Hans Verkuil
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=7ad62d3c-7bcb-5248-4fd9-bcab819d51d3@redhat.com \
--to=david@redhat.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=jack@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=tfiga@chromium.org \
--cc=torvalds@linux-foundation.org \
/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
all inboxes | Powered by JetHome®