Re: [BUG] uas: JMS578 returns reproducibly incorrect data after host reboot
From: djraszit
Date: Tue Sep 15 2026 - 14:50:58 EST
wt., 15 wrz 2026 o 08:50 Oliver Neukum <oliver@xxxxxxxxxx> napisał(a):
>
> On 14.09.26 20:44, djraszit wrote:
> > The most interesting result to me is therefore that, once the problem
> > has been triggered, the same disk and the same JMS578 return different
> > data depending on whether UAS or usb-storage/BOT is used, and
> > switching back to UAS reproduces exactly the same incorrect block
> > contents again.
> >
> > Please let me know if there are any additional traces, usbmon
> > captures, dynamic-debug output, or kernel instrumentation that would
> > be useful. I can reproduce the problem and perform further tests.
>
> Hi,
>
> thank you. You did testing on a very strange bug.
> However I need to request that you please do not remove the list from CC.
> People need to see our reasoning.
>
> Secondly, at this point we need to rule out that the Raspberry
> firmware does things to the enclosure. Could you please
>
> 1. suspend the raspberry with the drive attached
> 2. unplug the drive
> 3. resume the Raspberry
> 4. replug the drive
> 5. test for corruption
>
> in that order? That way we can determine whether the issue happens
> during suspension or resumption.
>
> Regards
> Oliver
>
Hi Oliver,
I performed some additional tests.
Unfortunately I cannot currently perform the suspend test on this
Raspberry Pi 4 because my custom kernel was built without suspend
support:
```
# CONFIG_SUSPEND is not set
```
/sys/power/state is therefore empty.
I can rebuild the kernel with suspend support if this particular test
is still important.
However, I performed several other tests which may be relevant.
First, I tested the same JMS578 enclosure on a Raspberry Pi 5. I
performed several reboots with the enclosure continuously connected
and powered. The data remained correct after every reboot.
I also tested suspend/resume on a Linux laptop with the same enclosure
and the data remained correct there as well.
I additionally tested switching transport modes while the JMS578 was
in a known good state:
```
UAS -> BOT -> UAS
```
The same test block returned the correct hash in all three cases.
This is different from the previously observed state after an affected
Raspberry Pi 4 reboot:
```
UAS -> BAD
BOT -> GOOD
UAS -> BAD
```
so changing between UAS and BOT by itself does not appear to create
the bad state.
I then investigated the Raspberry Pi 4 EEPROM bootloader USB power handling.
I tested:
```
USB_MSD_PWR_OFF_TIME=0
```
and also:
```
USB_MSD_PWR_OFF_TIME=5000
```
With 5000 I could visibly confirm on another USB-powered device that
USB power was actually removed for approximately five seconds during
reboot.
The longer power-off did not fix the incorrect reads.
With USB_MSD_PWR_OFF_TIME=0 I also encountered a reboot where the
JMS578 could no longer enumerate at all. Replugging USB twice did not
recover it, and power-cycling the enclosure while USB remained
connected did not recover it either. Only disconnecting USB and
switching off the enclosure, followed by reconnecting/powering it
again, restored communication.
Finally, I explicitly removed USB mass-storage boot from the boot order:
```
BOOT_ORDER=0xf1
```
The JMS578 still returned incorrect data after reboot.
So at this point the problem does not appear to require USB-MSD boot
probing, and increasing the configurable USB power-off interval to
five seconds does not prevent it.
The behaviour still appears specific to rebooting this Raspberry Pi 4.
The Raspberry Pi 5 and the Linux laptop do not reproduce it.
Regards,
djraszit