From: Hans Verkuil <hverkuil@xs4all.nl>
To: Florian Echtler <floe@butterbrot.org>, linux-media@vger.kernel.org
Subject: Re: [RFC] video support for Samsung SUR40
Date: Mon, 15 Dec 2014 17:01:51 +0100 [thread overview]
Message-ID: <548F05EF.8080700@xs4all.nl> (raw)
In-Reply-To: <548F029C.20907@butterbrot.org>
Hi Florian,
On 12/15/2014 04:47 PM, Florian Echtler wrote:
> Hi everyone,
>
> I'm currently working on adding raw sensor video support for the Samsung
> SUR40 touchscreen. I've finally found some useful documentation about
> videobuf2, and added the required functions to the driver (without
> actually delivering data so far, I just wanted to try and stream empty
> frames for starters).
>
> However, I'm running into an issue I have a hard time understanding. In
> particular, as soon as I load the kernel module, I'm getting a kernel
> oops (NULL pointer dereference) in line 354 or 355 of the attached
> source code. The reason is probably that the previous check (in line
> 350) doesn't abort - even though I didn't actually provide a buffer, so
> the list_head should be empty. As no user space program has actually
> opened the video device yet, there shouldn't be any buffers queued,
> right? (AFAICT the list is initialized properly in line 490).
>
> I'd be quite grateful if somebody with more experience can look over the
> code and tell me what mistakes I made :-)
Why on earth is sur40_poll doing anything with video buffers? That's
all handled by vb2. As far as I can tell you can just delete everything
from '// deal with video data here' until the end of the poll function.
The probably cause of the crash here is that the input device node is
created before the 'INIT_LIST_HEAD(&sur40->buf_list);' call, and since
udevd (I think) opens new devices immediately after they are created
it is likely that sur40_poll is called before buf_list is initialized.
But, as I said, that code doesn't belong there at all, so just remove it.
Regards,
Hans
>
> Thanks & best regards, Florian
>
> P.S. The SUR40 is a quite peculiar touchscreen device which does
> on-board image processing to provide touch data, but also allows to
> retrieve the raw video image. Unfortunately, it's a single USB device
> with two endpoints for the different data types, so everything (input &
> video) needs to be squeezed into one driver.
>
next prev parent reply other threads:[~2014-12-15 16:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-15 15:47 [RFC] video support for Samsung SUR40 Florian Echtler
2014-12-15 16:01 ` Hans Verkuil [this message]
2014-12-15 22:15 ` Florian Echtler
2014-12-15 22:34 ` Hans Verkuil
2014-12-16 12:35 ` Florian Echtler
2014-12-16 13:05 ` 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=548F05EF.8080700@xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=floe@butterbrot.org \
--cc=linux-media@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.