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

Commit 9e772d01 authored by Borislav Petkov's avatar Borislav Petkov Committed by Bartlomiej Zolnierkiewicz
Browse files

ide-cd: fix DMA for non bio-backed requests

parent 27421e21
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -787,6 +787,9 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
		if (blk_fs_request(rq)) {
		if (blk_fs_request(rq)) {
			ide_end_request(drive, 1, rq->nr_sectors);
			ide_end_request(drive, 1, rq->nr_sectors);
			return ide_stopped;
			return ide_stopped;
		} else if (rq->cmd_type == REQ_TYPE_ATA_PC && !rq->bio) {
			ide_end_request(drive, 1, 1);
			return ide_stopped;
		}
		}
		goto end_request;
		goto end_request;
	}
	}
+6 −3
Original line number Original line Diff line number Diff line
@@ -418,11 +418,14 @@ void ide_map_sg(ide_drive_t *drive, struct request *rq)
	ide_hwif_t *hwif = drive->hwif;
	ide_hwif_t *hwif = drive->hwif;
	struct scatterlist *sg = hwif->sg_table;
	struct scatterlist *sg = hwif->sg_table;


	if (rq->cmd_type != REQ_TYPE_ATA_TASKFILE) {
	if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
		hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg);
	} else {
		sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE);
		sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE);
		hwif->sg_nents = 1;
		hwif->sg_nents = 1;
	} else if (!rq->bio) {
		sg_init_one(sg, rq->data, rq->data_len);
		hwif->sg_nents = 1;
	} else {
		hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg);
	}
	}
}
}