All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH 3/8] pdc202xx_new: use ide_tune_dma()
Date: Wed, 14 Feb 2007 02:56:16 +0100	[thread overview]
Message-ID: <20070214015616.4619.66530.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20070214015603.4619.41923.sendpatchset@localhost.localdomain>

[PATCH] pdc202xx_new: use ide_tune_dma()

* remove code enabling IORDY and prefetch from config_chipset_for_dma(),
  as the comment states it has no real effect because these settings are
  overriden when the PIO mode is set (and for this driver ->autotune == 1
  so PIO mode is always programmed)

* remove the check for drive->media != ide_disk from config_chipset_for_dma(),
  it is not needed because ide_max_dma_mode() returns 0 when ->atapi_dma == 0

* use ide_tune_dma() in pdcnew_config_drive_xfer_rate() and remove no longer
  needed config_chipset_for_dma()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

---
 drivers/ide/pci/pdc202xx_new.c |   32 +-------------------------------
 1 file changed, 1 insertion(+), 31 deletions(-)

Index: b/drivers/ide/pci/pdc202xx_new.c
===================================================================
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -228,41 +228,11 @@ static u8 pdcnew_cable_detect(ide_hwif_t
 	return get_indexed_reg(hwif, 0x0b) & 0x04;
 }
 
-static int config_chipset_for_dma(ide_drive_t *drive)
-{
-	struct hd_driveid *id	= drive->id;
-	ide_hwif_t *hwif	= HWIF(drive);
-	u8 speed;
-
-	if (drive->media != ide_disk)
-		return 0;
-
-	if (id->capability & 4) {
-		/*
-		 * Set IORDY_EN & PREFETCH_EN (this seems to have
-		 * NO real effect since this register is reloaded
-		 * by hardware when the transfer mode is selected)
-		 */
-		u8 tmp, adj = (drive->dn & 1) ? 0x08 : 0x00;
-
-		tmp = get_indexed_reg(hwif, 0x13 + adj);
-		set_indexed_reg(hwif, 0x13 + adj, tmp | 0x03);
-	}
-
-	speed = ide_max_dma_mode(drive);
-
-	if (!speed)
-		return 0;
-
-	(void) hwif->speedproc(drive, speed);
-	return ide_dma_enable(drive);
-}
-
 static int pdcnew_config_drive_xfer_rate(ide_drive_t *drive)
 {
 	drive->init_speed = 0;
 
-	if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+	if (ide_tune_dma(drive))
 		return 0;
 
 	if (ide_use_fast_pio(drive))

  parent reply	other threads:[~2007-02-14  1:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-14  1:56 [PATCH 1/8] alim15x3: PIO fallback fix Bartlomiej Zolnierkiewicz
2007-02-14  1:56 ` [PATCH 2/8] alim15x3: use ide_tune_dma() Bartlomiej Zolnierkiewicz
2007-02-14  1:56 ` Bartlomiej Zolnierkiewicz [this message]
2007-02-14  1:56 ` [PATCH 4/8] ide: remove some obsoleted kernel params Bartlomiej Zolnierkiewicz
2007-02-14  1:56 ` [PATCH 5/8] ide: add "initializing" argument to ide_register_hw() Bartlomiej Zolnierkiewicz
2007-02-14  1:57 ` [PATCH 6/8] ide: add ide_proc_register_port() Bartlomiej Zolnierkiewicz
2007-02-14  1:57 ` [PATCH 7/8] ide: make legacy IDE VLB modules check for the "probe" kernel params Bartlomiej Zolnierkiewicz
2007-02-14 10:53   ` Alan
2007-02-14 11:07     ` Bartlomiej Zolnierkiewicz
2007-02-14 11:17       ` Alan
2007-02-14 11:19         ` Bartlomiej Zolnierkiewicz
2007-02-14 19:52         ` [PATCH 7/8] ide: make legacy IDE VLB modules check for the "probe" kernel params (v2) Bartlomiej Zolnierkiewicz
2007-02-14  1:57 ` [PATCH 8/8] ide: fix ide.c Bartlomiej Zolnierkiewicz
2007-08-18 13:50 ` [PATCH 1/8] alim15x3: PIO fallback fix Sergei Shtylyov
2007-08-18 19:18   ` Bartlomiej Zolnierkiewicz
2007-08-18 19:26     ` Sergei Shtylyov
2007-11-09 16:58   ` Sergei Shtylyov

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=20070214015616.4619.66530.sendpatchset@localhost.localdomain \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.