linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Subject: [PATCH 12/13] ide: move drive->using_dma check to callers of ->dma_host_on method
Date: Tue, 13 Nov 2007 00:02:20 +0100	[thread overview]
Message-ID: <200711130002.20962.bzolnier@gmail.com> (raw)


Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/ide-dma.c    |    2 +-
 drivers/ide/ide-iops.c   |    3 ++-
 drivers/ide/pci/cs5520.c |    3 +--
 drivers/ide/pci/sc1200.c |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

Index: b/drivers/ide/ide-dma.c
===================================================================
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -470,7 +470,7 @@ EXPORT_SYMBOL(ide_dma_off);
 
 void ide_dma_host_on(ide_drive_t *drive)
 {
-	if (drive->using_dma) {
+	if (1) {
 		ide_hwif_t *hwif	= HWIF(drive);
 		u8 unit			= (drive->select.b.unit & 0x01);
 		u8 dma_stat		= hwif->INB(hwif->dma_status);
Index: b/drivers/ide/ide-iops.c
===================================================================
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -791,7 +791,8 @@ int ide_config_drive_speed(ide_drive_t *
 	drive->id->dma_1word &= ~0x0F00;
 
 #ifdef CONFIG_BLK_DEV_IDEDMA
-	if (speed >= XFER_SW_DMA_0 || (hwif->host_flags & IDE_HFLAG_VDMA))
+	if ((speed >= XFER_SW_DMA_0 || (hwif->host_flags & IDE_HFLAG_VDMA)) &&
+	    drive->using_dma)
 		hwif->dma_host_on(drive);
 	else if (hwif->dma_host_on)	/* check if host supports DMA */
 		ide_dma_off_quietly(drive);
Index: b/drivers/ide/pci/cs5520.c
===================================================================
--- a/drivers/ide/pci/cs5520.c
+++ b/drivers/ide/pci/cs5520.c
@@ -109,8 +109,7 @@ static void cs5520_set_dma_mode(ide_driv
 
 static void cs5520_dma_host_on(ide_drive_t *drive)
 {
-	if (drive->using_dma)
-		drive->vdma = 1;
+	drive->vdma = 1;
 
 	ide_dma_host_on(drive);
 }
Index: b/drivers/ide/pci/sc1200.c
===================================================================
--- a/drivers/ide/pci/sc1200.c
+++ b/drivers/ide/pci/sc1200.c
@@ -221,7 +221,7 @@ static void sc1200_set_pio_mode(ide_driv
 	if (mode != -1) {
 		printk("SC1200: %s: changing (U)DMA mode\n", drive->name);
 		ide_dma_off_quietly(drive);
-		if (ide_set_dma_mode(drive, mode) == 0)
+		if (ide_set_dma_mode(drive, mode) == 0 && drive->using_dma)
 			hwif->dma_host_on(drive);
 		return;
 	}

             reply	other threads:[~2007-11-12 22:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-12 23:02 Bartlomiej Zolnierkiewicz [this message]
2007-11-13 11:23 ` [PATCH 12/13] ide: move drive->using_dma check to callers of ->dma_host_on method Sergei Shtylyov
2007-11-13 21:27   ` Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200711130002.20962.bzolnier@gmail.com \
    --to=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).