ATA exception Emask

From Thomas-Krenn-Wiki
Jump to navigation Jump to search

ATA exception Emask notifications of the Linux kernel can indicate different errors. This article provides an overview of what kind of errors these could be.

SATA exception

A SATA excerption line contains the following areas:

area area
Emask bit mask for error qualification (AC_ERR_xxx in source code)
SAct SATA SActive Register (bei Native Command Queuing). The SActive-directory is used to track the completion status of commands in the queue. This directory is part of the Serial-ATA-specification defined tax-, state- and error-superset-directory.[1][2]
SErr SATA SError Register
action ATA_EH_xxx-actions, such as revalidate, softreset, hardreset (see include/linux/libata.h)
frozen If present, indicates that the connection for SATA error handling (EH) has been frozen.

Emask

The Emask Hex-values have the following meaning: [3]

individual bits byte (in Hex) meaning
9 8 7 6 5 4 3 2 1 0 Emask details
AC_ERR_OK 0x0 no error example: SATA exception Emask 0x0 SAct 0x80 SErr 0x0 action 0x6 frozen
1 AC_ERR_DEV 0x1 device error Hardware indicates an error with last command. This error is delivered directly from the ATA device. If you see a lot of these, that is often an indication of a hardware problem.
1 AC_ERR_HSM 0x2 HSM violation Hardware failed to respond in an expected manner. "HSM" stands for Host State Machine, a software-based finite state machine required by ATA that expects certain hardware behaviors, based on the current ATA command and other hardware-state programming details.
1 AC_ERR_TIMEOUT 0x4 Timeout Controller failed to respond to an active ATA command. This could be any number of causes. Most often this is due to an unrelated interrupt subsystem bug (try booting with 'pci=nomsi' or 'acpi=off' or 'noapic'), which failed to deliver an interrupt when we were expecting one from the hardware.
1 AC_ERR_MEDIA 0x8 Media Error Software detected a media error
1 AC_ERR_HOST_BUS 0x10 ATA Bus Error chip<->device bus error

example: SATA exception Emask 0x10 SAct 0x0 SErr 0x4000000 action 0xe frozen

1 AC_ERR_SYSTEM 0x20 Host Bus Error Host<->chip bus error (i.e. PCI, if on PCI bus)
1 AC_ERR_INVALID 0x40 System Error / Internal Error Hardware flagged an impossible condition, most likely due to software misprogramming.
1 AC_ERR_OTHER 0x80 Invalid Argument Software marked ATA command as invalid, for some reason
1 AC_ERR_NODEV_HINT 0x100 Unknown Uncategorized error (should never happen)
1 AC_ERR_NCQ 0x200? Polling Device Detection Hint

Extract from the Linux kernel clude/linux/libata.h):[4]

enum ata_completion_errors {
	AC_ERR_OK		= 0,	    /* no error */
	AC_ERR_DEV		= (1 << 0), /* device reported error */
	AC_ERR_HSM		= (1 << 1), /* host state machine violation */
	AC_ERR_TIMEOUT		= (1 << 2), /* timeout */
	AC_ERR_MEDIA		= (1 << 3), /* media error */
	AC_ERR_ATA_BUS		= (1 << 4), /* ATA bus error */
	AC_ERR_HOST_BUS		= (1 << 5), /* host bus error */
	AC_ERR_SYSTEM		= (1 << 6), /* system error */
	AC_ERR_INVALID		= (1 << 7), /* invalid argument */
	AC_ERR_OTHER		= (1 << 8), /* unknown */
	AC_ERR_NODEV_HINT	= (1 << 9), /* polling device detection hint */
	AC_ERR_NCQ		= (1 << 10), /* marker for offending NCQ qc */

action

The action Hex-values have the following meaning:

individual bits byte (in Hex)
9 8 7 6 5 4 3 2 1 0
1 ATA_EH_REVALIDATE 0x1
1 ATA_EH_SOFTRESET 0x2
1 ATA_EH_HARDRESET 0x4
1 ATA_EH_ENABLE_LINK 0x8
1 ATA_EH_PARK 0x20

Extract from the Linux Kernel (include/linux/libata.h):[5]

	/* reset / recovery action types */
	ATA_EH_REVALIDATE	= (1 << 0),
	ATA_EH_SOFTRESET	= (1 << 1), /* meaningful only in ->prereset */
	ATA_EH_HARDRESET	= (1 << 2), /* meaningful only in ->prereset */
	ATA_EH_RESET		= ATA_EH_SOFTRESET | ATA_EH_HARDRESET,
	ATA_EH_ENABLE_LINK	= (1 << 3),
	ATA_EH_PARK		= (1 << 5), /* unload heads and stop I/O */

	ATA_EH_PERDEV_MASK	= ATA_EH_REVALIDATE | ATA_EH_PARK,
	ATA_EH_ALL_ACTIONS	= ATA_EH_REVALIDATE | ATA_EH_RESET |
				  ATA_EH_ENABLE_LINK,

References


Author: Werner Fischer

Werner Fischer, working in the Knowledge Transfer team at Thomas-Krenn, completed his studies of Computer and Media Security at FH Hagenberg in Austria. He is a regular speaker at many conferences like LinuxTag, OSMC, OSDC, LinuxCon, and author for various IT magazines. In his spare time he enjoys playing the piano and training for a good result at the annual Linz marathon relay.


Translator: Alina Ranzinger

Alina has been working at Thomas-Krenn.AG since 2024. After her training as multilingual business assistant, she got her job as assistant of the Product Management and is responsible for the translation of texts and for the organisation of the department.


Related articles

Cockpit Web Console
Predictable Network Interface Names
Rpm and dpkg commands