-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
SYSLOG_DEFAULT: wrap up_putc/up_nputs calls with critical section #14722
SYSLOG_DEFAULT: wrap up_putc/up_nputs calls with critical section #14722
Conversation
This would avoid the undesirable intertactions with the serial driver described in apache#14662. Although I'm not entirely happy with this fix because it assumes the particular implementations of up_putc/up_nputc and its association to the serial devices, I haven't come up with better ideas for now. An alternative is to place some serializations inside the target specific serial (and/or whatever provides up_putc api) implementaitons. But it isn't too attractive to put potentially complex logic into the low-level machinaries, especially when we have a lot of similar copies of it. Another alternative is to deprecate up_putc. (at least for the purpose of syslog.) But it seems at least some of users are relying on what the current implementation provides heavily. This commit also removes g_lowputs_lock because the critical section would serve the purpose of the lock as well.
[Experimental Bot, please feedback here] No, this PR does not fully meet the NuttX requirements as described. Here's why:
To make this PR acceptable, address the following:
By providing this missing information, the PR will be much more likely to be reviewed and accepted. |
Question here; is syslog supposed to be usable before the OS has been initialized, i.e. nx_start has run to completion? After updating to latest upstream a syslog trace I have very early on during the boot process (before nx_start) causes a crash in nuttx/sched/irq/irq_csection.c Lines 204 to 206 in 4ef01d9
Obviously there is no task that is running since the OS has not been initialized yet. If syslog is not supposed to be used in early init, which tracing works (if any) ? |
This commit raised a lot of issues on Espressif SoCs: HW testing is failing for the following configs:
The device fails to boot without any other log output. Can you please take a look, @yamt ? |
…tion" This reverts commit f2aeb5e. Because regressions are reported: * apache#14722 (comment) * apache#14722 (comment) * apache#14749
…tion" This reverts commit f2aeb5e. Because regressions are reported: * #14722 (comment) * #14722 (comment) * #14749
So that it can be used in more situations. The primary motivation here is to avoid crashes introduced by apache#14722. Tested: - esp32-devkitc:wifi_smp (smp) - esp32s3-devkit:smp (ostest, smp) (with apache#14755)
Summary
This would avoid the undesirable intertactions with the serial driver described in #14662.
Although I'm not entirely happy with this fix because it assumes the particular implementations of up_putc/up_nputc and its association to the serial devices, I haven't come up with better ideas for now.
An alternative is to place some serializations inside the target specific serial (and/or whatever provides up_putc api) implementaitons. But it isn't too attractive to put potentially complex logic into the low-level machinaries, especially when we have a lot of similar copies of it.
Another alternative is to deprecate up_putc. (at least for the purpose of syslog.) But it seems at least some of users are relying on what the current implementation provides heavily.
This commit also removes g_lowputs_lock because the critical section would serve the purpose of the lock as well.
Impact
SYSLOG_DEFAULT
Testing
Tested on esp32s3-devkitc with a several unrelated local patches.