[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AANLkTikZs5eiN7LWP_LK9imGbdvUdw6mPqd_b__Qg3La@mail.gmail.com>
Date: Tue, 11 Jan 2011 16:10:28 +0100
From: Benjamin Tissoires <benjamin.tissoires@...c.fr>
To: Henrik Rydberg <rydberg@...math.org>
Cc: Stephane Chatty <chatty@...c.fr>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Jiri Kosina <jkosina@...e.cz>, linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC v3 3/5] hid-multitouch: support for PixCir-based panels
On Tue, Jan 11, 2011 at 2:53 PM, Benjamin Tissoires
<benjamin.tissoires@...c.fr> wrote:
> On Tue, Jan 11, 2011 at 2:00 PM, Henrik Rydberg <rydberg@...math.org> wrote:
>>> >> [...]
>>
>>> >> + if (value)
>>> >> + td->num_expected = value - 1;
>>> >
>>> > The - 1 should be dropped here.
>>>
>>> Here is the really tricky one:
>>>
>>> if I drop -1,
>>>
>>> the test below will be:
>>> if (field->index == td->last_field_index
>>> && td->num_received >= td->num_expected)
>>>
>>> but during the init of the device, the kernel receive 1 event though
>>> the driver is not ready.
>>
>> So the current code really needs to also check whether the driver is
>> ready to events. Adding a state for it would be appropriate. As it
>> stands, an unrelated syntatic oddity is covering up this fact.
>>
>>>
>>> During this time, num_expected is at 0, and when we receive the
>>> last_field_index: segfault!
>>>
>>> To sum up, no, we can't.
>>
>> Yes we can. :-)
>
> I'll look into it but I promise nothing.
>
Hehe, I found the bug:
My tests aginst last field in slot and last field in report were not
guarded by (hid->claimed & HID_CLAIMED_INPUT).
Now it works without the -1.
Cheers,
Benjamin
>>> >> + if (field->index == td->last_field_index
>>> >> + && td->num_received > td->num_expected)
>>> >
>>> > A ">=" here.
>>
>> still applies then.
>>
>> Thanks,
>> Henrik
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-input" in
>> the body of a message to majordomo@...r.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists