Opened 10 months ago

Closed 5 months ago

#1441 closed defect (fixed)

smartctl exit status 4 if SAT layer ignores CK_COND

Reported by: TuxoHolic Owned by: Christian Franke
Priority: minor Milestone: Release 7.3
Component: smartctl Version: 7.2
Keywords: ata Cc:

Description

Hello I use a Salcar EHCI "toaster" device with ID_VENDOR_ID=154b and ID_MODEL_ID=8001

smartctl -d sat -H shows "Passed" with bit2 exit status (attached) on a used but healthy 500GB Samsung sata device.

smartctl -d sat -x shows most of the expected attributes but quits with bit2 exit status as well (attached)

udevadm test /dev/sda attached as well

Attachments (4)

smartctlx.txt (10.5 KB) - added by TuxoHolic 10 months ago.
smart
smartctlh.txt (383 bytes) - added by TuxoHolic 10 months ago.
smartctl Healt check
udevadm.txt (5.1 KB) - added by TuxoHolic 10 months ago.
udevadm test sda
smartctlr.txt (12.5 KB) - added by TuxoHolic 10 months ago.
smartctl -r

Download all attachments as: .zip

Change History (12)

Changed 10 months ago by TuxoHolic

Attachment: smartctlx.txt added

smart

Changed 10 months ago by TuxoHolic

Attachment: smartctlh.txt added

smartctl Healt check

Changed 10 months ago by TuxoHolic

Attachment: udevadm.txt added

udevadm test sda

comment:1 Changed 10 months ago by Christian Franke

Component: allsmartctl
Keywords: ata added
Milestone: undecided
=== START OF READ SMART DATA SECTION ===
SMART Status not supported: Incomplete response, ATA output registers missing

This means that the SMART RETURN STATUS command itself failed. This does not necessarily indicate a failed device. If any command fails unexpectedly, smartctl sets bit 2 of its exit status.

The problem likely occurs due to a buggy SAT layer in the USB bridge.

If the SMART RETURN STATUS status succeeds and the device reports a FAILED status, bit 3 of the smartctl exit status would be set instead (see man page).

If the SMART RETURN STATUS does not work, smartctl checks for failed attributes:

SMART overall-health self-assessment test result: PASSED
Warning: This result is based on an Attribute check.

If this check would find failed attributes, bit 3 would also be set.

PS: "0x154b:0x8001 works with -d sat" added to drive database TODO list.

comment:2 Changed 10 months ago by TuxoHolic

Can you explain what can be done to handle the issue? I tried both uas quirk variants and they don't show a positive effect.

It feels like "-d sat" implementation already is 99% working fine, but one tiny detail is not responding as expected. Tell me if I can help to debug this further and get rid of the issue. I know the drive is healthy with exit code 0 when it is attached to a mainboard sata bridge.

comment:3 Changed 10 months ago by Christian Franke

Please provide output of smartctl -r ioctl,2 -H /dev/...? as an attachment.

Changed 10 months ago by TuxoHolic

Attachment: smartctlr.txt added

smartctl -r

comment:4 Changed 10 months ago by Christian Franke

Summary: status 4 using uas device with usb id 154b:8001smartctl exit status 4 if SAT layer ignores CK_COND
REPORT-IOCTL: Device=/dev/sda Command=SMART STATUS CHECK
Input:   FR=0xda, SC=...., LL=...., LM=0x4f, LH=0xc2, DEV=...., CMD=0xb0
>>>> do_scsi_cmnd_io: sg_io_ver=3
 [ata pass-through(16): 85 06 2c 00 da 00 00 00 00 00 4f 00 c2 00 b0 00 ]
  scsi_status=0x0, sg_transport_status=0x0, sg_driver_status=0x0
  sg_info=0x0  sg_duration=0 milliseconds  resid=0
REPORT-IOCTL: Device=/dev/sda Command=SMART STATUS CHECK returned -1 errno=38 [Incomplete response, ATA output registers missing]

SAT layer of USB bridge ignores CK_COND bit and does not return SCSI ATA RETURN DESCRIPTOR. Needs to be fixed in firmware of the USB bridge.

Workaround for now: Ignore bit 2 of smartctl exit status as an actual FAILED status would be reported in bit 3.

Perhaps there is a heuristic to better handle such cases without breaking others. Leaving ticket open as undecided for now.

comment:5 Changed 10 months ago by TuxoHolic

Okay, as for filing new quirks: I forget to mention this Salcar bridge uses Jmicron JMS561U.

comment:6 Changed 5 months ago by Christian Franke

Related or duplicate: GH issues/98.

comment:7 Changed 5 months ago by Christian Franke

Milestone: undecidedRelease 7.3
Owner: set to Christian Franke
Status: newaccepted

comment:8 Changed 5 months ago by Christian Franke

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.