linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ide-atapi: use drive->waiting_for_dma
@ 2008-08-24  7:01 Borislav Petkov
  2008-08-24 11:41 ` Sergei Shtylyov
  0 siblings, 1 reply; 2+ messages in thread
From: Borislav Petkov @ 2008-08-24  7:01 UTC (permalink / raw)
  To: bzolnier; +Cc: linux-ide, linux-kernel

From: Borislav Petkov <petkovbb@gmail.com>
Date: Sun, 24 Aug 2008 08:57:57 +0200
Subject: [PATCH] ide-atapi: use drive->waiting_for_dma

.. and remove PC_FLAG_DMA_IN_PROGRESS. There should
be no functionality change resulting from this patch.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
 drivers/ide/ide-atapi.c |   10 +++++-----
 include/linux/ide.h     |    7 +++----
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index a1d8c35..09ac062 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -282,7 +282,7 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
 	/* Clear the interrupt */
 	stat = tp_ops->read_status(hwif);
 
-	if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
+	if (drive->waiting_for_dma) {
 		if (hwif->dma_ops->dma_end(drive) ||
 		    (drive->media == ide_tape && !scsi && (stat & ATA_ERR))) {
 			if (drive->media == ide_floppy && !scsi)
@@ -303,7 +303,7 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
 		debug_log("Packet command completed, %d bytes transferred\n",
 			  pc->xferred);
 
-		pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
+		drive->waiting_for_dma = 0;
 
 		local_irq_enable_in_hardirq();
 
@@ -347,8 +347,8 @@ cmd_finished:
 		return ide_stopped;
 	}
 
-	if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
-		pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
+	if (drive->waiting_for_dma) {
+		drive->waiting_for_dma = 0;
 		printk(KERN_ERR "%s: The device wants to issue more interrupts "
 				"in DMA mode\n", drive->name);
 		ide_dma_off(drive);
@@ -528,7 +528,7 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
 
 	/* Begin DMA, if necessary */
 	if (pc->flags & PC_FLAG_DMA_OK) {
-		pc->flags |= PC_FLAG_DMA_IN_PROGRESS;
+		drive->waiting_for_dma = 1;
 		hwif->dma_ops->dma_start(drive);
 	}
 
diff --git a/include/linux/ide.h b/include/linux/ide.h
index e3ccec2..1268e71 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -393,11 +393,10 @@ enum {
 	PC_FLAG_SUPPRESS_ERROR		= (1 << 1),
 	PC_FLAG_WAIT_FOR_DSC		= (1 << 2),
 	PC_FLAG_DMA_OK			= (1 << 3),
-	PC_FLAG_DMA_IN_PROGRESS		= (1 << 4),
-	PC_FLAG_DMA_ERROR		= (1 << 5),
-	PC_FLAG_WRITING			= (1 << 6),
+	PC_FLAG_DMA_ERROR		= (1 << 4),
+	PC_FLAG_WRITING			= (1 << 5),
 	/* command timed out */
-	PC_FLAG_TIMEDOUT		= (1 << 7),
+	PC_FLAG_TIMEDOUT		= (1 << 6),
 };
 
 /*
-- 
1.5.5.4

-- 
Regards/Gruss,
    Boris.

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ide-atapi: use drive->waiting_for_dma
  2008-08-24  7:01 [PATCH] ide-atapi: use drive->waiting_for_dma Borislav Petkov
@ 2008-08-24 11:41 ` Sergei Shtylyov
  0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2008-08-24 11:41 UTC (permalink / raw)
  To: petkovbb, bzolnier, linux-ide, linux-kernel

Hello.

Borislav Petkov wrote:

> .. and remove PC_FLAG_DMA_IN_PROGRESS. There should
> be no functionality change resulting from this patch.
>
> Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
>   

   Unfortunately, this 'patch doesnt look right...

> diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
> index a1d8c35..09ac062 100644
> --- a/drivers/ide/ide-atapi.c
> +++ b/drivers/ide/ide-atapi.c
>   
[...]
> @@ -303,7 +303,7 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
>  		debug_log("Packet command completed, %d bytes transferred\n",
>  			  pc->xferred);
>  
> -		pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
> +		drive->waiting_for_dma = 0;
>   

   Must've been already cleared by the dma_end() method called from this 
function.

> @@ -347,8 +347,8 @@ cmd_finished:
>  		return ide_stopped;
>  	}
>  
> -	if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
> -		pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
> +	if (drive->waiting_for_dma) {
> +		drive->waiting_for_dma = 0;
>   

   Same here...

> @@ -528,7 +528,7 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
>  
>  	/* Begin DMA, if necessary */
>  	if (pc->flags & PC_FLAG_DMA_OK) {
> -		pc->flags |= PC_FLAG_DMA_IN_PROGRESS;
> +		drive->waiting_for_dma = 1;
>   

   This flag must've been already set by the dma_setup() method called 
from ide_issue_pc().

MBR, Sergei



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-24 11:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-24  7:01 [PATCH] ide-atapi: use drive->waiting_for_dma Borislav Petkov
2008-08-24 11:41 ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).