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

added kernel detach to avoid error: LIBUSB_ERROR_BUSY #64

Closed
wants to merge 3 commits into from
Closed

added kernel detach to avoid error: LIBUSB_ERROR_BUSY #64

wants to merge 3 commits into from

Conversation

AMV007
Copy link

@AMV007 AMV007 commented May 30, 2024

No description provided.

@AMV007
Copy link
Author

AMV007 commented Jun 6, 2024

*fixed kernel claim
*increased timeout for bulk transfer, not enough 100 ms

firehose.c Outdated
@@ -130,13 +130,13 @@ static int firehose_read(struct qdl_device *qdl, int timeout_ms,
timeradd(&now, &delta, &timeout);

for (;;) {
n = qdl_read(qdl, buf, sizeof(buf), 100);
n = qdl_read(qdl, buf, sizeof(buf), 700);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But when we hit this timeout, won't timercmp() below result in the loop to be continued?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see pull request #67.

usb.c Outdated
@@ -193,8 +193,10 @@ int qdl_read(struct qdl_device *qdl, void *buf, size_t len, unsigned int timeout
int ret;

ret = libusb_bulk_transfer(qdl->usb_handle, qdl->in_ep, buf, len, &actual, timeout);
if (ret < 0)
if (ret < 0){
warnx("bulk read failed: %s", libusb_strerror(ret));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this not result in two timeout prints when a timeout happens?
And for the initial firehose_read() in firehose_run(), we do expect to get a timeout once we've consumed the LOG entries. I would hope we can remove the existing "firehose operation timed out" print.

@andersson
Copy link
Collaborator

We did some testing and have confirmed that the LIBUSB_ERROR_BUSY is something we want, so I was hoping to merge that.
Could you please provide a small problem description and split out the timeout change to its own PR?

@AMV007 AMV007 closed this by deleting the head repository Jun 7, 2024
@AMV007
Copy link
Author

AMV007 commented Jun 7, 2024

ok, created separate commit only for LIBUSB_ERROR_BUSY : #68

I got mate, who can reflash over Windows with QFIL without problems, but at linux got constant timeout in random places, usually at big image part 2 gb:

FIREHOSE READ:


LOG: INFO: Calling handler for program
FIREHOSE READ:


ERROR: n = -1, errno = 110 (Connection timed out)
qdl: failed to write: Connection timed out

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