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

CAN ISO-TP implementation not using local work queue #34862

Closed
martinjaeger opened this issue May 5, 2021 · 0 comments · Fixed by #35558
Closed

CAN ISO-TP implementation not using local work queue #34862

martinjaeger opened this issue May 5, 2021 · 0 comments · Fixed by #35558
Assignees
Labels
area: CAN bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@martinjaeger
Copy link
Member

Describe the bug

A local k_work_q is defined in isotp.c, but the work is always submitted to the system work queue using k_work_submit.

Just replacing the calls with k_work_submit_to_queue resulted in failing unit tests on nucleo_l452re.

Implementation test:

*** Booting Zephyr OS build zephyr-v2.5.0-3125-gf4f9fcc13ba5  ***
Running test suite isotp
===================================================================
START - test_bind_unbind
E: Got a frame but was not yet ready for a new one

    Assertion failed at WEST_TOPDIR/zephyr/tests/subsys/canbus/isotp/implementation/src/main.c:79: get_sf_net: (remaining_len >= 0 is false)
recv returned -8
 FAIL - test_bind_unbind in 0.31 seconds
===================================================================
START - test_send_receive_net_sf
E: No buffer for FF left

    Assertion failed at WEST_TOPDIR/zephyr/tests/subsys/canbus/isotp/implementation/src/main.c:218: test_send_receive_net_sf: (ret not equal to 0)
Bind returned -11
 FAIL - test_send_receive_net_sf in 0.17 seconds

...

Conformance test:

...

===================================================================
START - test_receive_data_blocks
 PASS - test_receive_data_blocks in 1.143 seconds
===================================================================
START - test_send_timeouts
E: Reception of next FC has timed out
E: Got unexpected PDU

    Assertion failed at WEST_TOPDIR/zephyr/tests/subsys/canbus/isotp/conformance/src/main.c:138: send_complette_cb: (error_nr not equal to expected_err_nr)
Unexpected error nr. expect: -2, got -6
 FAIL - test_send_timeouts in 1.24 seconds
===================================================================

Impact

It is annoying that the stack space is reserved, but not actually used. And it's not obvious at the moment why the local work queue does not work. There must be something seriously wrong.

@martinjaeger martinjaeger added bug The issue is a bug, or the PR is fixing a bug area: CAN labels May 5, 2021
@galak galak added the priority: low Low impact/importance bug label May 5, 2021
henrikbrixandersen added a commit to henrikbrixandersen/zephyr that referenced this issue May 22, 2021
Remove unused local work queue.

Fixes zephyrproject-rtos#34862

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
galak pushed a commit that referenced this issue May 22, 2021
Remove unused local work queue.

Fixes #34862

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: CAN bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants