Skip to content

Commit f971a85

Browse files
rdoeffingerdamien-lemoal
authored andcommitted
libata: fix checking of DMA state
Checking if DMA is enabled should be done via the ata_dma_enabled helper function, since the init state 0xff indicates disabled. This meant that ATA_CMD_READ_LOG_DMA_EXT was used and probed for before DMA was enabled, which caused hangs for some combinations of controllers and devices. It might also have caused it to be incorrectly disabled as broken, but there have been no reports of that. Cc: [email protected] BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=195895 Signed-off-by: Reimar Döffinger <[email protected]> Tested-by: Paul Menzel <[email protected]> Signed-off-by: Damien Le Moal <[email protected]>
1 parent 8c0ff6a commit f971a85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/ata/libata-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2007,7 +2007,7 @@ unsigned int ata_read_log_page(struct ata_device *dev, u8 log,
20072007

20082008
retry:
20092009
ata_tf_init(dev, &tf);
2010-
if (dev->dma_mode && ata_id_has_read_log_dma_ext(dev->id) &&
2010+
if (ata_dma_enabled(dev) && ata_id_has_read_log_dma_ext(dev->id) &&
20112011
!(dev->horkage & ATA_HORKAGE_NO_DMA_LOG)) {
20122012
tf.command = ATA_CMD_READ_LOG_DMA_EXT;
20132013
tf.protocol = ATA_PROT_DMA;

0 commit comments

Comments
 (0)