Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
I/O error with external SSD at the RPI4
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 484

PostPosted: Sat Nov 07, 2020 10:01 am    Post subject: Reply with quote

After recovering the EEPROM I still can not boot.

Are there any dependencies between the EEPROM image and the firmware?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46684
Location: 56N 3W

PostPosted: Sat Nov 07, 2020 12:47 pm    Post subject: Reply with quote

samo,

The new BOOTLOADER: permits booting from USB, with no SD Card required.
It checks the SD card first.

Is your SD card fitted properly?

With no storage devices attached to the Pi at all, it should give a repeating pattern of flashes on the green LED as it looks for something to load.
If that's OK, your firmware is good.

Power off the Pi.

Fit the SD card only. No USB storage.
Its should draw the 'rainbow' test pattern, then in 20 sec or so, the screen should clear and kernel messages appear. Its a long wait.
Before the 'rainbow' test pattern appears, you get a different pattern of flashes as /boot is being read.

I don't think fixup4* and start4* are required to track the firmware.
Mine are from June this year.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 484

PostPosted: Sat Nov 07, 2020 10:04 pm    Post subject: Reply with quote

After recovering the EEPROM and downloading the latest firmware and kernel the rpi4 is booting correctly again.
Code:
# rpi-eeprom-update
BCM2711 detected
Dedicated VL805 EEPROM detected
BOOTLOADER: up-to-date
CURRENT: Do 3. Sep 12:11:43 UTC 2020 (1599135103)
 LATEST: Do 3. Sep 12:11:43 UTC 2020 (1599135103)
 FW DIR: /lib/firmware/raspberrypi/bootloader/critical
VL805: up-to-date
CURRENT: 000138a1
 LATEST: 000138a1

But sadly the external SDD still causes problems. The connection is always interrupted, no matter if with or without UAS, if mounted or not, if the SSD is accessed or not.

Interestingly, the happens periodically after 181s - 182s.
Code:
...
[ 1284.121661] usb 2-1: USB disconnect, device number 9
[ 1284.123471] sd 1:0:0:0: [sdb] Synchronizing SCSI cache
[ 1284.123674] sd 1:0:0:0: [sdb] Synchronize Cache(10) failed: Result: hostbyte=0x01 driverbyte=0x00
[ 1284.446049] usb 2-1: new SuperSpeed Gen 1 USB device number 10 using xhci_hcd
[ 1284.466972] usb 2-1: New USB device found, idVendor=0781, idProduct=55a8, bcdDevice= 1.11
[ 1284.466987] usb 2-1: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[ 1284.466999] usb 2-1: Product: Extreme SSD
[ 1284.467010] usb 2-1: Manufacturer: SanDisk
[ 1284.467021] usb 2-1: SerialNumber: 323033344339343031313038
[ 1284.471044] usb 2-1: UAS is blacklisted for this device, using usb-storage instead
[ 1284.471158] usb 2-1: UAS is blacklisted for this device, using usb-storage instead
[ 1284.471172] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 1284.471674] usb-storage 2-1:1.0: Quirks match for vid 0781 pid 55a8: 800000
[ 1284.471827] scsi host1: usb-storage 2-1:1.0
[ 1286.257774] scsi 1:0:0:0: Direct-Access     SanDisk  Extreme SSD      0111 PQ: 0 ANSI: 6
[ 1286.911966] sd 1:0:0:0: [sdb] 1953525168 512-byte logical blocks: (1.00 TB/932 GiB)
[ 1286.913246] sd 1:0:0:0: [sdb] Write Protect is off
[ 1286.913263] sd 1:0:0:0: [sdb] Mode Sense: 4b 00 10 00
[ 1286.913960] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, supports DPO and FUA
[ 1286.915198] scsi 1:0:0:1: Enclosure         WD       SES Device       0111 PQ: 0 ANSI: 6
[ 1287.027352]  sdb: sdb1
[ 1287.030499] sd 1:0:0:0: [sdb] Attached SCSI disk
[ 1466.997659] usb 2-1: USB disconnect, device number 10
[ 1467.006374] sd 1:0:0:0: [sdb] Synchronizing SCSI cache
[ 1467.006658] sd 1:0:0:0: [sdb] Synchronize Cache(10) failed: Result: hostbyte=0x01 driverbyte=0x00
...
[ 1649.889656] usb 2-1: USB disconnect, device number 11
[ 1649.896516] sd 1:0:0:0: [sdb] Synchronizing SCSI cache
[ 1649.896726] sd 1:0:0:0: [sdb] Synchronize Cache(10) failed: Result: hostbyte=0x01 driverbyte=0x00
...
[ 1832.705655] usb 2-1: USB disconnect, device number 12
[ 1832.716065] sd 1:0:0:0: [sdb] Synchronizing SCSI cache
[ 1832.716264] sd 1:0:0:0: [sdb] Synchronize Cache(10) failed: Result: hostbyte=0x01 driverbyte=0x00
...
[ 2015.549657] usb 2-1: USB disconnect, device number 13
[ 2015.551579] sd 1:0:0:0: [sdb] Synchronizing SCSI cache
[ 2015.551784] sd 1:0:0:0: [sdb] Synchronize Cache(10) failed: Result: hostbyte=0x01 driverbyte=0x00
...
[ 2198.393655] usb 2-1: USB disconnect, device number 14
[ 2198.395493] sd 1:0:0:0: [sdb] Synchronizing SCSI cache
[ 2198.395705] sd 1:0:0:0: [sdb] Synchronize Cache(10) failed: Result: hostbyte=0x01 driverbyte=0x00
...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46684
Location: 56N 3W

PostPosted: Sun Nov 08, 2020 9:32 am    Post subject: Reply with quote

samo,

That sounds like sleep timer somewhere.
Does it do it USB 2 or on a PC?
Test both.

The idea is to try to determine if its the Pi, or the drive.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 484

PostPosted: Sun Nov 08, 2020 10:45 am    Post subject: Reply with quote

NeedySeagoon,

On USB2 it works smoothly.
Code:
[45013.353511] usb 1-1.3: new high-speed USB device number 3 using xhci_hcd
[45013.487087] usb 1-1.3: New USB device found, idVendor=0781, idProduct=55a8, bcdDevice= 1.11
[45013.487103] usb 1-1.3: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[45013.487115] usb 1-1.3: Product: Extreme SSD
[45013.487126] usb 1-1.3: Manufacturer: SanDisk
[45013.487138] usb 1-1.3: SerialNumber: 323033344339343031313038
[45013.489426] usb 1-1.3: UAS is blacklisted for this device, using usb-storage instead
[45013.489608] usb 1-1.3: UAS is blacklisted for this device, using usb-storage instead
[45013.489631] usb-storage 1-1.3:1.0: USB Mass Storage device detected
[45013.491545] usb-storage 1-1.3:1.0: Quirks match for vid 0781 pid 55a8: 800000
[45013.491716] scsi host1: usb-storage 1-1.3:1.0
[45015.248606] scsi 1:0:0:0: Direct-Access     SanDisk  Extreme SSD      0111 PQ: 0 ANSI: 6
[45015.891821] sd 1:0:0:0: [sdb] 1953525168 512-byte logical blocks: (1.00 TB/932 GiB)
[45015.892113] scsi 1:0:0:1: Enclosure         WD       SES Device       0111 PQ: 0 ANSI: 6
[45015.892719] sd 1:0:0:0: [sdb] Write Protect is off
[45015.892734] sd 1:0:0:0: [sdb] Mode Sense: 4b 00 10 00
[45015.896100] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, supports DPO and FUA
[45016.000686]  sdb: sdb1
[45016.003768] sd 1:0:0:0: [sdb] Attached SCSI disk

Comparing USB2 from my previous post with USB3 from above I see the following differences:
USB2:
Code:
[45013.353511] usb 1-1.3: new high-speed USB device number 3 using xhci_hcd
...

USB3:
Code:
[ 1284.446049] usb 2-1: new SuperSpeed Gen 1 USB device number 10 using xhci_hcd
...
[ 1286.915198] scsi 1:0:0:1: Enclosure         WD       SES Device       0111 PQ: 0 ANSI: 6

And it works also smoothly at the PC (USB3)
Code:
[ 2490.793093] usb 4-1: new SuperSpeed Gen 1 USB device number 3 using xhci_hcd
[ 2490.805774] usb 4-1: New USB device found, idVendor=0781, idProduct=55a8, bcdDevice= 1.11
[ 2490.805777] usb 4-1: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[ 2490.805779] usb 4-1: Product: Extreme SSD
[ 2490.805780] usb 4-1: Manufacturer: SanDisk
[ 2490.805782] usb 4-1: SerialNumber: 323033344339343031313038
[ 2490.808404] scsi host6: uas
[ 2492.205552] scsi 6:0:0:0: Direct-Access     SanDisk  Extreme SSD      0111 PQ: 0 ANSI: 6
[ 2492.206017] sd 6:0:0:0: Attached scsi generic sg3 type 0
[ 2492.206497] scsi 6:0:0:1: Enclosure         WD       SES Device       0111 PQ: 0 ANSI: 6
[ 2492.206662] sd 6:0:0:0: [sdc] 1953525168 512-byte logical blocks: (1.00 TB/932 GiB)
[ 2492.206740] sd 6:0:0:0: [sdc] Write Protect is off
[ 2492.206742] sd 6:0:0:0: [sdc] Mode Sense: 4b 00 10 00
[ 2492.206906] sd 6:0:0:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA
[ 2492.206945] scsi 6:0:0:1: Attached scsi generic sg4 type 13
[ 2492.207171] sd 6:0:0:0: [sdc] Optimal transfer size 33553920 bytes
[ 2492.217032]  sdc: sdc1
[ 2492.218203] sd 6:0:0:0: [sdc] Attached SCSI disk

Do you know how to get more debug info for USB in dmesg?

BR
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46684
Location: 56N 3W

PostPosted: Sun Nov 08, 2020 11:00 am    Post subject: Reply with quote

samo,

That points the finger very firmly at the Pi.

Which kernel are you using on the Pi?
Code:
uname -a


There is a USB debug option in the kernel. Its a kernel rebuild.
That's very much a last resort as kernel DEBUG options are permitted to interfere with normal operation.

There is also a kernel verbosity setting for dmesg. The kernel build sets a default value for it but it can be changed after booting too.
The kernel help tells how. Its will be a /proc or /sys setting.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 484

PostPosted: Sun Nov 08, 2020 5:17 pm    Post subject: Reply with quote

NeddySeagoon,

I'm using the kernel which I downloaded together with firmware from https://github.com/raspberrypi/firmware
Code:
# uname -a
Linux rpi4 5.4.74-v8+ #1366 SMP PREEMPT Fri Nov 6 14:45:23 GMT 2020 aarch64 GNU/Linux

I will take a look at the debugging/verbosity options and try them out.

BR
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46684
Location: 56N 3W

PostPosted: Sun Nov 08, 2020 5:45 pm    Post subject: Reply with quote

samo,

That's the prebuilt binary kernel you would have got had you built your own starting with
Code:
make bcm2711_defconfig

It should be good.

I'm running
Code:
# uname -a
Linux Pi4_~arm64 5.4.45-v8+ #1 SMP PREEMPT Fri Jun 12 21:56:38 BST 2020 aarch64 GNU/Linux
which has a few tweaks.
That works here. I can host the binary if you want to try it, or you can get an older kernel out of git.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 484

PostPosted: Sun Nov 08, 2020 8:32 pm    Post subject: Reply with quote

NeddySeagoon,

The USB debug options provide a lot of information in dmesg. Maybe a bit too much. But I noticed nothing unusual.

Before I now try to change the kernel verbosity, I gratefully accept your offer and try it with your kernel.

BR
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46684
Location: 56N 3W

PostPosted: Mon Nov 09, 2020 1:39 pm    Post subject: Reply with quote

samo,

My Pi4 kernel bits and pieces are at http://bloodnoc.org/~roy/Pi4/samo/

A few words of explanation are in order.

$ ls public_html/Pi4/samo/ -1
Code:
5.4.45-v8+

This is the kernel modules directory. Copy it recursively to /lib/modules/ beside the kernel modules you already have. You must not change its name, its used by the kernel to find its modules.
Code:
bcm2711-rpi-4-b.dtb_64

This is the device tree file. It goes in to /boot. Its not the default file name. You can either rename it or add a line to /boot/confiig.txt to use it. See Later.
It gets generated by compiling te the kernel.
Code:
fixup4cd.dat
fixup4.dat
fixup4db.dat
fixup4x.dat

These are the fixup4.* files used by the Pi4. You should not need them, they are included for completeness.
Code:
kernel-5.4.45-v8+

This is the kernel. It goes in to /boot. Its not the default file name. You can either rename it or add a line to /boot/confiig.txt to use it.
Code:
start4cd.elf
start4db.elf
start4.elf
start4x.elf

These are the start4.* files used by the Pi4. You should not need them, they are included for completeness.

To use my kernel and device tree names add the following to /boot/config.txt
Code:
# as we don't use default kernel names, we must set 64 bit mode.
# arm_control=0x200 # is the old way
arm_64bit=1

# Pi 4
device_tree=bcm2711-rpi-4-b.dtb_64

# Pi 4 64 bit
kernel=kernel-5.4.45-v8+


That switches the Pi to 64 bit mode and loads the named device_tree and kernel.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 484

PostPosted: Mon Nov 09, 2020 10:01 pm    Post subject: Reply with quote

NeddySeagoon,

I copied the modules, kernel, bcm2711-rpi-4-b.dtb_64 and modified the config.txt as described. The SSD is still periodically disconnected. I uploaded my dmesg output here

Can you upload your dmesg output for comparison?

BR
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46684
Location: 56N 3W

PostPosted: Tue Nov 10, 2020 8:49 am    Post subject: Reply with quote

samo,

dmesg from my Pi 4.

/dev/sdb ?

Root is on /dev/mmcblk0p3
What is /dev/sda?
Please post your
Code:
 lsusb -vvv
output. Be sure its lists both drives.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 484

PostPosted: Tue Nov 10, 2020 12:53 pm    Post subject: Reply with quote

NeddySeagoon,

The diff is a bit confusing in the second half, because I use OpenRc and you systemd (see also Pastebin).

My SSD is first connected as sda and after the disconnect it is connected as sdb.

Are there any relevant hardware changes from Raspberry Pi 4 Model B Rev 1.2 to Rev 1.4?

BR


Last edited by samo on Tue Nov 10, 2020 10:38 pm; edited 2 times in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46684
Location: 56N 3W

PostPosted: Tue Nov 10, 2020 4:59 pm    Post subject: Reply with quote

samo,

I use OpenRC everywhere.

Google wants me to log in to view your diff. That's not happening.
Please use a pastebin.

-- edit --

Wild guess. Do you have power management enabled in the drive, so that it goes to sleep after 3 minutes of inactivity.?

What do you get in the log when you do
Code:
dd if=/dev/sda of=/dev/null

That will copy the content of /dev/sda to /dev/null.
It should take a lot longer than 3 minutes too. Do you get errors while the drive is active?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 484

PostPosted: Wed Nov 11, 2020 8:57 am    Post subject: Reply with quote

NeddySeagoon,

also while dd is running the SSD is disconnected.

BR
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 484

PostPosted: Wed Nov 11, 2020 10:45 pm    Post subject: Reply with quote

Even if I completely disable power management in the kernel (CONFIG_PM = n), the SSD is periodically disconnected.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46684
Location: 56N 3W

PostPosted: Wed Nov 11, 2020 10:50 pm    Post subject: Reply with quote

samo,

We can rule out power management then.
Power management can be done by both the kernel and the drive, but not when the drive is busy, which was the point of the keep the drive busy test.

I've run out of ideas ant its time to sleep too. I'll post back if anything else occurs to me.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 484

PostPosted: Thu Nov 12, 2020 8:45 am    Post subject: Reply with quote

Also with the latest Raspberry Pi OS (32-bit, 2020-08-20) the SSD is periodically disconnected.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46684
Location: 56N 3W

PostPosted: Thu Nov 12, 2020 9:16 am    Post subject: Reply with quote

samo,

About all that's left is the PSU,

The drive says that it needs 900mA (almost). If it went over 1200mA the PI PSU may have problems as that's all there is for all connected USB devices.
Do you ever get any undervolt alarms in dmesg, on the screen, or does the Red LED ever go out.

We are only looking for a very short undervolt spike so it may go undetected.
About the only test without an oscilloscope is to power the drive separately from the Pi.
That means a powered USB3 hub or some electronics skills.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum