Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iofixes #9

Merged
merged 5 commits into from Nov 26, 2012
Merged

Iofixes #9

merged 5 commits into from Nov 26, 2012

Conversation

spiiroin
Copy link
Contributor

@spiiroin spiiroin commented Nov 8, 2012

MCE (and glib) incorrectly assume that lseek() works with various device files. While seeking in
/dev/input/eventX files has never been possible, older kernels (for example 2.6.32) do not report lseek() errors. By lucky chance the fact that mce is using buffered reads hides most of the problems this might cause.

However, if kernel is recent enough to return ESPIPE when seek in evdev file is attempted, the touchscreen event skipping logic in mce starts to misbehave.

Also using buffered reads might cause broken wakelock chains when recovering from suspend due to power key press.

Signed-off-by: Simo Piiroinen simo.piiroinen@jollamobile.com

The wakelock avare evdev drivers hold a wakelock only until all
clients have read all events. If buffered reads are used, we might
hit automatic suspend before having chance to obtain user space
wakelock for the duration of actually processing the input.
Makes issues we might have easier to spot
Looks like glib assumes that all regular, characted device and
block device files are seekable. This produces lots of false positives
in case of MCE inputs.
Should improve performance since a amaller number of mainloop .. callback
roundtrips are needed.

Also allows us to skip at least some the input we are not interested in
even if seeking the underlying file descriptor is not possible.
/**
* Check if the monitored io channel is truly seekable
*
* Glib seems to be making guesses based on file type and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is worth patching glib for, in case other components have a similar problem (now, or in the future). It also strikes me that this may be an issue that upstream might want to know about, so it might be nice to send a bugreport to them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, copy paste error slipped through ...
spiiroin added a commit that referenced this pull request Nov 26, 2012
Fixes to io callbacks handling chunked inputs
@spiiroin spiiroin merged commit 30845a1 into nemomobile:master Nov 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants