Linux ATA/IDE development
 help / color / mirror / Atom feed
* [RFC] Get DMA to work for CD/DVD with pdc202xx_old
@ 2006-04-18 13:15 Tobias Oed
  2006-04-18 14:05 ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Tobias Oed @ 2006-04-18 13:15 UTC (permalink / raw)
  To: B.Zolnierkiewicz, linux-ide, linux-kernel; +Cc: tobiasoed, andre

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


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

* Re: [RFC] Get DMA to work for CD/DVD with pdc202xx_old
  2006-04-18 13:15 [RFC] Get DMA to work for CD/DVD with pdc202xx_old Tobias Oed
@ 2006-04-18 14:05 ` Alan Cox
  2006-04-18 21:08   ` Tobias Oed
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2006-04-18 14:05 UTC (permalink / raw)
  To: Tobias Oed; +Cc: B.Zolnierkiewicz, linux-ide, linux-kernel, andre

On Maw, 2006-04-18 at 09:15 -0400, Tobias Oed wrote:
> +       #if 0
>         if ((drive->media != ide_disk) && (speed < XFER_SW_DMA_0))
>                 return -1;
> -
> +       #endif
> +

This change looks unrelated to anything you are trying to do. Rest looks
sane enough


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

* Re: [RFC] Get DMA to work for CD/DVD with pdc202xx_old
  2006-04-18 14:05 ` Alan Cox
@ 2006-04-18 21:08   ` Tobias Oed
  0 siblings, 0 replies; 3+ messages in thread
From: Tobias Oed @ 2006-04-18 21:08 UTC (permalink / raw)
  To: alan; +Cc: B.Zolnierkiewicz, linux-ide, linux-kernel, andre




>From: Alan Cox <alan@lxorguk.ukuu.org.uk>
>
>On Maw, 2006-04-18 at 09:15 -0400, Tobias Oed wrote:
> > +       #if 0
> >         if ((drive->media != ide_disk) && (speed < XFER_SW_DMA_0))
> >                 return -1;
> > -
> > +       #endif
> > +
>
>This change looks unrelated to anything you are trying to do. Rest looks
>sane enough

Thing is, without it my machine hangs on boot, while talking to hde (cd
drive). Not sure why exactly.
Tobias

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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

end of thread, other threads:[~2006-04-18 21:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-18 13:15 [RFC] Get DMA to work for CD/DVD with pdc202xx_old Tobias Oed
2006-04-18 14:05 ` Alan Cox
2006-04-18 21:08   ` Tobias Oed

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox