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

For linux msm/firehose silence timeout warning #72

Conversation

quic-bjorande
Copy link
Contributor

No description provided.

firehose.c Outdated
@@ -53,6 +53,11 @@
#include "qdl.h"
#include "ufs.h"

enum {
FIREHOSE_ACK,
Copy link
Member

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;

Copy link
Member

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?

Copy link
Collaborator

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;
Copy link
Member

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

Copy link
Collaborator

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]>
@andersson andersson force-pushed the for-linux-msm/firehose-silence-timeout-warning branch from aa2cc69 to 4e3943b Compare June 7, 2024 20:05
@konradybcio konradybcio merged commit c647d6d into linux-msm:master Jun 7, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants