ata: libata-core: Fix ata_dev_config_cpr()
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Mon, 7 Feb 2022 02:27:53 +0000 (11:27 +0900)
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>
Mon, 7 Feb 2022 13:38:02 +0000 (22:38 +0900)
commitfda17afc6166e975bec1197bd94cd2a3317bce3f
tree408c7ad61cdbf1fdde5103c52734e30c95430a3b
parentdfd42facf1e4ada021b939b4e19c935dcdd55566
ata: libata-core: Fix ata_dev_config_cpr()

The concurrent positioning ranges log page 47h is a general purpose log
page and not a subpage of the indentify device log. Using
ata_identify_page_supported() to test for concurrent positioning ranges
support is thus wrong. ata_log_supported() must be used.

Furthermore, unlike other advanced ATA features (e.g. NCQ priority),
accesses to the concurrent positioning ranges log page are not gated by
a feature bit from the device IDENTIFY data. Since many older drives
react badly to the READ LOG EXT and/or READ LOG DMA EXT commands isued
to read device log pages, avoid problems with older drives by limiting
the concurrent positioning ranges support detection to drives
implementing at least the ACS-4 ATA standard (major version 11). This
additional condition effectively turns ata_dev_config_cpr() into a nop
for older drives, avoiding problems in the field.

Fixes: fe22e1c2f705 ("libata: support concurrent positioning ranges log")
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215519
Cc: stable@vger.kernel.org
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Abderraouf Adjal <adjal.arf@gmail.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
drivers/ata/libata-core.c
include/linux/ata.h