This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 3e845d72dbb drivers/rptun/rptun_bmp: wait for the resource table to be
initialized
3e845d72dbb is described below
commit 3e845d72dbbfc06274709021441a30e3d9d8d47f
Author: wangshaoxin <[email protected]>
AuthorDate: Sat Oct 31 19:51:17 2026 +0800
drivers/rptun/rptun_bmp: wait for the resource table to be initialized
The two cores of a BMP link share one resource table, and only one of
them initializes it. rptun_bmp_get_resource() returned the table right
away, so the core that does not own it could start parsing an
uninitialized table and find no vdev.
Wait in rptun_bmp_get_resource() until the table header has a non-zero
version. Both roles wait, since the table can be set up by either the
master or the slave depending on the board.
Signed-off-by: wangshaoxin <[email protected]>
Signed-off-by: yintao <[email protected]>
---
drivers/rptun/rptun_bmp.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/rptun/rptun_bmp.c b/drivers/rptun/rptun_bmp.c
index 52c395e07af..e319b78dcd6 100644
--- a/drivers/rptun/rptun_bmp.c
+++ b/drivers/rptun/rptun_bmp.c
@@ -99,6 +99,11 @@ rptun_bmp_get_resource(FAR struct rptun_dev_s *dev)
{
FAR struct rptun_bmp_dev_s *priv = (FAR struct rptun_bmp_dev_s *)dev;
+ while (priv->rsc->rsc_tbl_hdr.ver == 0)
+ {
+ nxsig_usleep(100);
+ }
+
return &priv->rsc->rsc_tbl_hdr;
}