Skip to content

fix(split): Use managed queue for input report to avoid deadlock#3110

Open
tomori-k wants to merge 1 commit intozmkfirmware:mainfrom
tomori-k:avoid-input-split-deadlock
Open

fix(split): Use managed queue for input report to avoid deadlock#3110
tomori-k wants to merge 1 commit intozmkfirmware:mainfrom
tomori-k:avoid-input-split-deadlock

Conversation

@tomori-k
Copy link
Copy Markdown

@tomori-k tomori-k commented Nov 7, 2025

I found that sometimes peripheral stops working when I use a trackball while holding down a key. When I put a trackball on central, this is not occurred.
As a result of my debug, the issue seems to come from deadlock on system work queue, so we should also use our managed work queue for peripheral's input report.

PR check-list

  • Branch has a clean commit history
  • Additional tests are included, if changing behaviors/core code that is testable.
  • Proper Copyright + License headers added to applicable files (Generally, we stick to "The ZMK Contributors" for copyrights to help avoid churn when files get edited)
  • Pre-commit used to check formatting of files, commit messages, etc.
  • Includes any necessary documentation changes.

@tomori-k tomori-k requested a review from a team as a code owner November 7, 2025 15:27
@tomori-k tomori-k changed the title fix(split): Use our managed queue for input report to avoid deadlock fix(split): Use managed queue for input report to avoid deadlock Nov 7, 2025
@petejohanson petejohanson added this to the v0.4.0 milestone Jan 27, 2026
Copy link
Copy Markdown
Contributor

@petejohanson petejohanson left a comment

Choose a reason for hiding this comment

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

Code seems very reasonable. I want to test this locally before merging though. Thanks for the PR. See my one note about missing docs.

Thanks!


if ZMK_INPUT_SPLIT

config ZMK_INPUT_SPLIT_MSG_QUEUE_SIZE
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should get documented in one of our config docs pages please.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are you interested in continuing on this? If not, no worries, I can take over the PR and finish up the last testing and docs work. Thanks again.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sorry, I missed your comments. I’ll update the PR shortly. 🫡

- Use our service work queue to process input report to avoid deadlock on the system work queue
- Add config `CONFIG_ZMK_INPUT_SPLIT_MSG_QUEUE_SIZE`
@tomori-k tomori-k force-pushed the avoid-input-split-deadlock branch from f060e3f to b6633bb Compare March 20, 2026 15:38
@tomori-k tomori-k requested a review from a team as a code owner March 20, 2026 15:38
Copy link
Copy Markdown
Author

@tomori-k tomori-k left a comment

Choose a reason for hiding this comment

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

I've added the docs, please review it!

Copy link
Copy Markdown
Contributor

@petejohanson petejohanson left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for working on this!

@petejohanson
Copy link
Copy Markdown
Contributor

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.

2 participants