ide-floppy: start DMA engine in idefloppy_transfer_pc1()
Start DMA engine and set PC_FLAG_DMA_IN_PROGRESS flag in idefloppy_transfer_pc1() instead of idefloppy_issue_pc() so the Status Register and the Interrupt Reason Register are checked first. Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
parent
5e33109582
commit
6ffb66410d
@ -534,6 +534,7 @@ static ide_startstop_t idefloppy_transfer_pc1(ide_drive_t *drive)
|
|||||||
{
|
{
|
||||||
ide_hwif_t *hwif = drive->hwif;
|
ide_hwif_t *hwif = drive->hwif;
|
||||||
idefloppy_floppy_t *floppy = drive->driver_data;
|
idefloppy_floppy_t *floppy = drive->driver_data;
|
||||||
|
struct ide_atapi_pc *pc = floppy->pc;
|
||||||
ide_expiry_t *expiry;
|
ide_expiry_t *expiry;
|
||||||
unsigned int timeout;
|
unsigned int timeout;
|
||||||
ide_startstop_t startstop;
|
ide_startstop_t startstop;
|
||||||
@ -568,6 +569,12 @@ static ide_startstop_t idefloppy_transfer_pc1(ide_drive_t *drive)
|
|||||||
|
|
||||||
ide_set_handler(drive, &idefloppy_pc_intr, timeout, expiry);
|
ide_set_handler(drive, &idefloppy_pc_intr, timeout, expiry);
|
||||||
|
|
||||||
|
/* Begin DMA, if necessary */
|
||||||
|
if (pc->flags & PC_FLAG_DMA_OK) {
|
||||||
|
pc->flags |= PC_FLAG_DMA_IN_PROGRESS;
|
||||||
|
hwif->dma_ops->dma_start(drive);
|
||||||
|
}
|
||||||
|
|
||||||
if ((floppy->flags & IDEFLOPPY_FLAG_ZIP_DRIVE) == 0)
|
if ((floppy->flags & IDEFLOPPY_FLAG_ZIP_DRIVE) == 0)
|
||||||
/* Send the actual packet */
|
/* Send the actual packet */
|
||||||
hwif->output_data(drive, NULL, floppy->pc->c, 12);
|
hwif->output_data(drive, NULL, floppy->pc->c, 12);
|
||||||
@ -633,13 +640,10 @@ static ide_startstop_t idefloppy_issue_pc(ide_drive_t *drive,
|
|||||||
if ((pc->flags & PC_FLAG_DMA_OK) && drive->using_dma)
|
if ((pc->flags & PC_FLAG_DMA_OK) && drive->using_dma)
|
||||||
dma = !hwif->dma_ops->dma_setup(drive);
|
dma = !hwif->dma_ops->dma_setup(drive);
|
||||||
|
|
||||||
ide_pktcmd_tf_load(drive, IDE_TFLAG_OUT_DEVICE, bcount, dma);
|
if (!dma)
|
||||||
|
pc->flags &= ~PC_FLAG_DMA_OK;
|
||||||
|
|
||||||
if (dma) {
|
ide_pktcmd_tf_load(drive, IDE_TFLAG_OUT_DEVICE, bcount, dma);
|
||||||
/* Begin DMA, if necessary */
|
|
||||||
pc->flags |= PC_FLAG_DMA_IN_PROGRESS;
|
|
||||||
hwif->dma_ops->dma_start(drive);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (floppy->flags & IDEFLOPPY_FLAG_DRQ_INTERRUPT) {
|
if (floppy->flags & IDEFLOPPY_FLAG_DRQ_INTERRUPT) {
|
||||||
/* Issue the packet command */
|
/* Issue the packet command */
|
||||||
|
Loading…
Reference in New Issue
Block a user