Re: [PATCH 4/4] input: evdev: only wake poll on EV_SYN

From: Jeffrey Brown
Date: Fri Mar 25 2011 - 19:08:52 EST


>> -     if (event->type == EV_SYN)
>> +     if (event->type == EV_SYN && event->code != SYN_MT_REPORT)
>
> It is not clear what should happen at the other SYN events.  Maybe
> event->code == SYN_REPORT instead?
>
>>               kill_fasync(&client->fasync, SIGIO, POLL_IN);
>>  }

The reasoning here is that we want to wake up (for poll) or signal
(for fasync) the waiters when a complete packet is available.

SYN_CONFIG, SYN_REPORT and the proposed SYN_DROPPED are all
indications of a complete packet being ready or at least an indication
that the reader should do something. The odd one out is
SYN_MT_REPORT.

>> -     wake_up_interruptible(&evdev->wait);
>> +     if (type == EV_SYN && code != SYN_MT_REPORT)
>> +             wake_up_interruptible(&evdev->wait);
>
> Ah, this is a good one. Since the code depends on the same logic being
> applied in evdev_pass_event as well, a boolean argument to that
> function would be good.

I agree. We could pass a flag to evdev_pass_event to indicate whether
to signal fasync processes that are waiting for data.

Jeff.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/