Window must be locked or MidiRunThread crashes with a segment violation.
Change-Id: I9d5d0fa477475a9b5ba877aea3d6583690aacb2b
Reviewed-on: https://review.haiku-os.org/c/1080
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
We need to hold the endpoint lock while reading the TD list on
the endpoint, as otherwise we have no guarantee that the pointers
will not be modified while we are looking at them.
Since this is the only consumer of _UnlinkDescriptorForPipe, just
make that function assume a lock, and then do all locking within
HandleTransferComplete.
This went through review too fast, the wrong variable name was used so
the package name was not listed...
Change-Id: I81d4aa57fdb65297ae9f63ebf123d7a6395a99b6
Reviewed-on: https://review.haiku-os.org/c/1109
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The Browse button was misplaced when the "Start up" setting was
introduced recently. Moving it back into the "Download folder" row.
Move the "Download folder" row to the bottom of the group.
Have the text field of the days-of-history BSpinner not stretch
the whole window width.
Change-Id: I00260126cf7594f435899fa821e8bf79bb475ba8
Reviewed-on: https://review.haiku-os.org/c/1110
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Getting 64 bytes of data in a 32 bit variable is a bad idea
Change-Id: I760e1cfb996a9be053dbc50d6610b3e865cde65d
Reviewed-on: https://review.haiku-os.org/c/1096
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* Don't set the IOC bit on the link TRB in LinkDescriptorForPipe. We don't
want to know about this' completion, only about the other transfers
completion and statuses. This should halve the interrupt rate.
* Check if this is an Event Data TRB, and return an error if it is.
(I haven't managed to trigger this code, but it is theoretically possible.)
* Rewrite loops for clarity and consistency.
* Use the correct offset when checking for the TRB.
- Don't rely on the trb_count to tell us whether the TRB is in the TD,
but just check the address based on MAX_TRBS_PER_TD.
- Previously, as the link TRB would trigger an interrupt, we could rely
on that to determine when the transfer finished. But that of course
did not tell us the correct status, as the link TRB is techically in a
different TD, as it isn't linked to the previous TRBs. Now we always use
"count - 1", which will be the final TRB in the TD, properly speaking.
* Print errors when we fail to find the TRB for any reason.
Reading multiple GB and abusing "stat" on a usb_disk following this commit
only managed to stall my usb_hid attached mouse once in multiple rounds of
testing, which seems a marked improvement; previously only a few hundred MB
and not that much abuse of "stat" were needed to actually trigger the stall.
So it seems this improves the stall situation considerably.
The TRB_3_DIR bit on the Status Stage was previously correctly set as per the spec:
Table 4-6: Status Stage TRB and Device-to-host and wLength > 0 means DIR OUT.
Also free descriptors when _LinkDescriptorForPipe fails.
There seems to be a problem with the way we set the gcc_bootstrap
package build to depend on the bootstrap package with haiku headers.
If said package cannot be built (for example some definitions are
missing for a new architecture), we end up passing an empty string as
the package to use to haikuporter.
The error message given by Haikuporter is confusing, and not easy to
investigate. So, intercept the error earlier to save time for the next
person to hit this problem.
Change-Id: I64f326e5cb3bb0d44632864ad38ad10bb88d0c7b
Reviewed-on: https://review.haiku-os.org/c/1082
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Gets the stage0 bootstrap to run.
Imlementation is probably nonsense at this point.
Change-Id: I10876efbb54314b864c0ad951152757cdb2fd366
Reviewed-on: https://review.haiku-os.org/c/1061
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* Fix dead initialization at line 596. Pointed out
by clang static analyzer.
* As a result, 'BMallocIO encodingIO' at line 524
becomes unused, so delete it and header.
Change-Id: Ia62184fe0682a2eedeee42a513faccabdd3d1b59
Reviewed-on: https://review.haiku-os.org/c/1079
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This is used quite a lot in critical transfer paths, so we don't
want to lock things up if no buffers are available for whatever reason.
Wait 2 seconds, and if we didn't get anything by then, return B_NO_MEMORY.
Possibly fixes or helps with certain USB-related lockups.
* Rearrange some basic setup to be more towards the top of the function,
so we have less things to tear down upon failures.
* Don't double-initialize qwtrb0 of the Setup Stage (no functional change.)
* Rework Data Stage initialization considerably:
- TD_SIZE refers to the number of remaining TRBs in this TD. As we only
use 1 TRB for the Data Stage TD at present, this should be 0, not 1.
- Actually copy data for outbound transfers. (This code does get hit,
so I'm not sure how it wasn't a problem previously.)
* Initialize the first quadbit of the Status Stage. (Potentially a
functional change.)
* Set the TRB_3_DIR bit on the Status Stage correctly as per the spec.
(See inline comment.)
Device initialization seems to behave much more smoothly now; at least on
my hardware, the "error Parameter" doesn't happen anymore, and of course
anything depending on outbound Control transfers will now work correctly.
I now get much better speeds from usb_disk, but I still see usb_hid stalls
after this patch.
Fixes various NULL dereferences in other parts of the USB stack
when the XHCI controller is not behaving quite as expected.
Possibly related to #13403.
We really should not be writing raw structs out to devices
for endianness' sake, but that's currently what *all* the
USB bus drivers do with this struct. So, add the _PACKED flag
to ensure it's always precisely 8 bytes.
Additionally, remove memory_chunk, as nothing uses it anymore.
Some of the functions moved lower in this commit use functions
that were previously defined below them, which was a warning in
GCC but an error in Clang.
It warns when you try to use some standard library functions
without including the system headers, which we don't
care about as we are providing the system headers in the tree.
This just stops the errors from occuring rather than trying to
rebuild the files at all. This is much cleaner, and solves
a few cases that the other method did not.
Since NULL is not considered a user address anymore, we must check for
it first.
This fixes the "mount: Bad address" error after hrev52905.
Change-Id: If60ea58bb81b6c35c6bf27ecfa9b29bd7a25d8aa
The x86_64 buildmaster was only updated past the R1~beta1 version
a few weeks ago, so most packages still have a R1~alpha4_pm dependency.
Thus thus broke the build. Revert it for now so we don't do that.