Skip to content

Conversation

@bjarki-andreasen
Copy link
Contributor

@bjarki-andreasen bjarki-andreasen commented Jun 14, 2024

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 :)

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 <[email protected]>
Copy link
Member

@rerickson1 rerickson1 left a 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 :)

luatos_air530z_init_dynamic_script(dev);

ret = modem_pipe_open(data->uart_pipe);
ret = modem_pipe_open(data->uart_pipe, K_SECONDS(10));
Copy link
Member

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)

Copy link
Contributor

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.

@bjarki-andreasen bjarki-andreasen added this to the v4.0.0 milestone Jun 18, 2024
@bjarki-andreasen
Copy link
Contributor Author

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 :)

* @brief Open pipe
*
* @param pipe Pipe instance
* @param timeout Timeout waiting for pipe to open
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param timeout Timeout waiting for pipe to open
* @param timeout Time to wait for pipe to open

luatos_air530z_init_dynamic_script(dev);

ret = modem_pipe_open(data->uart_pipe);
ret = modem_pipe_open(data->uart_pipe, K_SECONDS(10));
Copy link
Contributor

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.

Copy link
Contributor

@tomi-font tomi-font left a 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.

@bjarki-andreasen
Copy link
Contributor Author

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 :)

@aescolar
Copy link
Member

Sure :) I will add it after the release notes for 4.0.0 show up :)

@bjarki-andreasen they are there now

@carlescufi carlescufi merged commit 372c718 into zephyrproject-rtos:main Jul 29, 2024
@JordanYates
Copy link
Contributor

API calls missed are failing in CI and fixed in #76449

@tomi-font
Copy link
Contributor

Also this is missing the migration guide entry we were talking about.

tomi-font added a commit to tomi-font/zephyr that referenced this pull request Jul 30, 2024
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 <[email protected]>
aescolar pushed a commit that referenced this pull request Jul 30, 2024
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 <[email protected]>
coreboot-bot pushed a commit to coreboot/zephyr-cros that referenced this pull request Jul 30, 2024
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 <[email protected]>
GitOrigin-RevId: 48d69b4
Change-Id: I3c3938e8f1baa75e13b838b0a5a9b7c18f69ac29
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5748700
Reviewed-by: Fabio Baltieri <[email protected]>
Commit-Queue: Fabio Baltieri <[email protected]>
Tested-by: Fabio Baltieri <[email protected]>
Tested-by: ChromeOS Prod (Robot) <[email protected]>
mariucker pushed a commit to mariucker/zephyr that referenced this pull request Dec 12, 2024
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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants