-
Notifications
You must be signed in to change notification settings - Fork 1.4k
drivers/rpmsg: port spi add debug log, low power feature and bug fixs #17760
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
Merged
+276
−46
Conversation
This file contains hidden or 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
xiaoxiang781216
previously approved these changes
Jan 4, 2026
Contributor
|
@CV-Bowen please fix: |
4ee8a05 to
93b04d7
Compare
Add log to know the error command and aviable buffer number Signed-off-by: liaoao <liaoao@xiaomi.com>
1. add error log when transferring keeps rasing because of no spi exchange complete callback; 2. this log can also be used to check if there is an interrupt has been caught when peer side keeps trying to send data; Signed-off-by: liaoao <liaoao@xiaomi.com>
93b04d7 to
8c27a73
Compare
8c27a73 to
1670455
Compare
Because rxq may have received reconnection data, when connect state changed to unconnected but the reconnect data has not been processed, and during that time there is a tx buffer to be sent, the drop_packets may drop the reconnect data and two sides can not reconnected anymore. Signed-off-by: liaoao <liaoao@xiaomi.com>
to make sure the connecting process will not be interrupted Signed-off-by: liaoao <liaoao@xiaomi.com>
because rxq may have received peer's reconnection data, so we can connect with peer again. Signed-off-by: liaoao <liaoao@xiaomi.com>
Shutdown mean peer's want to disconnect the connection untial peer want connect with local side again. After receive shutdown command, local will clear the state until reconnecting and clear the gpio status to avoid the leak current. Signed-off-by: liaoao <liaoao@xiaomi.com>
Now rpmsg port spi can receive peer's suspend and resume command, suspend command means peer enter into the lowpower state and resume command means peer waked up These two commands can let us know peer's running status, so we will modify the rpmsg signals to let the rpmsg service can get peer's running state too. Signed-off-by: liaoao <liaoao@xiaomi.com>
In the stop process, add SPI_SETFREQUENCY(rpspi->spi, 0) to stutdown the spi device. Signed-off-by: liaoao <liaoao@xiaomi.com>
If connect cmd is dropped during the shutdown cmd process, it will not be able to reconnect because current side will not try to send connect cmd after shutdown cmd processed. So change state to connecting when received connect cmd during the shutdown cmd process. Signed-off-by: liaoao <liaoao@xiaomi.com> Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
The reconnect will fail because the state changes to connecting when shutdown cmd is still in process. And after the shutdown cmd processed, it will reset the state to unconnected, even though the connect cmd is in ready list, it will still not be processed. This patch solve this issue. Signed-off-by: liaoao <liaoao@xiaomi.com> Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
1670455 to
17608bb
Compare
xiaoxiang781216
approved these changes
Jan 6, 2026
jerpelea
approved these changes
Jan 7, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Summary
This PR fix some reconnecting bugs when peer core reboot/carsh to
make sure the two cores can reconntecting and continue to communicate.
In addition, this PR also add the rpmsg-port-spi low power support.
rpmsg_port_spi: fix reconnect failed issue
rpmsg_port_spi/slave: change state to connecting when received connect cmd during the shutdown cmd process
rpmsg_port_spi.c: setfreq to 0 to shutdown the spi device
rpmsg_port_spi/slave: add suspend/resume notify
rpmsg_port_spi: add support for peer's shutting down notify
rpmsg_port_spi_slave: only drop tx queue used buffer when unconnecting
rpmsg_port_spi: add connecting/disconnecting status for port spi
rpmsg_port_spi: only drop tx queue used buffer, because rxq may have received reconnection data
rpmsg_port_spi: add log to know spi complete callback not called
rpmsg_port_spi: add more detail debug info for transfer failed
Impact
Rpmsg Port SPI
Testing
Testing with internal projects