misc/123887: PDC20262 does not support 48 bit DMA access

J. Su minichocobo at gmail.com
Thu May 22 07:10:02 UTC 2008


>Number:         123887
>Category:       misc
>Synopsis:       PDC20262 does not support 48 bit DMA access
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 22 07:10:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     J. Su
>Release:        6.3-RELEASE
>Organization:
>Environment:
FreeBSD rasputin.eecs.harvard.edu 6.3-RELEASE-p2 FreeBSD 6.3-RELEASE-p2 #2: Thu May 22 00:30:06 EDT 2008 root at somewhere.net:/usr/src/sys/i386/compile/MYKERNEL i386


>Description:


  My system has a Promise Ultra66 and two 400GB hard disks on it. 

 If I enable IDE DMA, everything works fine until my system start to access something above 137GB boundary. It keeps produce error messages like:

kernel: ad6: FAILURE - READ_DMA48 timed out LBA=781422764
kernel: ad6: FAILURE - READ_DMA timed out LBA=0
kernel: ad6: FAILURE - READ_DMA48 timed out LBA=781422767
kernel: ad6: TIMEOUT - READ_DMA retrying (1 retry left) LBA=1
kernel: ad6: FAILURE - READ_DMA48 timed out LBA=781422705

If I disable DMA ( hw.ata.ata_dma=0), accessing is fine but accessing speed is very low.

I checked the linux kernel mailing list. It seems that Ultra66 does not support the hardware hack of LBA48 support used by Ultra 100, as claimed by Hank Yang. http://lwn.net/Articles/7253/

Linux 2.4.20 kernel source also indicate that the DMA hack is disabled for Ultra66 ( chip: PDC20262 ) as well. check http://lxr-itec.uni-klu.ac.at/um-linux-2.4.20/source/drivers/ide/pdc202xx.c

   I tried to disable the DMA hack for PDC20262. It will generate the same error messages as shown above. I end up making another path disable the DMA support for LBA48. Now everything looks fine now.



>How-To-Repeat:

  Pug in a Ultra 66 and put a >137GB hard drive on it. Do a "dd if=/dev/zero of=/dev/ad4" 


>Fix:

1. Disable ata DMA support. 
2. Use the attached patch, which disables 48bit DMA access.



Patch attached with submission follows:

*** sys/dev/ata/ata-chipset.c.orig	Wed May 21 21:31:49 2008
--- sys/dev/ata/ata-chipset.c	Thu May 22 00:23:25 2008
***************
*** 3264,3273 ****
--- 3264,3279 ----
  	/* FALLTHROUGH */
  
      case PROLD:
  	/* enable burst mode */
  	ATA_OUTB(ctlr->r_res1, 0x1f, ATA_INB(ctlr->r_res1, 0x1f) | 0x01);
+ 
+ 	if (ctlr->chip->chipid == ATA_PDC20262)
+ 	    device_printf(dev,
+ 			  "using PIO transfers above 137GB as workaround for "
+ 			  "48bit DMA access bug, expect reduced performance\n");
+ 
  	ctlr->allocate = ata_promise_allocate;
  	ctlr->setmode = ata_promise_setmode;
  	return 0;
  
      case PRTX:
***************
*** 3387,3401 ****
  }
  
  static int
  ata_promise_allocate(device_t dev)
  {
      struct ata_channel *ch = device_get_softc(dev);
! 
      if (ata_pci_allocate(dev))
  	return ENXIO;
  
      ch->hw.status = ata_promise_status;
      return 0;
  }
  
  static int
--- 3393,3411 ----
  }
  
  static int
  ata_promise_allocate(device_t dev)
  {
+     struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
      struct ata_channel *ch = device_get_softc(dev);
!  
      if (ata_pci_allocate(dev))
  	return ENXIO;
  
+     if (ctlr->chip->chipid == ATA_PDC20262)
+         ch->flags |= ATA_NO_48BIT_DMA;
+ 
      ch->hw.status = ata_promise_status;
      return 0;
  }
  
  static int


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


More information about the freebsd-bugs mailing list