[PATCH 13/63] ide-cd: fix DMA error handling in cdrom_newpc_intr()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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)

Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
---
 drivers/ide/ide-cd.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Index: b/drivers/ide/ide-cd.c
===================================================================
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1663,6 +1663,11 @@ static ide_startstop_t cdrom_newpc_intr(
 	if (dma) {
 		info->dma = 0;
 		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))
@@ -1672,11 +1677,8 @@ static ide_startstop_t cdrom_newpc_intr(
 	 * using dma, transfer is complete now
 	 */
 	if (dma) {
-		if (dma_error) {
-			printk(KERN_ERR "ide-cd: dma error\n");
-			ide_dma_off(drive);
+		if (dma_error)
 			return ide_error(drive, "dma error", stat);
-		}
 
 		end_that_request_chunk(rq, 1, rq->data_len);
 		rq->data_len = 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux