-
Notifications
You must be signed in to change notification settings - Fork 80
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
For linux msm/firehose silence timeout warning #72
For linux msm/firehose silence timeout warning #72
Conversation
firehose.c
Outdated
@@ -53,6 +53,11 @@ | |||
#include "qdl.h" | |||
#include "ufs.h" | |||
|
|||
enum { | |||
FIREHOSE_ACK, |
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.
"Clean this up by defining ACK and NAK in the positive value space and
use the negative value space for errno."
almost, but I don't mind ;)
maybe add a =value to the first entry
return FIREHOSE_ACK; | ||
if (xmlStrcmp(value, (xmlChar*)"NAK") == 0) | ||
return FIREHOSE_NAK; | ||
|
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.
should we print whatever came out here?
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 think we should follow up and adjust the error prints throughout the file to give better error messages. Perhaps strerror(ret) vs "device rejected" printing.
return ret; | ||
if (ret != FIREHOSE_ACK) { | ||
fprintf(stderr, "[CONFIGURE] request failed\n"); | ||
return -1; |
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.
might as well return ret to propagate errors from 2 levels deeper
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.
No, because then we might return FIREHOSE_NAK from firehose_run(), I rather keep that in {0,-1} space...
firehose_read() uses -errno to denote errors, -1 to represent NAK, 1 to represent ACK and 0 to represent that we got a LOG and should read again. This choice is unintuitive and choosing to overload errno and NAK on the negative value space isn't awesome. Additionally, firehose_run() does in some cases return -errno and others -1. Clean this up by defining ACK and NAK in the non-negative value space and use the negative value space for errno. Use -EAGAIN to signal that firehose_read() should make another read attempt. Signed-off-by: Bjorn Andersson <[email protected]>
During boot and following the reset, a firehose_read() is performed to drain any LOG messages from the device, but as there's no response to be read these operations runs until the defined timeout happens - at which time "firehose operation timed out" is printed to stderr, confusing users to believe an error condition has occurred. The only operation that not already print an error message is firehose_reset(), so add this and remove the error print from firehose_read(). Signed-off-by: Bjorn Andersson <[email protected]>
The xmlDoc returned by firehose_response_parse() needs to be freed regardless of what message it contains. Signed-off-by: Bjorn Andersson <[email protected]>
aa2cc69
to
4e3943b
Compare
No description provided.