Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libata: Cleanup ata_read_log_page()

The warning message "READ LOG DMA EXT failed, trying unqueued" in
ata_read_log_page() as well as the macro name ATA_HORKAGE_NO_NCQ_LOG
are confusing: the command READ LOG DMA EXT is not an queued NCQ command
unless it is encapsulated in a RECEIVE FPDMA QUEUED command.
From ACS-4 READ LOG DMA EXT description:

"The device processes the READ LOG DMA EXT command in the NCQ feature
set environment (see 4.13.6) if the READ LOG DMA EXT command is
encapsulated in a RECEIVE FPDMA QUEUED command (see 7.30) with the
inputs encapsulated as shown in 7.23.6."

To avoid confusion, fix the warning messsage to mention switching to PIO and
not "unqueued" and rename the macro ATA_HORKAGE_NO_NCQ_LOG to
ATA_HORKAGE_NO_DMA_LOG.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Damien Le Moal and committed by
Tejun Heo
7cfdfdc8 accd0473

+4 -4
+3 -3
drivers/ata/libata-core.c
··· 2083 2083 retry: 2084 2084 ata_tf_init(dev, &tf); 2085 2085 if (dev->dma_mode && ata_id_has_read_log_dma_ext(dev->id) && 2086 - !(dev->horkage & ATA_HORKAGE_NO_NCQ_LOG)) { 2086 + !(dev->horkage & ATA_HORKAGE_NO_DMA_LOG)) { 2087 2087 tf.command = ATA_CMD_READ_LOG_DMA_EXT; 2088 2088 tf.protocol = ATA_PROT_DMA; 2089 2089 dma = true; ··· 2102 2102 buf, sectors * ATA_SECT_SIZE, 0); 2103 2103 2104 2104 if (err_mask && dma) { 2105 - dev->horkage |= ATA_HORKAGE_NO_NCQ_LOG; 2106 - ata_dev_warn(dev, "READ LOG DMA EXT failed, trying unqueued\n"); 2105 + dev->horkage |= ATA_HORKAGE_NO_DMA_LOG; 2106 + ata_dev_warn(dev, "READ LOG DMA EXT failed, trying PIO\n"); 2107 2107 goto retry; 2108 2108 } 2109 2109
+1 -1
include/linux/libata.h
··· 435 435 ATA_HORKAGE_NOLPM = (1 << 20), /* don't use LPM */ 436 436 ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21), /* some WDs have broken LPM */ 437 437 ATA_HORKAGE_ZERO_AFTER_TRIM = (1 << 22),/* guarantees zero after trim */ 438 - ATA_HORKAGE_NO_NCQ_LOG = (1 << 23), /* don't use NCQ for log read */ 438 + ATA_HORKAGE_NO_DMA_LOG = (1 << 23), /* don't use DMA for log read */ 439 439 ATA_HORKAGE_NOTRIM = (1 << 24), /* don't use TRIM */ 440 440 ATA_HORKAGE_MAX_SEC_1024 = (1 << 25), /* Limit max sects to 1024 */ 441 441