OpenAMP / openamp-system-reference

End-to-end system reference material showcasing all the different aspects of OpenAMP, on multiple vendor platforms.
Other
16 stars 15 forks source link

Unbind rpmsg dev #45

Closed tnmysh closed 3 months ago

tnmysh commented 5 months ago

Fix linux apps and unbind rpmsg device with driver after rpmsg communication is done.

arnopo commented 5 months ago

hi @tnmysh: do you tried to use RPMSG_DESTROY_EPT_IOCTL instead?

tnmysh commented 5 months ago

hi @tnmysh: do you tried to use RPMSG_DESTROY_EPT_IOCTL instead?

Actually, I can do that in separate PR, where binding and unbinding both are taken care via IOCTLs, instead of writing to sysfs nodes. For now this PR is only fixing existing workflow.

arnopo commented 5 months ago

hi @tnmysh: do you tried to use RPMSG_DESTROY_EPT_IOCTL instead?

Actually, I can do that in separate PR, where binding and unbinding both are taken care via IOCTLs, instead of writing to sysfs nodes. For now this PR is only fixing existing workflow.

you are right, the bind is implemented in current exemples, so the unbind make sense

wmamills commented 4 months ago

As discussed in the rpmsg call today, the demos should work if the correct driver is already bound and in this case at least the driver should not be unbound.

If the driver DOES need to be bound, it is debatable if it should be unbound on exit or just leave it knowing that the person that needs something else can do the unbind themselves.

tnmysh commented 4 months ago

As discussed in the rpmsg call today, the demos should work if the correct driver is already bound and in this case at least the driver should not be unbound.

Done.

tnmysh commented 4 months ago

@edmooring , @wmamills requesting reviews.

tnmysh commented 3 months ago

@wmamills , created follow up issue here: https://github.com/OpenAMP/openamp-system-reference/issues/50

wmamills commented 3 months ago

I have tested this with openamp-demo. I first versified the failure mode: docker run -it --rm openamp/demo-lite qemu-zcu102 demo3 (login as root) ./demo3A echo_test

This 2nd echo test fails. Likewise for demo3B and demo3C.

I then built a new image with openamp-ci-builds including this PR and updated the demo. With the new image echo_test and mat_mul_demo can run multiple times after their associated demo script.

However ./demo3C followed by proxy_app continues to fail. I belive this is because the proxy app firmware destroys its endpoint afterward and is not releated to this PR but this needs confirmation from @tnmysh

tnmysh commented 3 months ago

@wmamills yes I confirm. There will be separate PR to fix that behavior.

Thanks.