-
Notifications
You must be signed in to change notification settings - Fork 15
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
Unbind rpmsg dev #45
Unbind rpmsg dev #45
Conversation
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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. |
Done. |
if (ret < 0) | ||
return ret; | ||
|
||
if (!is_rpmsg_chrdev_bind(rpmsg_dev)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function is_rpmsg_chrdev_bind can return true, false or an error. Seems that the error case should be treated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack. Thanks for catching this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think is_rpmsg_chrdev_bind should be moved within bind_rpmsg_chrdev.
As it's common to all the apps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with a minor comment
examples/linux/common/common.c
Outdated
close(fd); | ||
return 0; | ||
} else if (strncmp(drv_override, "(null)", strlen("(null)")) != 0) { | ||
printf("error: device %s is busy, drv bind=%s\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fprintf?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Check rpmsg device driver override and if correct driver is already bound, then execute rest of application. If driver is not bound, then bind rpmsg char driver. Signed-off-by: Tanmay Shah <[email protected]>
@edmooring , @wmamills requesting reviews. |
I have tested this with openamp-demo. 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. However ./demo3C followed by proxy_app continues to fail. |
@wmamills yes I confirm. There will be separate PR to fix that behavior. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested using openamp-demo demo3
Fix linux apps and unbind rpmsg device with driver after rpmsg communication is done.