Skip to content
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

remoteproc_allocate_id not treating notifyid as 32-bits #403

Merged
merged 1 commit into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/include/openamp/remoteproc.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
extern "C" {
#endif

#define RSC_NOTIFY_ID_ANY 0xFFFFFFFFUL
#define RSC_NOTIFY_ID_ANY 0xFFFFFFFFU

#define RPROC_MAX_NAME_LEN 32

Expand Down
2 changes: 1 addition & 1 deletion lib/remoteproc/remoteproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ unsigned int remoteproc_allocate_id(struct remoteproc *rproc,

if (start == RSC_NOTIFY_ID_ANY)
start = 0;
if (end == 0)
if (end == RSC_NOTIFY_ID_ANY)
end = METAL_BITS_PER_ULONG;

notifyid = metal_bitmap_next_clear_bit(&rproc->bitmap,
Expand Down
7 changes: 5 additions & 2 deletions lib/remoteproc/rsc_table_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ int handle_vdev_rsc(struct remoteproc *rproc, void *rsc)
/* only assign notification IDs but do not initialize vdev */
notifyid = vdev_rsc->notifyid;
notifyid = remoteproc_allocate_id(rproc,
notifyid, notifyid + 1);
notifyid,
notifyid == RSC_NOTIFY_ID_ANY ?
RSC_NOTIFY_ID_ANY : notifyid + 1);
if (notifyid != RSC_NOTIFY_ID_ANY)
vdev_rsc->notifyid = notifyid;

Expand All @@ -143,7 +145,8 @@ int handle_vdev_rsc(struct remoteproc *rproc, void *rsc)
notifyid = vring_rsc->notifyid;
notifyid = remoteproc_allocate_id(rproc,
notifyid,
notifyid + 1);
notifyid == RSC_NOTIFY_ID_ANY ?
RSC_NOTIFY_ID_ANY : notifyid + 1);
if (notifyid != RSC_NOTIFY_ID_ANY)
vring_rsc->notifyid = notifyid;
}
Expand Down