-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
modem: pipe: Add explicit timeout to sync APIs #74325
modem: pipe: Add explicit timeout to sync APIs #74325
Conversation
The modem pipe APIs include synchronous calls to open/close, which internally use a fixed timeout of 10 seconds. The timeout should be configurable through the APIs, anywhere from K_NO_WAIT to K_FOREVER. This commit adds timeout parameters to the open/close APIs, and updates in-tree usage of the open/close APIs to explicitly provide the previously implicit timeout of 10 seconds. Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A change for the better :)
@@ -188,21 +188,21 @@ static int gnss_luatos_air530z_init(const struct device *dev) | |||
|
|||
luatos_air530z_init_dynamic_script(dev); | |||
|
|||
ret = modem_pipe_open(data->uart_pipe); | |||
ret = modem_pipe_open(data->uart_pipe, K_SECONDS(10)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the number be a kconfig option? (could be on a followup)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed could be nice to have a global default defined by a Kconfig option.
This PR does break the modem pipe API, so I would like to not include it in 3.7.0 to emphasize modem subsystem stability for LTS for downstream users :) |
@@ -87,6 +87,7 @@ void modem_pipe_init(struct modem_pipe *pipe, void *data, struct modem_pipe_api | |||
* @brief Open pipe | |||
* | |||
* @param pipe Pipe instance | |||
* @param timeout Timeout waiting for pipe to open |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param timeout Timeout waiting for pipe to open | |
* @param timeout Time to wait for pipe to open |
@@ -188,21 +188,21 @@ static int gnss_luatos_air530z_init(const struct device *dev) | |||
|
|||
luatos_air530z_init_dynamic_script(dev); | |||
|
|||
ret = modem_pipe_open(data->uart_pipe); | |||
ret = modem_pipe_open(data->uart_pipe, K_SECONDS(10)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed could be nice to have a global default defined by a Kconfig option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more thought: maybe a migration guide entry is in order for this?
Don't know how it goes for code marked experimental.
Sure :) I will add it after the release notes for 4.0.0 show up :) |
@bjarki-andreasen they are there now |
API calls missed are failing in CI and fixed in #76449 |
Add the missing timeout parameter to `modem_pipe_open()` and `modem_pipe_close()` calls. 10 seconds is the default value used in the Zephyr tree. Fixes a regression introduced in zephyrproject-rtos#74325. Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Also this is missing the migration guide entry we were talking about. |
Add the missing timeout parameter to `modem_pipe_open()` and `modem_pipe_close()` calls. 10 seconds is the default value used in the Zephyr tree. Fixes a regression introduced in zephyrproject-rtos#74325. Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Add the missing timeout parameter to `modem_pipe_open()` and `modem_pipe_close()` calls. 10 seconds is the default value used in the Zephyr tree. Fixes a regression introduced in #74325. Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Add the missing timeout parameter to `modem_pipe_open()` and `modem_pipe_close()` calls. 10 seconds is the default value used in the Zephyr tree. Fixes a regression introduced in zephyrproject-rtos/zephyr#74325. (cherry picked from commit 48d69b4) Original-Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no> GitOrigin-RevId: 48d69b4 Change-Id: I3c3938e8f1baa75e13b838b0a5a9b7c18f69ac29 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5748700 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Add the missing timeout parameter to `modem_pipe_open()` and `modem_pipe_close()` calls. 10 seconds is the default value used in the Zephyr tree. Fixes a regression introduced in zephyrproject-rtos#74325. Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
The modem pipe APIs include synchronous calls to open/close, which internally use a fixed timeout of 10 seconds. The timeout should be configurable through the APIs, anywhere from K_NO_WAIT to K_FOREVER.
This commit adds timeout parameters to the open/close APIs, and updates in-tree usage of the open/close APIs to explicitly provide the previously implicit timeout of 10 seconds.
The timeouts can be optimized to be lower in some cases, but initially just keep the 10 second timeouts to not break anything :)