libata: support concurrent positioning ranges log

Add support to discover if an ATA device supports the Concurrent
Positioning Ranges data log (address 0x47), indicating that the device
is capable of seeking to multiple different locations in parallel using
multiple actuators serving different LBA ranges.

Also add support to translate the concurrent positioning ranges log
into its equivalent Concurrent Positioning Ranges VPD page B9h in
libata-scsi.c.

The format of the Concurrent Positioning Ranges Log is defined in ACS-5
r9.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Link: https://lore.kernel.org/r/20211027022223.183838-4-damien.lemoal@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Damien Le Moal 2021-10-27 11:22:21 +09:00 committed by Jens Axboe
parent e815d36548
commit fe22e1c2f7
4 changed files with 110 additions and 11 deletions

View file

@ -676,6 +676,18 @@ struct ata_ering {
struct ata_ering_entry ring[ATA_ERING_SIZE];
};
struct ata_cpr {
u8 num;
u8 num_storage_elements;
u64 start_lba;
u64 num_lbas;
};
struct ata_cpr_log {
u8 nr_cpr;
struct ata_cpr cpr[];
};
struct ata_device {
struct ata_link *link;
unsigned int devno; /* 0 or 1 */
@ -735,6 +747,9 @@ struct ata_device {
u32 zac_zones_optimal_nonseq;
u32 zac_zones_max_open;
/* Concurrent positioning ranges */
struct ata_cpr_log *cpr_log;
/* error history */
int spdn_cnt;
/* ering is CLEAR_END, read comment above CLEAR_END */