forked from PX4/PX4-Autopilot
-
Notifications
You must be signed in to change notification settings - Fork 13
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
platforms/nuttx: Remove unnecessary sched_lock() from task spawn logic #812
Open
pussuw
wants to merge
672
commits into
main
Choose a base branch
from
rem_sched_lock
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
…mpiler Signed-off-by: Jukka Laitinen <[email protected]>
Signed-off-by: Jukka Laitinen <[email protected]>
Signed-off-by: Jukka Laitinen <[email protected]>
…ootloader without TOC If TOC_ADDRESS is not defined, assume that there is no TOC Signed-off-by: Jukka Laitinen <[email protected]>
Signed-off-by: Jukka Laitinen <[email protected]>
…_base address The default address was wrong. It doesn't cause harm, as it is anyhow set in the NuttX initialization again. Signed-off-by: Jukka Laitinen <[email protected]>
Increase uxrce_dds_client stack to get rid of stack low warning messages Signed-off-by: Jukka Laitinen <[email protected]>
This can be reverted when there is proper board definition under boards/ssrc Signed-off-by: Jukka Laitinen <[email protected]>
This can be reverted when there is proper board configuration under boards/ssrc Signed-off-by: Jukka Laitinen <[email protected]>
Signed-off-by: Jukka Laitinen <[email protected]>
timeout increased to avoid stopping before logger
Writing to two separate fifos (normal and delayed) Delay stopping until all reliable messages are sent Resending after ack timeout
Signed-off-by: Jukka Laitinen <[email protected]>
…allback unregistration In protected modes, the callback needs to be removed from the processes list of callbacks before unregistering it from the device node. Otherwise there is a risk for callback thread trying to access a callback which was already removed from the publishing node's list. Signed-off-by: Jukka Laitinen <[email protected]>
…on all targets Signed-off-by: Jukka Laitinen <[email protected]>
…gets Signed-off-by: Jukka Laitinen <[email protected]>
…locking on user input This fixes an earlier commit commit 0b60318 Author: Jukka Laitinen <[email protected]> Date: Fri Apr 22 16:40:13 2022 +0400 src/systemcmds/topic_listener: Change topic listener to poll only on uorb Signed-off-by: Jukka Laitinen <[email protected]>
…tervals Set the last_update to now-interval, instead of 0. Signed-off-by: Jukka Laitinen <[email protected]>
When the CPU load monitor is started while already running, then the idle thread last_times[0] is reset to the last 1 second, rather than since when the CPU load monitor was last started. The remaining threads are not impacted, since their last_times[i] is reset to zero here. This results in the idle thread having a lower than real CPU load, with the remaining CPU time being wrongly attributed as scheduler load.
…n topics. Signed-off-by: Jukka Laitinen <[email protected]>
…rizonal and vertical drift
In memory protected modes there were the following issues: 1. It is wrong to self-unregister the callback in uORBDeviceNode. The device node can't assume that the callback thread is killed if the callbacks haven't been handled timely. It might also be temporarily blocked e.g. during boot. If the device node unregisters the callback and the callback thread gets executed later, the cb_handle would point to an item within the device node that is not any more in use. 2. While registering a callback, it has to be registered to both callback thread and the device node before letting callback thread handle them. Fix these issues as follows: 1. Don't let the device node unregister the callback by itself 2. Keep the callback list locked for the full registration of the callback In addition, make a minor clean up for the uORB::DeviceNode::_unregister_callback. Get a pointer to the callback item before removing it from the node's cb list. The original code happened to work since the callback handle is just an idex to statically allocated items, but it looked weird. Signed-off-by: Jukka Laitinen <[email protected]>
Signed-off-by: Jukka Laitinen <[email protected]>
Signed-off-by: Jukka Laitinen <[email protected]>
Signed-off-by: Jukka Laitinen <[email protected]>
…ged in the new nuttx Signed-off-by: Jukka Laitinen <[email protected]>
…otype changed in the new NuttX Signed-off-by: Jukka Laitinen <[email protected]>
…he new NuttX Signed-off-by: Jukka Laitinen <[email protected]>
The file has been merged into nuttx/can.h Signed-off-by: Jukka Laitinen <[email protected]>
Signed-off-by: Jukka Laitinen <[email protected]>
Signed-off-by: Jukka Laitinen <[email protected]>
Signed-off-by: Jukka Laitinen <[email protected]>
Signed-off-by: Jukka Laitinen <[email protected]>
We don't want to maintain these any more Signed-off-by: Jukka Laitinen <[email protected]>
…to check that instead of "flat" Signed-off-by: Jukka Laitinen <[email protected]>
Signed-off-by: Jukka Laitinen <[email protected]>
To get nuttx with -CI fix -MPFS serial RX flowcontrol feature -vfork fix To enable RX flowcontrol feature in saluki defconfigs.
- This occurs due to nxsem_tickwait returning also other error values than -ETIMEDOUT. Fix the issue by treating any error value as a timeout. - There is no need to clear the uart errors in _stop_dma, errors are cleared in uart irq Signed-off-by: Jukka Laitinen <[email protected]>
Check the return values from DMA operations and add a performance counter to detect if there are any DMA related errors. Signed-off-by: Jukka Laitinen <[email protected]>
…update Signed-off-by: Jukka Laitinen <[email protected]>
Signed-off-by: Jukka Laitinen <[email protected]>
- Ensure that all interrupts are masked when configuring the block - Ensure that the RX serial shift register is empty after clearing FIFO as well as in buffer overflow situations
There is no rule to make this target (again) if it is deleted and then the sources are modified.
- The rule was for the folder boot/ while it should have been for the file boot/init - The rule for bin/ ROMFS depends on boot/init as well, since nsh is moved from the bin/ folder and generating the bin/ ROMFS cannot be done prior to this step
Do not copy the input directory again, if the target directory already exists. This confuses Ninja as it tries to remove the boot/ directory, but it contains sub-directories the build system does not know about (it should use "rm -rf" but it doesn't know it should)
Starting a new task does not require that the scheduler is locked, this is done in nsh only because nsh uses waitpid() to wait for the task to exit and record its exit status. The exit status does not interest us whatsoever -> remove the locking. Also, we don't need to explicitly change a tasks priority when it is created by px4_task_spawn_cmd, as task_create() already sets the priority via nxthread_setup_scheduler().
jlaitine
approved these changes
Nov 14, 2024
This would fit upstream as well, could you try to send it there? |
Yes, sure. Hopefully the cdcacm module doesn't give a conflict though. |
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.
Starting a new task does not require that the scheduler is locked, this is done in nsh only because nsh uses waitpid() to wait for the task to exit and record its exit status.
The exit status does not interest us whatsoever -> remove the locking.
Also, we don't need to explicitly change a tasks priority when it is created by px4_task_spawn_cmd, as task_create() already sets the priority via nxthread_setup_scheduler().