提交 6ac586f2 编写于 作者: R Reimar Döffinger 提交者: Damien Le Moal

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: NReimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: NDamien Le Moal <damien.lemoal@wdc.com>
上级 f971a854
...@@ -2981,7 +2981,7 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc) ...@@ -2981,7 +2981,7 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
ata_qc_set_pc_nbytes(qc); ata_qc_set_pc_nbytes(qc);
/* We may not issue DMA commands if no DMA mode is set */ /* We may not issue DMA commands if no DMA mode is set */
if (tf->protocol == ATA_PROT_DMA && dev->dma_mode == 0) { if (tf->protocol == ATA_PROT_DMA && !ata_dma_enabled(dev)) {
fp = 1; fp = 1;
goto invalid_fld; goto invalid_fld;
} }
...@@ -3131,7 +3131,7 @@ static unsigned int ata_scsi_write_same_xlat(struct ata_queued_cmd *qc) ...@@ -3131,7 +3131,7 @@ static unsigned int ata_scsi_write_same_xlat(struct ata_queued_cmd *qc)
u8 unmap = cdb[1] & 0x8; u8 unmap = cdb[1] & 0x8;
/* we may not issue DMA commands if no DMA mode is set */ /* we may not issue DMA commands if no DMA mode is set */
if (unlikely(!dev->dma_mode)) if (unlikely(!ata_dma_enabled(dev)))
goto invalid_opcode; goto invalid_opcode;
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册