CV-Bowen opened a new pull request, #22254:
URL: https://github.com/apache/nuttx/pull/22254
## Summary
- `drivers/rpmsg/rpmsg_virtio: destroy the services before
unregistering`: `rpmsg_virtio_remove()` called `rpmsg_unregister()`,
which destroys `rpmsg->lock`, before `rpmsg_device_destroy()`, which
still takes that lock to free the pending bind records. The services
are now destroyed first, then the work queues, then the device is
unregistered.
## Impact
- Teardown order of `rpmsg_virtio_remove()` only; no API or Kconfig
change.
## Testing
Host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu
13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU
Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205
The commit builds sim:rpserver, sim:rpproxy, qemu-armv8a:rpserver,
qemu-armv8a:rpproxy and qemu-armv7a:rpserver with 0 warnings.
**Teardown order (sim).** The use of the destroyed lock does not fail on
its own here, because the mutex memory is still valid. With a test-only
change (not in this PR) that clears `rpmsg->lock` right after
`nxrmutex_destroy()` in `rpmsg_unregister()`, `rptun stop
/dev/rptun/proxy` on sim:rpserver:
| | master | this PR |
|---|---|---|
| `rptun stop /dev/rptun/proxy` | never returns, nsh hangs (in
`rpmsg_device_destroy()` waiting on the cleared lock) | returns |
| `echo alive` afterwards | no answer | `alive` |
No regression in rpmsg: sim:rpserver/rpproxy and
qemu-armv8a:rpserver/rpproxy boot and pass the fixed rpmsg cases (dump, ping,
rpmsgfs; 15/15). qemu-armv8a was built with LIBC_ENVPATH and BINFMT_CHECKEXEC
disabled, which current master needs for nxinit to start nsh there; unrelated
to this change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]