u-boot-starfive: crash with USB stick plugged in

Bug #2052141 reported by Heinrich Schuchardt
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
u-boot
Fix Released
Unknown
u-boot (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

With U-Boot 2024.01+dfsg-1ubuntu1 (Feb 01 2024 - 13:52:26 +0000) on a StarFive VisionFive2 with a USB stick plugged in when booting I saw the following exception:

starfive_7110_pcie pcie@2b000000: Starfive PCIe bus probed.
starfive_7110_pcie pcie@2c000000: Starfive PCIe bus probed.
In: serial@10000000
Out: serial@10000000
Err: serial@10000000
Net: eth0: ethernet@16030000, eth1: ethernet@16040000
starting USB...
Bus xhci_pci: Register 5000420 NbrPorts 5
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices... Device NOT ready
   Request Sense returned 02 3A 00
Unhandled exception: Store/AMO access fault
EPC: 00000000fff62c08 RA: 00000000fff96c48 TVAL: 0000000000000018
EPC: 0000000040221c08 RA: 0000000040255c48 reloc adjusted

Code: ee90 ea98 e394 ef14 8082 4885 b779 6d8c (ef0c)

tags: added: fr-6516
Revision history for this message
Heinrich Schuchardt (xypron) wrote :

With today's upstream U-Boot master branch:

starting USB...
Bus xhci_pci: Register 5000420 NbrPorts 5
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices... Device NOT ready
   Request Sense returned 02 3A 00
Adding disk for usb_mass_storage.lun0 failed (err=-9223372036854775788/0x8000000000000014)
6 USB Device(s) found
       scanning usb for storage devices... 2 Storage Device(s) found
Working FDT set to ff71c9b0
Hit any key to stop autoboot: 0

The error message is written in efi_disk_create_raw(). 0x8000000000000014 is the value of EFI_NOT_FOUND.

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

The upstream U-Boot USB driver seems to be buggy. It can read the partition table but fails to enumerate the files on the USB drive:

StarFive # part list usb 0

Partition Map for USB device 0 -- Partition Type: DOS

Part Start Sector Num Sectors UUID Type
  1 2048 2077696 05914b14-01 06
StarFive # ls usb 0:1
Resetting EP 3...
WARN endpoint is halted
WARN endpoint is halted
WARN endpoint is halted
Resetting EP 3...
WARN endpoint is halted
WARN endpoint is halted
WARN endpoint is halted
Resetting EP 3...
WARN endpoint is halted
WARN endpoint is halted
WARN endpoint is halted
Resetting EP 3...
WARN endpoint is halted
WARN endpoint is halted
WARN endpoint is halted
Resetting EP 3...
WARN endpoint is halted
WARN endpoint is halted
WARN endpoint is halted
Resetting EP 3...
WARN endpoint is halted
WARN endpoint is halted
WARN endpoint is halted

0 file(s), 0 dir(s)

StarFive #

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

These patches on top of v2024.01 avoid the problem:

0351b659dd02 ("efi_loader: create common function to free struct efi_disk_obj")
f674a2f9a9f9 ("efi_loader: avoid pointer access after calling efi_delete_handle")

Revision history for this message
Heinrich Schuchardt (xypron) wrote :
Changed in u-boot:
status: Unknown → New
Revision history for this message
Heinrich Schuchardt (xypron) wrote :

The patches were considered in the u-boot 2024.01+dfsg-1ubuntu1.

Changed in u-boot (Ubuntu):
status: New → Fix Released
Changed in u-boot:
status: New → Fix Committed
Changed in u-boot:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.