-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
19199: sys/suit: Ensure previous thread is stopped before reusing its stack r=benpicco a=chrysn ### Contribution description Closes: #19195 If the thread has released the mutex but the thread has not terminated (which happens in the situation that would previously have overwritten a still active thread's state), then a warning is shown and the trigger is ignored. ### Testing procedure This should work before and after: * `make -C examples/suit_update BOARD=native all term` * `aiocoap-client coap://'[fe80::3c63:beff:fe85:ca96%tapbr0]'/suit/trigger -m POST --payload 'coap://[2001:db8::]/foo'` * In parallel, on the RIOT shell, run `suit fetch coap://[2001:db8::]/foo` * After the first download fails, the second one starts right away ("suit_worker: update failed, hdr invalid" / "suit_worker: started"). Run again with the worker thread on low priority: ```patch diff --git a/sys/suit/transport/worker.c b/sys/suit/transport/worker.c index a54022fb28..e26701a64c 100644 --- a/sys/suit/transport/worker.c +++ b/sys/suit/transport/worker.c `@@` -70 +70 `@@` -#define SUIT_COAP_WORKER_PRIO THREAD_PRIORITY_MAIN - 1 +#define SUIT_COAP_WORKER_PRIO THREAD_PRIORITY_MAIN + 1 ``` Before, this runs the download once silently (no clue why it doesn't run it twice, but then again, I claim there's concurrent memory access from two thread, so who knows what happens). After, it runs a single download and shows an error message for the second one once the first is complete ("Ignoring SUIT trigger: worker is still busy."). ### Issues/PRs references This may be made incrementally easier by #19197 -- that PR as it is now would spare us the zombification (because returning would do that), and having a `wait` function would allow us to turn the new error case into a success. 19205: boards/common: add common timer config for GD32VF103 boards r=benpicco a=benpicco 19207: examples/gnrc_border_router: static: use router from advertisements by default r=benpicco a=benpicco Co-authored-by: chrysn <[email protected]> Co-authored-by: Benjamin Valentin <[email protected]> Co-authored-by: Benjamin Valentin <[email protected]>
- Loading branch information
Showing
7 changed files
with
66 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (C) 2020 Koen Zandberg <[email protected]> | ||
* 2023 Gunar Schorcht <[email protected]> | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser | ||
* General Public License v2.1. See the file LICENSE in the top level | ||
* directory for more details. | ||
*/ | ||
|
||
/** | ||
* @ingroup boards_common_gd32v | ||
* @{ | ||
* | ||
* @file | ||
* @brief Common board definitions for GD32VF103 boards | ||
* | ||
* @author Koen Zandberg <[email protected]> | ||
* @author Gunar Schorcht <[email protected]> | ||
*/ | ||
|
||
#ifndef BOARD_COMMON_H | ||
#define BOARD_COMMON_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @name Xtimer configuration | ||
* @{ | ||
*/ | ||
#define XTIMER_WIDTH (16) | ||
/** @} */ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* BOARD_COMMON_H */ | ||
/** @} */ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,8 @@ | |
#ifndef BOARD_H | ||
#define BOARD_H | ||
|
||
#include "board_common.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,8 @@ | |
#ifndef BOARD_H | ||
#define BOARD_H | ||
|
||
#include "board_common.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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