Skip to content

drivers: stepper: Fix stepper callbacks when using work_q #88835

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

Conversation

jbr7rr
Copy link
Contributor

@jbr7rr jbr7rr commented Apr 20, 2025

Fix issue where stepper callbacks were not being called when using work_q. This was due to the steps being counted down before the work_q was rescheduled.

Added additional unit tests to stepper_api to verify the fix. Needed to increase the tolerance to 30% because of the timing of the work_q.

Fixes: #88821

Copy link
Member

@jilaypandya jilaypandya left a comment

Choose a reason for hiding this comment

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

Thanks for this Patch :)

can you run this script locally in order to fix compliance checks ./scripts/ci/check_compliance.py.

@jbr7rr jbr7rr force-pushed the fix-stepper-callbacks-when-using-work_q branch 2 times, most recently from dfeb19e to 5d6dced Compare April 22, 2025 13:21
Copy link
Collaborator

@faxe1008 faxe1008 left a comment

Choose a reason for hiding this comment

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

This should be seperated into two commits.

@jbr7rr
Copy link
Contributor Author

jbr7rr commented Apr 22, 2025

This should be seperated into two commits.

How? Unit test and fix?

@jilaypandya jilaypandya added the bug The issue is a bug, or the PR is fixing a bug label Apr 23, 2025
@jilaypandya
Copy link
Member

This should be seperated into two commits.

How? Unit test and fix?

Yep, the order would have to be fix and unit-test. Making 130 as a Kconfig could be added to the second commit as well :)

jbr7rr added 2 commits May 3, 2025 10:36
Fix issue where stepper callbacks were not being called when
using work_q. This was due to the steps being counted down before
the work_q was rescheduled.

Signed-off-by: Josselin Bunt <josselin@sensible.health>
This commit adds unit tests for the stepper API using work_q scheduler.

Signed-off-by: Josselin Bunt <josselin@sensible.health>
@jbr7rr jbr7rr force-pushed the fix-stepper-callbacks-when-using-work_q branch from 5d6dced to 1893718 Compare May 3, 2025 09:16
@kartben kartben merged commit c497088 into zephyrproject-rtos:main May 4, 2025
24 checks passed
Copy link

github-actions bot commented May 4, 2025

Hi @jbr7rr!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

jilaypandya added a commit to jilaypandya/zephyr that referenced this pull request May 4, 2025
deleting two test-cases from drv8424 test-suite since these test-cases
are now present in stepper-api since zephyrproject-rtos#88835

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
kartben pushed a commit that referenced this pull request May 5, 2025
deleting two test-cases from drv8424 test-suite since these test-cases
are now present in stepper-api since #88835

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
@jilaypandya jilaypandya added this to the v4.2.0 milestone Jun 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Stepper bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stepper: Callbacks not called when not using a dedicated timer
6 participants