raspberrypi / windows-drivers

Windows IOT drivers
MIT License
120 stars 33 forks source link

Booting from USB 3.0 with UASP enabled results in a BSoD #21

Open mariobalanica opened 3 years ago

mariobalanica commented 3 years ago

UAS drives connected to USB 2.0 and non-UAS ones connected to any port work flawlessly in every scenario.

alotipac commented 3 years ago

Can you try increasing the number of bounce buffers as shown in alotipac/rpi-windows-drivers@468ff193e55f28f535286acdcb254737be7836f0? This commit also adds an explicit blue screen if there are no more buffers. The driver stack ignores the error previously returned in this case, leading to an arbitrary and misleading crash somewhere else. I was able to install 19042 on an 8 GB device booting off a UAS drive on a USB 3 port with this change, but more testing should be done to make sure this is an acceptable buffer count and that it doesn't cause issues with non-UAS drives.

Allocating large amounts of contiguous memory like this should probably be avoided. Making the allocations dynamically could be tricky since AllocateCommonBuffer must be called at passive level, while GetScatterGatherList can be called at dispatch level. We could also make the count a driver registry setting if necessary, but it probably wouldn't be configurable until after first boot when the driver is fully installed.

mariobalanica commented 3 years ago

@alotipac I've applied your patch and did a clean install. First boot is okay, it reaches the "Getting ready" phase, reboots as expected, but then it stays for a while at the boot screen and finally crashes with UNMOUNTABLE_BOOT_VOLUME. Increasing the number of bounce buffers even more has no effect (tried up to 512). I've asked someone else to test as well, and they got the same results.

However, having the count set to 128 does certainly help. I'm now able to run CrystalDiskMark on the UAS drive when booted from SD, which previously resulted in random disconnects.

I'm thinking there may be something wrong with the uaspstor driver, as I'm not able to use my UAS drive at all without the filter driver (the RAM is limited to 3 GB). It gets detected but shortly becomes unresponsive. We've also seen reports that booting from UAS drives works fine on build 19041.330. Not sure why this specific build, but I'll test it myself and report back.

mariobalanica commented 3 years ago

No success with build 19041.330.

mariobalanica commented 3 years ago

Workaround merged here: https://github.com/raspberrypi/windows-drivers/commit/35d6c68e1b98dc504fc5a02b821917fa67d6fdda

Will keep this issue open until the root cause is fixed.

idigdoug commented 3 years ago

I configured my RPi4 with no filter driver, just 3GB ram and the compatibility flags. In this configuration, UAS works or does not work, depending on device model: