Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jul 2006 08:41:46 GMT
From:      Karsten Brandt <spam_schlucker@web.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/100428: no WDMA mode available for ATAPI drives
Message-ID:  <200607170841.k6H8fkd3075644@www.freebsd.org>
Resent-Message-ID: <200607170850.k6H8oIIn058972@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         100428
>Category:       kern
>Synopsis:       no WDMA mode available for ATAPI drives
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 17 08:50:17 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Karsten Brandt
>Release:        FreeBSD 6.1-STABLE
>Organization:
>Environment:
FreeBSD Pegasus.mai.de.internal 6.1-STABLE FreeBSD 6.1-STABLE #67: Mon Jul 17 07:43:10 UTC 2006     root@Pegasus.mai.de.internal:/usr/obj/usr/src/sys/PEGASUS  i386
>Description:
I've tested video playback with vlc and ogle on my machine.
But all what I could see was a spluttered video output.
Therefore I've searched the reason for that.
After some hours I've found the reason in the ATA source.

For ATAPI devices is the WDMA mode unused. After this correction the video playback runs without spluttering.

Now I've created a patch for this problem and I'v added this to the Fix section.

This patch is build for the following file in the source tree:

/usr/src/dev/ata/ata-all.c

The __FBSDID of the original source file is:

__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.252.2.9 2006/04/04 16:07:42 sos Exp $"); 

The changes are:
----------------

- use of WDMA-Modes for ATAPI-Devices in the ata_getparam() function
- remove magic numbers in the ata_getparam() function

>How-To-Repeat:
Play video DVD's on an ATAPI drive, which only have WDMA support.
>Fix:
*** /usr/src_org/sys/dev/ata/ata-all.c	Fri Jul 14 08:30:53 2006
--- /usr/src/sys/dev/ata/ata-all.c	Mon Jul 17 06:53:06 2006
***************
*** 640,655 ****
  	    sprintf(buffer, "%.40s/%.8s", atacap->model, atacap->revision);
  	    device_set_desc_copy(atadev->dev, buffer);
  	    if (atadev->param.config & ATA_PROTO_ATAPI) {
! 		if (atapi_dma && ch->dma &&
! 		    (atadev->param.config & ATA_DRQ_MASK) != ATA_DRQ_INTR &&
! 		    ata_umode(&atadev->param) >= ATA_UDMA2)
! 		    atadev->mode = ATA_DMA_MAX;
  	    }
  	    else {
  		if (ata_dma && ch->dma &&
! 		    (ata_umode(&atadev->param) > 0 ||
! 		     ata_wmode(&atadev->param) > 0))
  		    atadev->mode = ATA_DMA_MAX;
  	    }
  	}
      }
--- 640,661 ----
  	    sprintf(buffer, "%.40s/%.8s", atacap->model, atacap->revision);
  	    device_set_desc_copy(atadev->dev, buffer);
  	    if (atadev->param.config & ATA_PROTO_ATAPI) {
! 		if( atapi_dma && ch->dma && (atadev->param.config & ATA_DRQ_MASK) != ATA_DRQ_INTR ){
! 		    if( ( ata_umode(&atadev->param) < ATA_UDMA0 &&
! 			  ata_wmode(&atadev->param) >= ATA_WDMA0 ) ||
! 			( ata_umode(&atadev->param) >= ATA_UDMA2 ) )
! 		    {
! 		    	atadev->mode = ATA_DMA_MAX;
! 		    }
! 		}
  	    }
  	    else {
  		if (ata_dma && ch->dma &&
! 		    (ata_umode(&atadev->param) >= ATA_UDMA0 ||
! 		     ata_wmode(&atadev->param) >= ATA_WDMA0))
! 		{
  		    atadev->mode = ATA_DMA_MAX;
+ 		}
  	    }
  	}
      }

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607170841.k6H8fkd3075644>