From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
To: Lucas Stach <l.stach@pengutronix.de>, linux-media@vger.kernel.org
Cc: linux-input@vger.kernel.org,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Nick Dyer <nick@shmanahar.org>,
Christopher Heiny <cheiny@synaptics.com>,
Vandana BN <bnvandana@gmail.com>
Subject: Re: [PATCH 4/5] input/rmi4/rmi_driver: check if irq_find_mapping returns 0
Date: Sat, 23 Nov 2019 14:53:27 +0100 [thread overview]
Message-ID: <67116e00-fe6e-2d3f-1122-16e7c34b6af1@xs4all.nl> (raw)
In-Reply-To: <23edf0ed-55a1-d70d-e7ed-78a62617b1cc@xs4all.nl>
On 11/19/19 12:43 PM, Hans Verkuil wrote:
> On 11/19/19 12:38 PM, Lucas Stach wrote:
>> Hi Hans,
>>
>> On Di, 2019-11-19 at 11:51 +0100, Hans Verkuil wrote:
>>> The irq_find_mapping() function can return 0 when called in the
>>> rmi_process_interrupt_requests() function.
>>>
>>> This causes a kernel crash. Check for a 0 value and skip calling
>>> handle_nested_irq() in that case.
>>>
>>> This was tested with the F54 function enabled on a Lenovo X1 Carbon.
>>>
>>> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
>>> Fixes: 24d28e4f1271 ("Input: synaptics-rmi4 - convert irq distribution to irq_domain")
>>
>> This is already fixed upstream by 549766ac2ac1
>> "Input: synaptics-rmi4 - clear IRQ enables for F54"
>
> Good news. I'm not subscribed to the linux-input ML, so I never saw that.
>
> Ah, I now see that I'm missing a whole bunch of patches that were added
> after v5.4-rc1. I'll test this again next week (I don't have access to my
> Lenovo at the moment).
Tested with v5.4-rc8 and I can confirm that this patch is not needed anymore
and can be dropped.
Regards,
Hans
>
> Regards,
>
> Hans
>
>>
>> Regards,
>> Lucas
>>
>>> ---
>>> drivers/input/rmi4/rmi_driver.c | 8 ++++++--
>>> 1 file changed, 6 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
>>> index 772493b1f665..6085ec424a84 100644
>>> --- a/drivers/input/rmi4/rmi_driver.c
>>> +++ b/drivers/input/rmi4/rmi_driver.c
>>> @@ -154,8 +154,12 @@ static int rmi_process_interrupt_requests(struct rmi_device *rmi_dev)
>>> */
>>> mutex_unlock(&data->irq_mutex);
>>>
>>> - for_each_set_bit(i, data->irq_status, data->irq_count)
>>> - handle_nested_irq(irq_find_mapping(data->irqdomain, i));
>>> + for_each_set_bit(i, data->irq_status, data->irq_count) {
>>> + unsigned int irq = irq_find_mapping(data->irqdomain, i);
>>> +
>>> + if (irq)
>>> + handle_nested_irq(irq);
>>> + }
>>>
>>> if (data->input)
>>> input_sync(data->input);
>>
>
next prev parent reply other threads:[~2019-11-23 13:53 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-19 10:51 [PATCH 0/5] input: rmi4/synaptics fixes Hans Verkuil
2019-11-19 10:51 ` [PATCH 1/5] input/mouse/synaptics: add LEN0091 support Hans Verkuil
2019-11-23 0:17 ` Dmitry Torokhov
2019-11-19 10:51 ` [PATCH 2/5] input/rmi4/rmi_f54: fix various V4L2 compliance problems Hans Verkuil
2019-11-19 11:42 ` Lucas Stach
2019-11-23 0:19 ` Dmitry Torokhov
2019-11-19 10:51 ` [PATCH 3/5] pixfmt-tch-td16/tu16.rst: document that this is little endian Hans Verkuil
2019-11-23 16:12 ` Hans Verkuil
2019-11-25 18:51 ` Dmitry Torokhov
2019-11-19 10:51 ` [PATCH 4/5] input/rmi4/rmi_driver: check if irq_find_mapping returns 0 Hans Verkuil
2019-11-19 11:38 ` Lucas Stach
2019-11-19 11:43 ` Hans Verkuil
2019-11-23 13:53 ` Hans Verkuil [this message]
2019-11-19 10:51 ` [PATCH 5/5] input/rmi4/rmi_smbus.c: don't increment rmiaddr in rmi_smb_read_block() Hans Verkuil
2019-11-19 11:48 ` Lucas Stach
2019-11-19 12:19 ` Hans Verkuil
2019-11-23 16:27 ` [PATCHv2 5/5] input/rmi4/rmi_smbus.c: don't increment rmiaddr Hans Verkuil
2019-12-02 18:09 ` Dmitry Torokhov
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=67116e00-fe6e-2d3f-1122-16e7c34b6af1@xs4all.nl \
--to=hverkuil-cisco@xs4all.nl \
--cc=bnvandana@gmail.com \
--cc=cheiny@synaptics.com \
--cc=dmitry.torokhov@gmail.com \
--cc=l.stach@pengutronix.de \
--cc=linux-input@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=nick@shmanahar.org \
--cc=p.zabel@pengutronix.de \
/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).