From: Heiner Kallweit <hkallweit1@gmail.com>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: linux-media@vger.kernel.org
Subject: Re: Problem since commit c73bbaa4ec3e [rc-core: don't lock device at rc_register_device()]
Date: Sat, 27 Feb 2016 22:42:24 +0100 [thread overview]
Message-ID: <56D21840.6080000@gmail.com> (raw)
In-Reply-To: <20160227165014.11b66f37@recife.lan>
Am 27.02.2016 um 20:50 schrieb Mauro Carvalho Chehab:
> Em Sat, 27 Feb 2016 19:39:16 +0100
> Heiner Kallweit <hkallweit1@gmail.com> escreveu:
>
>> Am 27.02.2016 um 19:05 schrieb Mauro Carvalho Chehab:
>>> Em Sat, 27 Feb 2016 17:10:41 +0100
>>> Heiner Kallweit <hkallweit1@gmail.com> escreveu:
>>>
>>>> Am 27.02.2016 um 13:14 schrieb Heiner Kallweit:
>>>>> Since this commit I see the following error when the Nuvoton RC driver is loaded:
>>>>>
>>>>> input: failed to attach handler kbd to device input3, error: -22
>>>>>
>>>>> Error 22 (EINVAL) comes from the new check in rc_open().
>>>>>
>>>>
>>>> Complete call chain seems to be:
>>>> rc_register_device
>>>> input_register_device
>>>> input_attach_handler
>>>> kbd_connect
>>>> input_open_device
>>>> ir_open
>>>> rc_open
>>>>
>>>> rc_register_device calls input_register_device before dev->initialized = true,
>>>> therefore the new check in rc_open fails. At a first glance I'd say that we have
>>>> to remove this check from rc_open.
>>>
>>> Hmm... maybe we could, instead, do:
>>>
>>> if (!rdev->initialized) {
>>> rval = -ERESTARTSYS;
>>> goto unlock;
>>> }
>>>
>> Looking at the source code of the functions in the call chain I see no special
>> handling of ERESTARTSYS. It's treated like any other error, therefore I don't
>> think this helps.
>
> The expected behavior is that the Kernel syscall code to handle ERESTARTSYS
> internally, and either return EAGAIN to userspace, or try again until
> it succeeds, depending on the open mode.
>
I tested it and returning ERESTARTSYS instead of EINVAL doesn't help.
The behavior is the same.
As far as I can see no syscall code is involved in this call chain.
> So, it seems a worth trial.
>
> Thanks,
> Mauro
>
next prev parent reply other threads:[~2016-02-27 21:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-27 12:14 Problem since commit c73bbaa4ec3e [rc-core: don't lock device at rc_register_device()] Heiner Kallweit
2016-02-27 16:10 ` Heiner Kallweit
2016-02-27 18:05 ` Mauro Carvalho Chehab
2016-02-27 18:39 ` Heiner Kallweit
2016-02-27 19:50 ` Mauro Carvalho Chehab
2016-02-27 21:42 ` Heiner Kallweit [this message]
2016-03-02 10:59 ` Mauro Carvalho Chehab
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=56D21840.6080000@gmail.com \
--to=hkallweit1@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
/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