-
Notifications
You must be signed in to change notification settings - Fork 15
Apm spf status fix #47
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
base: master
Are you sure you want to change the base?
Conversation
4013acd to
1741ff3
Compare
|
is this patches tested on actual target ? Please confirm. don't want to break existing setup, please update the PR description on which target tested this change |
|
|
||
| if (hdr->opcode == APM_CMD_RSP_GET_SPF_STATE) { | ||
| result = data->payload; | ||
| spf_status = (struct apm_cmd_rsp_get_spf_status_t *)(pkt+hdr_size); |
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.
spf_status is a struct, but you’re assigning a pointer to it and later dereferencing as spf_status->status. This is undefined and will likely crash.
Use‑before‑init for pkt / hdr_size : pkt and hdr_size are used without initializing.
Does this patch is validated , before submitting ?
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 respect to spf_status structure pointer, fixed this on a follow-up commit had issue syncing changes in fork with PR.
For the query on Use-Before-init for "hdr_size" & "pkt" pointer , line 607 & line 623-628 have these initialized and setup for usage on line 653.
Playback and Capture use case has been validated on Rb3Gen2, with this change.
q6apm callback function incorrectly processes SPF state responses by using header opcode, this causes the spf to always appear up. This change properly extracts the SPF status from the response payload and correctly populates the result & status values for accurate SPF state tracking. In addition push wait queue signalling to end of callback as apm spf query function waits on this queue. Signed-off-by: Manikantan R <manrav@qti.qualcomm.com>
update proble and remove callback to use devres managed api for of_platform_populate. Signed-off-by: Manikantan R <manrav@qti.qualcomm.com>
1741ff3 to
f2c1b6e
Compare
This change fixes SPF state handling. Previously opcode was forced in as the spf status queried which always is a positive numerical, not tracking the spf status accurately.
We fix here the status decoding by extracting status out of payload and refining the wait logic to signal after setting the status flags.
Playback and Capture use case has been validated on Rb3Gen2, with this change.