Remove msync() on /dev/fb0 mmap: blocks forever on PW3, freezing the device#3
Open
iamgagan wants to merge 1 commit into
Open
Remove msync() on /dev/fb0 mmap: blocks forever on PW3, freezing the device#3iamgagan wants to merge 1 commit into
iamgagan wants to merge 1 commit into
Conversation
…device On a Kindle Paperwhite 7th gen (PW3, 2015, mxcfb driver), msync(fb, screensize, MS_SYNC) on the framebuffer mapping never returns. The render completes (save-pgm is written) but execution never reaches the eips refresh, so the screen stays unchanged while the input thread keeps an exclusive EVIOCGRAB on the touchscreen - the whole device appears frozen until a forced reboot. The calls are unnecessary: the mapping is MAP_SHARED on device memory, so stores land directly in framebuffer memory, and the display refresh is driven by eips/the EPDC rather than page-cache writeback. Verified on a PW3: with msync removed, rendering and the tap feedback flash work. Fixes thecodedose#2 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2.
On a Kindle Paperwhite 7th gen (PW3, 2015, firmware 5.x, mxcfb driver),
msync(fb, screensize, MS_SYNC)on the/dev/fb0mapping never returns. The pixel copy completes (the save-pgm is written correctly) but execution never reaches theeips ''refresh, so the screen never updates. Because the input thread holds an exclusiveEVIOCGRABon the touchscreen, the whole device appears frozen and users end up force-rebooting.Diagnosed by instrumenting
renderToFramebuffer()with a marker after each step; the log ends at the copy step while the touch thread keeps logging events (full trace in #2).The three
msynccalls (one inrenderToFramebuffer(), two inflashTouchRectOnFramebuffer()) are unnecessary: the mapping isMAP_SHAREDon device memory, so stores land directly in framebuffer memory, and the e-ink refresh is driven byeips/the EPDC rather than page-cache writeback.Verified on a real PW3: with the calls removed, the dashboard renders, refreshes, and the tap feedback flash works.
make -C kindle/native local(native:check) still passes.🤖 Generated with Claude Code