diff options
| author | Damien Le Moal <dlemoal@kernel.org> | 2026-06-20 20:04:41 +0900 |
|---|---|---|
| committer | Damien Le Moal <dlemoal@kernel.org> | 2026-07-18 10:08:56 +0900 |
| commit | 4ba5eb54c2c8671f741a161b4f0d5162a4cb9b1b (patch) | |
| tree | 44787a44c7767b3a08476de532b563447523a357 /include/linux | |
| parent | 19598e92c8b76c77b1293eb58829cd27b1dd6d96 (diff) | |
ata: libata-core: detect support for depopulation capabilities
Introduce the device flags ATA_DFLAG_DEPOP to indicate support by a device
for the basic commands of the storage element depopulation feature set,
that is, the GET PHYSICAL ELEMENT STATUS and REMOVE ELEMENT AND TRUNCATE
commands. The device flag ATA_DFLAG_DEPOP_RESTORE flag is introduced to
indicate support for the RESTORE ELEMENTS AND REBUILD command. Both flags
are obtained from the command support bits of the qword at bytes 152 to
159 of the supported capabilities log page.
For ZAC devices, the device flag ATA_DFLAG_DEPOP_MODIFY is introduced to
indicate support for the REMOVE ELEMENT AND MODIFY ZONES command. This
support is indicated by the REMOVE ELEMENT AND MODIFY ZONES SUPPORTED bit
in the qword at byte 8 to 15 of the zoned device information log page.
The function ata_dev_config_depop() is introduced to set these flags
based on the content of the supported capabilities log and zoned device
information log. As per the ACS specifications, NCQ autosense support is
also mandatory if these flags are set.
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/libata.h | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 736ba8a6a77b..3703ef433bd4 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -139,30 +139,35 @@ enum { ATA_DFLAG_NCQ_SEND_RECV = (1UL << 11), /* device supports NCQ SEND and RECV */ ATA_DFLAG_NCQ_PRIO = (1UL << 12), /* device supports NCQ priority */ ATA_DFLAG_CDL = (1UL << 13), /* supports cmd duration limits */ - ATA_DFLAG_CFG_MASK = (1UL << 14) - 1, - - ATA_DFLAG_PIO = (1UL << 14), /* device limited to PIO mode */ - ATA_DFLAG_NCQ_OFF = (1UL << 15), /* device limited to non-NCQ mode */ - ATA_DFLAG_SLEEPING = (1UL << 16), /* device is sleeping */ - ATA_DFLAG_DUBIOUS_XFER = (1UL << 17), /* data transfer not verified */ - ATA_DFLAG_NO_UNLOAD = (1UL << 18), /* device doesn't support unload */ - ATA_DFLAG_UNLOCK_HPA = (1UL << 19), /* unlock HPA */ - ATA_DFLAG_INIT_MASK = (1UL << 20) - 1, - - ATA_DFLAG_NCQ_PRIO_ENABLED = (1UL << 20), /* Priority cmds sent to dev */ - ATA_DFLAG_CDL_ENABLED = (1UL << 21), /* cmd duration limits is enabled */ - ATA_DFLAG_RESUMING = (1UL << 22), /* Device is resuming */ - ATA_DFLAG_DETACH = (1UL << 24), - ATA_DFLAG_DETACHED = (1UL << 25), - ATA_DFLAG_DA = (1UL << 26), /* device supports Device Attention */ - ATA_DFLAG_DEVSLP = (1UL << 27), /* device supports Device Sleep */ - ATA_DFLAG_ACPI_DISABLED = (1UL << 28), /* ACPI for the device is disabled */ - ATA_DFLAG_D_SENSE = (1UL << 29), /* Descriptor sense requested */ + ATA_DFLAG_DEPOP = (1UL << 14), /* supports depopulation capability */ + ATA_DFLAG_DEPOP_RESTORE = (1UL << 15), /* supports depopulation restoration */ + ATA_DFLAG_DEPOP_MODIFY = (1UL << 16), /* supports zoned depopulation */ + ATA_DFLAG_CFG_MASK = (1UL << 17) - 1, + + ATA_DFLAG_PIO = (1UL << 17), /* device limited to PIO mode */ + ATA_DFLAG_NCQ_OFF = (1UL << 18), /* device limited to non-NCQ mode */ + ATA_DFLAG_SLEEPING = (1UL << 19), /* device is sleeping */ + ATA_DFLAG_DUBIOUS_XFER = (1UL << 20), /* data transfer not verified */ + ATA_DFLAG_NO_UNLOAD = (1UL << 21), /* device doesn't support unload */ + ATA_DFLAG_UNLOCK_HPA = (1UL << 22), /* unlock HPA */ + ATA_DFLAG_INIT_MASK = (1UL << 23) - 1, + + ATA_DFLAG_NCQ_PRIO_ENABLED = (1UL << 23), /* Priority cmds sent to dev */ + ATA_DFLAG_CDL_ENABLED = (1UL << 24), /* cmd duration limits is enabled */ + ATA_DFLAG_RESUMING = (1UL << 25), /* Device is resuming */ + ATA_DFLAG_DETACH = (1UL << 26), + ATA_DFLAG_DETACHED = (1UL << 27), + ATA_DFLAG_DA = (1UL << 28), /* device supports Device Attention */ + ATA_DFLAG_DEVSLP = (1UL << 29), /* device supports Device Sleep */ + ATA_DFLAG_ACPI_DISABLED = (1UL << 30), /* ACPI for the device is disabled */ + ATA_DFLAG_D_SENSE = (1UL << 31), /* Descriptor sense requested */ ATA_DFLAG_FEATURES_MASK = (ATA_DFLAG_TRUSTED | ATA_DFLAG_DA | \ ATA_DFLAG_DEVSLP | ATA_DFLAG_NCQ_SEND_RECV | \ ATA_DFLAG_NCQ_PRIO | ATA_DFLAG_FUA | \ - ATA_DFLAG_CDL) + ATA_DFLAG_CDL | ATA_DFLAG_DEPOP | \ + ATA_DFLAG_DEPOP_RESTORE | + ATA_DFLAG_DEPOP_MODIFY) }; enum { |
