From owner-freebsd-bugs@FreeBSD.ORG Thu May 22 07:10:02 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 050D2106567F for ; Thu, 22 May 2008 07:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D834A8FC27 for ; Thu, 22 May 2008 07:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m4M7A1FI036092 for ; Thu, 22 May 2008 07:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m4M7A1YO036091; Thu, 22 May 2008 07:10:01 GMT (envelope-from gnats) Resent-Date: Thu, 22 May 2008 07:10:01 GMT Resent-Message-Id: <200805220710.m4M7A1YO036091@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "J. Su" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30D15106567A for ; Thu, 22 May 2008 07:05:47 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 20E7F8FC15 for ; Thu, 22 May 2008 07:05:47 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m4M74MAL040542 for ; Thu, 22 May 2008 07:04:22 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m4M74LAD040541; Thu, 22 May 2008 07:04:21 GMT (envelope-from nobody) Message-Id: <200805220704.m4M74LAD040541@www.freebsd.org> Date: Thu, 22 May 2008 07:04:21 GMT From: "J. Su" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/123887: PDC20262 does not support 48 bit DMA access X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2008 07:10:02 -0000 >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@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: