Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55d82bfa authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

ide-{floppy,scsi}: read Status Register before stopping DMA engine



Read Status Register before stopping DMA engine to match ide-tape
device driver - it should be safe and shouldn't affect anything.

This is a preparation for adding generic ide_pc_intr() helper.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent cdca5c1f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -399,6 +399,9 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive)

	debug_log("Enter %s - interrupt handler\n", __func__);

	/* Clear the interrupt */
	stat = ide_read_status(drive);

	if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
		dma_error = hwif->dma_ops->dma_end(drive);
		if (dma_error) {
@@ -412,9 +415,6 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive)
		debug_log("%s: DMA finished\n", drive->name);
	}

	/* Clear the interrupt */
	stat = ide_read_status(drive);

	/* No more interrupts */
	if ((stat & DRQ_STAT) == 0) {
		debug_log("Packet command completed, %d bytes transferred\n",
+4 −3
Original line number Diff line number Diff line
@@ -370,6 +370,10 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
		pc->callback(drive);
		return ide_stopped;
	}

	/* Clear the interrupt */
	stat = ide_read_status(drive);

	if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
		if (hwif->dma_ops->dma_end(drive))
			pc->flags |= PC_FLAG_DMA_ERROR;
@@ -378,9 +382,6 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
		debug_log("%s: DMA finished\n", drive->name);
	}

	/* Clear the interrupt */
	stat = ide_read_status(drive);

	if ((stat & DRQ_STAT) == 0) {
		/* No more interrupts */
		debug_log("Packet command completed, %d bytes transferred\n",