Skip to content

Instantly share code, notes, and snippets.

@Skrilltrax
Created May 27, 2020 18:02
Show Gist options
  • Save Skrilltrax/bc8d23bbfbf3d0ff2e2fb720371243ff to your computer and use it in GitHub Desktop.
Save Skrilltrax/bc8d23bbfbf3d0ff2e2fb720371243ff to your computer and use it in GitHub Desktop.
Fix the USB 3 issues in fastboot
@Echo off
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "osvc" /t REG_BINARY /d "0000" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "SkipContainerIdQuery" /t REG_BINARY /d "01000000" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "SkipBOSDescriptorQuery" /t REG_BINARY /d "01000000" /f
pause
@rikonaka
Copy link

rikonaka commented Sep 27, 2022

Hi, is there any performance influence after execute this script? Like usb performance or something else.

@Skrilltrax
Copy link
Author

Hi, is there any performance influence after execute this script? Like usb performance or something else.

Hey, no. There are no performance impacts.

@NamPNQ
Copy link

NamPNQ commented Nov 15, 2022

If anyone looking solution for linux, here is it:

$ lsusb
$ echo 'ID:k' | sudo tee /sys/module/usbcore/parameters/quirks # ID is the id of your phone device of previous command in format xxxx:xxxx

@Iey4iej3
Copy link

Iey4iej3 commented Jan 3, 2023

$ echo 'ID:k' | sudo tee /sys/module/usbcore/parameters/quirks # ID is the id of your phone device of previous command in format xxxx:xxxx

A better way to do this (which persists after reboots) is

# ID is the USB ID of the phone device
# e.g.
# ID='xxxx:xxxx'

echo "options usbcore quirks=${ID}:k" | sudo tee /etc/modprobe.d/fastboot.conf

@g0r3
Copy link

g0r3 commented Mar 3, 2025

$ echo 'ID:k' | sudo tee /sys/module/usbcore/parameters/quirks # ID is the id of your phone device of previous command in format xxxx:xxxx

A better way to do this (which persists after reboots) is

# ID is the USB ID of the phone device
# e.g.
# ID='xxxx:xxxx'

echo "options usbcore quirks=${ID}:k" | sudo tee /etc/modprobe.d/fastboot.conf

Is there a way to use some kind of wildcard for the ID? Like 18d1:*. I am asking, because I've noticed, that if the bootloader gets flashed during an update, the USB ID might or will change, so the phone won't be recognized after it is rebooting into fastboot during the flash process.

@Iey4iej3
Copy link

Iey4iej3 commented Mar 7, 2025

$ echo 'ID:k' | sudo tee /sys/module/usbcore/parameters/quirks # ID is the id of your phone device of previous command in format xxxx:xxxx

A better way to do this (which persists after reboots) is

# ID is the USB ID of the phone device
# e.g.
# ID='xxxx:xxxx'

echo "options usbcore quirks=${ID}:k" | sudo tee /etc/modprobe.d/fastboot.conf

Is there a way to use some kind of wildcard for the ID? Like 18d1:*. I am asking, because I've noticed, that if the bootloader gets flashed during an update, the USB ID might or will change, so the phone won't be recognized after it is rebooting into fastboot during the flash process.

I do not think so, and even if possible to do something similar (e.g. you can write a loop to enumerate all hex), it does not seem reasonable to do so, since it tells the kernel that "device can't handle Link Power Management", and if you plug in another device with ID satisfying this pattern, it would be wrongly indicated.

See https://github.com/torvalds/linux/blob/78b421b6a7c6dbb6a213877c742af52330f5026d/Documentation/admin-guide/kernel-parameters.txt#LL6608C2-L6608C16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment