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

Commit 88b4132e authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

ide: set/clear drive->waiting_for_dma flag in the core code



Set/clear drive->waiting_for_dma flag in the core code
instead of in ->dma_setup and ->dma_end methods.

There should be no functional changes caused by this patch.

Acked-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 11998b31
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -290,7 +290,6 @@ static int auide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
	if (auide_build_dmatable(drive, cmd) == 0)
		return 1;

	drive->waiting_for_dma = 1;
	return 0;
}

@@ -315,16 +314,11 @@ static void auide_dma_host_set(ide_drive_t *drive, int on)

static void auide_ddma_tx_callback(int irq, void *param)
{
	_auide_hwif *ahwif = (_auide_hwif*)param;
	ahwif->drive->waiting_for_dma = 0;
}

static void auide_ddma_rx_callback(int irq, void *param)
{
	_auide_hwif *ahwif = (_auide_hwif*)param;
	ahwif->drive->waiting_for_dma = 0;
}

#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */

static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, u32 devwidth, u32 flags)
+0 −1
Original line number Diff line number Diff line
@@ -318,7 +318,6 @@ static int cmd646_1_dma_end(ide_drive_t *drive)
	ide_hwif_t *hwif = drive->hwif;
	u8 dma_stat = 0, dma_cmd = 0;

	drive->waiting_for_dma = 0;
	/* get DMA status */
	dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS);
	/* read DMA command state */
+0 −4
Original line number Diff line number Diff line
@@ -287,8 +287,6 @@ static int icside_dma_end(ide_drive_t *drive)
	ide_hwif_t *hwif = drive->hwif;
	struct expansion_card *ec = ECARD_DEV(hwif->dev);

	drive->waiting_for_dma = 0;

	disable_dma(ec->dma);

	return get_dma_residue(ec->dma) != 0;
@@ -343,8 +341,6 @@ static int icside_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
	set_dma_sg(ec->dma, hwif->sg_table, cmd->sg_nents);
	set_dma_mode(ec->dma, dma_mode);

	drive->waiting_for_dma = 1;

	return 0;
}

+3 −1
Original line number Diff line number Diff line
@@ -342,8 +342,10 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
	stat = tp_ops->read_status(hwif);

	if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
		int rc = hwif->dma_ops->dma_end(drive);
		int rc;

		drive->waiting_for_dma = 0;
		rc = hwif->dma_ops->dma_end(drive);
		ide_destroy_dmatable(drive);

		if (rc || (drive->media == ide_tape && (stat & ATA_ERR))) {
+1 −0
Original line number Diff line number Diff line
@@ -638,6 +638,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
	dma = drive->dma;
	if (dma) {
		drive->dma = 0;
		drive->waiting_for_dma = 0;
		dma_error = hwif->dma_ops->dma_end(drive);
		ide_destroy_dmatable(drive);
		if (dma_error) {
Loading