Linux ATA/IDE development
 help / color / mirror / Atom feed
From: "Tobias Oed" <tobiasoed@hotmail.com>
To: B.Zolnierkiewicz@elka.pw.edu.pl, linux-ide@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: tobiasoed@hotmail.com, andre@linux-ide.org
Subject: [RFC] Get DMA to work for CD/DVD with pdc202xx_old
Date: Tue, 18 Apr 2006 09:15:53 -0400	[thread overview]
Message-ID: <BAY105-F111271D2374577E2FBCB9FA3C40@phx.gbl> (raw)

Hello,
I send something similar to linux-ide some weeks ago but got no reply.
This patch against 2.6.17-rc1-mm3 for pdc202xx_old.c allows me to
enable dma on my DVD and CD drives attached to my on board
pdc20265 ide controller. It works with udma modes only.
Tobias

--- pdc202xx_old.c.1    2006-04-18 13:12:47.000000000 +0200
+++ pdc202xx_old.c      2006-04-18 14:21:57.000000000 +0200
@@ -180,9 +180,11 @@
        u8                      AP, BP, CP, DP;
        u8                      TA = 0, TB = 0, TC = 0;

+       #if 0
        if ((drive->media != ide_disk) && (speed < XFER_SW_DMA_0))
                return -1;
-
+       #endif
+
        pci_read_config_dword(dev, drive_pci, &drive_conf);
        pci_read_config_byte(dev, (drive_pci), &AP);
        pci_read_config_byte(dev, (drive_pci)|0x01, &BP);
@@ -356,14 +358,12 @@

chipset_is_set:

-       if (drive->media == ide_disk) {
-               pci_read_config_byte(dev, (drive_pci), &AP);
-               if (id->capability & 4) /* IORDY_EN */
-                       pci_write_config_byte(dev, (drive_pci), 
AP|IORDY_EN);
-               pci_read_config_byte(dev, (drive_pci), &AP);
-               if (drive->media == ide_disk)   /* PREFETCH_EN */
-                       pci_write_config_byte(dev, (drive_pci), 
AP|PREFETCH_EN);
-       }
+       pci_read_config_byte(dev, (drive_pci), &AP);
+       if (id->capability & 4) /* IORDY_EN */
+               pci_write_config_byte(dev, (drive_pci), AP|IORDY_EN);
+       pci_read_config_byte(dev, (drive_pci), &AP);
+       if (drive->media == ide_disk)   /* PREFETCH_EN */
+               pci_write_config_byte(dev, (drive_pci), AP|PREFETCH_EN);

        speed = ide_dma_speed(drive, pdc202xx_ratemask(drive));

@@ -411,7 +411,7 @@
{
        if (drive->current_speed > XFER_UDMA_2)
                pdc_old_enable_66MHz_clock(drive->hwif);
-       if (drive->addressing == 1) {
+       if (drive->media != ide_disk || drive->addressing == 1) {
                struct request *rq      = HWGROUP(drive)->rq;
                ide_hwif_t *hwif        = HWIF(drive);
//             struct pci_dev *dev     = hwif->pci_dev;
@@ -433,7 +433,7 @@

static int pdc202xx_old_ide_dma_end(ide_drive_t *drive)
{
-       if (drive->addressing == 1) {
+       if (drive->media != ide_disk || drive->addressing == 1) {
                ide_hwif_t *hwif        = HWIF(drive);
//             unsigned long high_16   = pci_resource_start(hwif->pci_dev, 
4);
                unsigned long high_16   = hwif->dma_master;
@@ -635,6 +635,7 @@
        hwif->ultra_mask = 0x3f;
        hwif->mwdma_mask = 0x07;
        hwif->swdma_mask = 0x07;
+        hwif->atapi_dma = 1;

        hwif->ide_dma_check = &pdc202xx_config_drive_xfer_rate;
        hwif->ide_dma_lostirq = &pdc202xx_ide_dma_lostirq;

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfee® 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


             reply	other threads:[~2006-04-18 13:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-18 13:15 Tobias Oed [this message]
2006-04-18 14:05 ` [RFC] Get DMA to work for CD/DVD with pdc202xx_old Alan Cox
2006-04-18 21:08   ` Tobias Oed

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=BAY105-F111271D2374577E2FBCB9FA3C40@phx.gbl \
    --to=tobiasoed@hotmail.com \
    --cc=B.Zolnierkiewicz@elka.pw.edu.pl \
    --cc=andre@linux-ide.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@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