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

Commit eba15fba authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

ide-cd: fix DMA error handling in cdrom_newpc_intr()



Make cdrom_newpc_intr() match cdrom_{read,write}_intr() w.r.t.
handling DMA errors:

* disable DMA before cdrom_decode_status() call

* log the device name and the type of the request (read/write)

Acked-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent f1071e62
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -1674,6 +1674,11 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
	if (dma) {
	if (dma) {
		info->dma = 0;
		info->dma = 0;
		dma_error = HWIF(drive)->ide_dma_end(drive);
		dma_error = HWIF(drive)->ide_dma_end(drive);
		if (dma_error) {
			printk(KERN_ERR "%s: DMA %s error\n", drive->name,
					rq_data_dir(rq) ? "write" : "read");
			ide_dma_off(drive);
		}
	}
	}


	if (cdrom_decode_status(drive, 0, &stat))
	if (cdrom_decode_status(drive, 0, &stat))
@@ -1683,11 +1688,8 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
	 * using dma, transfer is complete now
	 * using dma, transfer is complete now
	 */
	 */
	if (dma) {
	if (dma) {
		if (dma_error) {
		if (dma_error)
			printk(KERN_ERR "ide-cd: dma error\n");
			ide_dma_off(drive);
			return ide_error(drive, "dma error", stat);
			return ide_error(drive, "dma error", stat);
		}


		spin_lock_irqsave(&ide_lock, flags);
		spin_lock_irqsave(&ide_lock, flags);
		if (__blk_end_request(rq, 0, rq->data_len))
		if (__blk_end_request(rq, 0, rq->data_len))