[SOLVED] Odroid-N2: umount hangs & hdparm fails

This is for ARMv8 based devices

[SOLVED] Odroid-N2: umount hangs & hdparm fails

Postby atmoos » Sun Jun 02, 2019 3:20 pm

I'm running ARMv8 on an Odroid-N2 and a Raspberry Pi3. I'm running into issues on the Odroid-N2.
I've got two types of HDD at hand:
- Toshiba (works fine on N2 and Pi3, details to follow)
- Seagate (works fine on Pi3, troubles on N2, details to follow)

Mount/Unmount
If I mount the Seagate on the N2 the unmount command hangs until my SSH session reports a broken pipe:
$this->bbcode_second_pass_code('', '
thomas@n2 ~ % sudo umount mnt
client_loop: send disconnect: Broken pipe
')
--> This prompted me to investigate closer using hdparm
Note: Mounting causes no problems

hdparm issues on N2
When I try to get information about the connected drive using hdparm, that fails too:
$this->bbcode_second_pass_code('', '
thomas@n2 ~ % sudo hdparm -I /dev/sda

/dev/sda:
SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

ATA device, with non-removable media
Standards:
Likely used: 1
Configuration:
Logical max current
cylinders 0 0
heads 0 0
sectors/track 0 0
--
Logical/Physical Sector size: 512 bytes
device size with M = 1024*1024: 0 MBytes
device size with M = 1000*1000: 0 MBytes
cache/buffer size = unknown
Capabilities:
IORDY not likely
Cannot perform double-word IO
R/W multiple sector transfer: not supported
DMA: not supported
PIO: pio0
')
On the Raspberry Pi3 I have no issues with the Seagate and the same command gives me:
$this->bbcode_second_pass_code('', '
thomas@pi3 ~ % sudo hdparm -I /dev/sda

/dev/sda:

ATA device, with non-removable media
Model Number: ST2000LM007-1R8174
Serial Number: WCC0KLRX
Firmware Revision: SBK2
Transport: Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
Used: unknown (minor revision code 0x001f)
Supported: 10 9 8 7 6 5
Likely used: 10
Configuration:
Logical max current
cylinders 16383 16383
heads 16 16
sectors/track 63 63
--
CHS current addressable sectors: 16514064
LBA user addressable sectors: 268435455
LBA48 user addressable sectors: 3907029168
Logical Sector size: 512 bytes
Physical Sector size: 4096 bytes
Logical Sector-0 offset: 0 bytes
device size with M = 1024*1024: 1907729 MBytes
device size with M = 1000*1000: 2000398 MBytes (2000 GB)
cache/buffer size = unknown
Form Factor: 2.5 inch
Nominal Media Rotation Rate: 5400
Capabilities:
LBA, IORDY(can be disabled)
Queue depth: 32
Standby timer values: spec'd by Standard, no device specific minimum
R/W multiple sector transfer: Max = 16 Current = 16
Advanced power management level: 128
Recommended acoustic management value: 208, current value: 208
DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6
Cycle time: min=120ns recommended=120ns
PIO: pio0 pio1 pio2 pio3 pio4
Cycle time: no flow control=120ns IORDY flow control=120ns
Commands/features:
Enabled Supported:
* SMART feature set
Security Mode feature set
* Power Management feature set
* Write cache
* Look-ahead
* Host Protected Area feature set
* WRITE_BUFFER command
* READ_BUFFER command
* NOP cmd
* DOWNLOAD_MICROCODE
* Advanced Power Management feature set
Power-Up In Standby feature set
* SET_FEATURES required to spinup after power up
SET_MAX security extension
* 48-bit Address feature set
* Device Configuration Overlay feature set
* Mandatory FLUSH_CACHE
* FLUSH_CACHE_EXT
* SMART error logging
* SMART self-test
* General Purpose Logging feature set
* WRITE_{DMA|MULTIPLE}_FUA_EXT
* 64-bit World wide name
Write-Read-Verify feature set
* WRITE_UNCORRECTABLE_EXT command
* {READ,WRITE}_DMA_EXT_GPL commands
* Segmented DOWNLOAD_MICROCODE
* Gen1 signaling speed (1.5Gb/s)
* Gen2 signaling speed (3.0Gb/s)
* Gen3 signaling speed (6.0Gb/s)
* Native Command Queueing (NCQ)
* Host-initiated interface power management
* Phy event counters
* READ_LOG_DMA_EXT equivalent to READ_LOG_EXT
DMA Setup Auto-Activate optimization
Device-initiated interface power management
* Software settings preservation
* SMART Command Transport (SCT) feature set
* SCT Write Same (AC2)
* SCT Features Control (AC4)
* SCT Data Tables (AC5)
unknown 206[12] (vendor specific)
unknown 206[13] (vendor specific)
* DOWNLOAD MICROCODE DMA command
Security:
Master password revision code = 65534
supported
not enabled
not locked
not frozen
not expired: security count
supported: enhanced erase
338min for SECURITY ERASE UNIT. 338min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 5000c5009b8ee9c4
NAA : 5
IEEE OUI : 000c50
Unique ID : 09b8ee9c4
Checksum: correct
')

Reading device info on the toshiba HDD on the odroid N2, however, works just fine:
$this->bbcode_second_pass_code('', '
thomas@n2 ~ % sudo hdparm -I /dev/sdb

/dev/sdb:

ATA device, with non-removable media
Model Number: TOSHIBA MQ01ABD100
Serial Number: 43IJSE35S
Firmware Revision: AX001U
Transport: Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6
Standards:
Supported: 8 7 6 5
Likely used: 8
Configuration:
Logical max current
cylinders 16383 16383
heads 16 16
sectors/track 63 63
--
CHS current addressable sectors: 16514064
LBA user addressable sectors: 268435455
LBA48 user addressable sectors: 1953525168
Logical Sector size: 512 bytes
Physical Sector size: 4096 bytes
Logical Sector-0 offset: 0 bytes
device size with M = 1024*1024: 953869 MBytes
device size with M = 1000*1000: 1000204 MBytes (1000 GB)
cache/buffer size = 8192 KBytes
Form Factor: 2.5 inch
Nominal Media Rotation Rate: 5400
Capabilities:
LBA, IORDY(can be disabled)
Queue depth: 32
Standby timer values: spec'd by Standard, no device specific minimum
R/W multiple sector transfer: Max = 16 Current = 16
Advanced power management level: 128
DMA: sdma0 sdma1 sdma2 mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5
Cycle time: min=120ns recommended=120ns
PIO: pio0 pio1 pio2 pio3 pio4
Cycle time: no flow control=120ns IORDY flow control=120ns
Commands/features:
Enabled Supported:
* SMART feature set
Security Mode feature set
* Power Management feature set
* Write cache
* Look-ahead
* Host Protected Area feature set
* WRITE_BUFFER command
* READ_BUFFER command
* NOP cmd
* DOWNLOAD_MICROCODE
* Advanced Power Management feature set
SET_MAX security extension
* 48-bit Address feature set
* Device Configuration Overlay feature set
* Mandatory FLUSH_CACHE
* FLUSH_CACHE_EXT
* SMART error logging
* SMART self-test
* General Purpose Logging feature set
* WRITE_{DMA|MULTIPLE}_FUA_EXT
* 64-bit World wide name
* IDLE_IMMEDIATE with UNLOAD
* WRITE_UNCORRECTABLE_EXT command
* {READ,WRITE}_DMA_EXT_GPL commands
* Segmented DOWNLOAD_MICROCODE
* Gen1 signaling speed (1.5Gb/s)
* Gen2 signaling speed (3.0Gb/s)
* Native Command Queueing (NCQ)
* Host-initiated interface power management
* Phy event counters
* Idle-Unload when NCQ is active
DMA Setup Auto-Activate optimization
Device-initiated interface power management
* Software settings preservation
* SMART Command Transport (SCT) feature set
* SCT Write Same (AC2)
* SCT Error Recovery Control (AC3)
* SCT Features Control (AC4)
* SCT Data Tables (AC5)
Security:
Master password revision code = 65534
supported
not enabled
not locked
not frozen
not expired: security count
supported: enhanced erase
216min for SECURITY ERASE UNIT. 216min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 50000394b5f0742a
NAA : 5
IEEE OUI : 000039
Unique ID : 4b5f0742a
Checksum: correct
')
Also, unmounting it works without hanging up the system.

I have a suspicion this may be a driver issue somewhere in the odroid-n2 stack.
--> Can anyone confirm this? Or let me know what to do in order to dig deeper into the root cause?

Thanks for any pointers or help.
-Thomas

For completeness sake, here's the output of lsblk with both HDD connected (Seagate is the 1.8 TB device):
$this->bbcode_second_pass_code('', '
thomas@n2 ~ % lsblk -o NAME,SIZE,TYPE,FSTYPE,STATE
NAME SIZE TYPE FSTYPE STATE
sda 1.8T disk btrfs running
sdb 931.5G disk running
└─sdb1 931.5G part ext4
')
Last edited by atmoos on Thu Jun 06, 2019 6:19 pm, edited 1 time in total.
atmoos
 
Posts: 3
Joined: Sun Jun 02, 2019 2:27 pm

Re: Odroid-N2: umount hangs & hdparm fails

Postby karog » Mon Jun 03, 2019 9:00 pm

It is probably because the n2 is running the UAS driver with the Seagate and that is not compatible. I ran into the same problem awhile back. Do the following:
$this->bbcode_second_pass_code('', '
$ lsusb
Bus 002 Device 004: ID 1058:25e2 Western Digital Technologies, Inc. My Passport (WD40NMZW)
Bus 002 Device 003: ID 0bc2:231a Seagate RSS LLC Expansion Portable
Bus 002 Device 002: ID 05e3:0620 Genesys Logic, Inc.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
$ lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
|__ Port 2: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
|__ Port 3: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
')

In the first lsusb command, find the Seagate and note the Bus, Device, and ID: Above it is Bus 002, Device 003, and ID 0bc2:231a.

In the second, lsusb -t find the Seagate by Bus and Device and note its Driver. Above it is under Bus 02, Port 1, Port 2 where you find Dev3 and see its Driver=usb-storage. Yours will most likely have Driver=uas. If not, then your problem is something else. But if yes, it is uas, this is the problem and you need to fix it to use usb-storage.

Now, how do you do that? You have to edit /boot/boot.ini. Find the line starting setenv bootargs. At the end of its value, inside the quote, space separated from the prior arg, add
$this->bbcode_second_pass_code('', 'usb-storage.quirks=<seagate ID>:u')
where <seagate ID> is replaced by the ID found in the lsusb above. For my case, that is:
$this->bbcode_second_pass_code('', 'usb-storage.quirks=0x0bc2:0x231a:u')

Then do:
$this->bbcode_second_pass_code('', 'mkinitcpio -p linux-odroid-n2')

If you don't have mkinitcpio, do:
$this->bbcode_second_pass_code('', 'pacman -S mkinitcpio')

Then reboot and do the lsusb -t again to see if the Driver=usb-storage.
karog
 
Posts: 301
Joined: Thu Jan 05, 2012 7:55 pm

Re: Odroid-N2: umount hangs & hdparm fails

Postby atmoos » Tue Jun 04, 2019 5:21 pm

Hi karog,

Thank you very much! I have a hunch that will solve my problem.

I don't have time to try it out just now. It'll sadly have to wait till Thursday...

If it works, I'll mark this thread as solved.

Many thanks so far!
- Thomas

PS: I do wonder why the N2 and the Raspi differ in behaviour though...
atmoos
 
Posts: 3
Joined: Sun Jun 02, 2019 2:27 pm

Re: Odroid-N2: umount hangs & hdparm fails

Postby karog » Tue Jun 04, 2019 8:15 pm

$this->bbcode_second_pass_quote('atmoos', 'H')i karog,
PS: I do wonder why the N2 and the Raspi differ in behaviour though...


Different boot loaders for different hardware would be my guess.

What I do not understand is why the Seagate does not support uas which has been around for years and is better.

I first ran into the problem on my odroid-xu4 where the fix is basically the same but additionally you have to do a makescr.

You might also want to reformat your Seagate after this assuming uas was the problem. No telling what state it left the drive in. It might seem ok at first but there could be hidden time bombs lurking, some screwup you just have not encountered yet.
karog
 
Posts: 301
Joined: Thu Jan 05, 2012 7:55 pm

Re: Odroid-N2: umount hangs & hdparm fails

Postby atmoos » Thu Jun 06, 2019 6:17 pm

As suspected, what you suggested doing did solve my problem :-)

I would never have figured that out myself. Thank you very much!!

Before setting "usb-storage.quirks":
$this->bbcode_second_pass_code('', '
thomas@n2 ~ % lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
|__ Port 2: Dev 4, If 0, Class=Mass Storage, Driver=uas, 5000M
')

Then, after setting it, building the image and rebooting:
$this->bbcode_second_pass_code('', '
thomas@n2 ~ % lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
|__ Port 2: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
')

And now I can use hdparm as expected. I'm still seeing issues when mounting or unmounting the HDD, but I can live with those for now. As you suggested, I'll reformat the Seagate and see if it then supports uas again.

My immediate problem has been solved now. And, more importantly, I know in which direction to continue.
Once again: Thank you!
atmoos
 
Posts: 3
Joined: Sun Jun 02, 2019 2:27 pm

Re: Odroid-N2: umount hangs & hdparm fails

Postby karog » Sat Jun 08, 2019 10:18 pm

$this->bbcode_second_pass_quote('atmoos', 'A')s you suggested, I'll reformat the Seagate and see if it then supports uas again.


I did NOT mean reformat and then try uas again. I meant that when you used uas and had problems, who knows in what way uas screwed up the format that might not be immediately apparent.

Reformat and stick with usb-storage as the driver.
karog
 
Posts: 301
Joined: Thu Jan 05, 2012 7:55 pm


Return to ARMv8 Devices

Who is online

Users browsing this forum: No registered users and 30 guests