console: Implement flush() function
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest6 patches 27 repliesIn review
- v26 patches 20 repliesSuperseded
- v11 patch 1 replySuperseded
Changes in v3 from the cover letter
* add macro STDIO_DEV_ASSIGN_FLUSH()
* fix commit messages
* remove changes from serial.c
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | sandbox: Add function os_flush()arch/ include/ | +13 | 2 replies | |
| 2/6 | console: Implement flush() functioncommon/ common/ include/ +2 more | +92 | 1 reply | |
| 3/6 | serial: Implement flush callbackdrivers/ | +20 | 3 replies | |
| 4/6 | serial: Implement serial_flush() function for console flush() fallbackcommon/ common/ drivers/ +1 more | +26 | 6 replies | |
| 5/6 | serial: Call flush() before changing baudratecmd/ drivers/ | +6 | 1 reply | |
| 6/6 | boot: Call flush() before bootingboot/ cmd/ cmd/ | +4 | 2 replies |
Reviews trailers per patch
All 6 patches have a Reviewed-by or Acked-by.
| Patch | Simon Glass |
|---|---|
| 1/6 | R-b |
| 2/6 | R-b |
| 3/6 | R-b |
| 4/6 | R-b |
| 5/6 | R-b |
| 6/6 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/6] console: Implement flush() function
On certain places it is required to flush output print buffers to ensure that text strings were sent to console or serial devices. For example when printing message that U-Boot is going to boot kernel or when U-Boot is going to change baudrate of terminal device.
Some console devices, like UART, have putc/puts functions which just put characters into HW transmit queue and do not wait until all data are transmitted. Doing some sensitive operations (like changing baudrate or starting kernel which resets UART HW) cause that U-Boot messages are lost.
Therefore introduce a new flush() function, implement it for all serial devices via pending(false) callback and use this new flush() function on sensitive places after which output device may go into reset state.
This change fixes printing of U-Boot messages:
"## Starting application at ..."
"## Switch baudrate to ..."
Changes in v3:
* add macro STDIO_DEV_ASSIGN_FLUSH()
* fix commit messages
* remove changes from serial.c
Changes in v2:
* split one big patch into smaller 6 patches
* add config option to allow disabling this new function
Pali Rohár (6):
sandbox: Add function os_flush()
console: Implement flush() function
serial: Implement flush callback
serial: Implement serial_flush() function for console flush() fallback
serial: Call flush() before changing baudrate
boot: Call flush() before booting
arch/sandbox/cpu/os.c | 5 +++ boot/bootm_os.c | 1 + cmd/boot.c | 1 + cmd/elf.c | 2 ++ cmd/load.c | 5 +++ common/Kconfig | 6 ++++ common/console.c | 64 ++++++++++++++++++++++++++++++++++ common/stdio.c | 8 +++++ drivers/serial/serial-uclass.c | 31 ++++++++++++++++ include/_exports.h | 3 ++ include/os.h | 8 +++++ include/serial.h | 5 +++ include/stdio.h | 15 ++++++++ include/stdio_dev.h | 7 ++++ 14 files changed, 161 insertions(+)
Signature · 1 line
2.20.1