Skip to content

Commit 6ac586f

Browse files
rdoeffingerdamien-lemoal
authored andcommitted
libata-scsi: 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. Change based on code review, not tested due to lack of hardware. Signed-off-by: Reimar Döffinger <[email protected]> Signed-off-by: Damien Le Moal <[email protected]>
1 parent f971a85 commit 6ac586f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/ata/libata-scsi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2981,7 +2981,7 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
29812981
ata_qc_set_pc_nbytes(qc);
29822982

29832983
/* We may not issue DMA commands if no DMA mode is set */
2984-
if (tf->protocol == ATA_PROT_DMA && dev->dma_mode == 0) {
2984+
if (tf->protocol == ATA_PROT_DMA && !ata_dma_enabled(dev)) {
29852985
fp = 1;
29862986
goto invalid_fld;
29872987
}
@@ -3131,7 +3131,7 @@ static unsigned int ata_scsi_write_same_xlat(struct ata_queued_cmd *qc)
31313131
u8 unmap = cdb[1] & 0x8;
31323132

31333133
/* we may not issue DMA commands if no DMA mode is set */
3134-
if (unlikely(!dev->dma_mode))
3134+
if (unlikely(!ata_dma_enabled(dev)))
31353135
goto invalid_opcode;
31363136

31373137
/*

0 commit comments

Comments
 (0)