From owner-freebsd-bugs@FreeBSD.ORG Wed Jul 9 06:50: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 D0096106564A for ; Wed, 9 Jul 2008 06:50: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 ACDEF8FC18 for ; Wed, 9 Jul 2008 06:50:02 +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 m696o2sx057279 for ; Wed, 9 Jul 2008 06:50:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m696o2RX057278; Wed, 9 Jul 2008 06:50:02 GMT (envelope-from gnats) Resent-Date: Wed, 9 Jul 2008 06:50:02 GMT Resent-Message-Id: <200807090650.m696o2RX057278@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, "Andrey V. Elsukov" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4119F1065674; Wed, 9 Jul 2008 06:44:20 +0000 (UTC) (envelope-from elsukov@kirov.so-cdu.ru) Received: from mgat.kirov.so-cdu.ru (mgat.kirov.so-cdu.ru [77.72.136.147]) by mx1.freebsd.org (Postfix) with ESMTP id 166798FC16; Wed, 9 Jul 2008 06:44:18 +0000 (UTC) (envelope-from elsukov@kirov.so-cdu.ru) Received: from mail.kirov.so-cdu.ru ([62.33.253.129]) by mgat.kirov.so-cdu.ru with InterScan Message Security Suite; Wed, 09 Jul 2008 10:14:07 +0400 Received: from kas30pipe.localhost (localhost.kirov.so-cdu.ru [127.0.0.1]) by mail.kirov.so-cdu.ru (Postfix) with SMTP id 90279B805F; Wed, 9 Jul 2008 10:14:07 +0400 (MSD) Received: by mail.kirov.so-cdu.ru (Postfix, from userid 1011) id 6DA53B805E; Wed, 9 Jul 2008 10:14:07 +0400 (MSD) Message-Id: <20080709061407.6DA53B805E@mail.kirov.so-cdu.ru> Date: Wed, 9 Jul 2008 10:14:07 +0400 (MSD) From: "Andrey V. Elsukov" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: sos@FreeBSD.org Subject: kern/125421: [ata][patch] sii 680 failed to allocate resources X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Andrey V. Elsukov" List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jul 2008 06:50:02 -0000 >Number: 125421 >Category: kern >Synopsis: [ata][patch] sii 680 failed to allocate resources >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jul 09 06:50:02 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Andrey V. Elsukov >Release: FreeBSD 6.2-STABLE i386 >Organization: >Environment: FreeBSD >Description: atapci1: port 0xa800-0xa807,0xa400-0xa403,0xa000-0xa007,0x9800-0x9803,0x9400-0x940f irq 22 at device 10.0 on pci1 atapci1: Reserved 0x10 bytes for rid 0x20 type 4 at 0x9400 ioapic0: routing intpin 22 (PCI IRQ 22) to vector 54 atapci1: [MPSAFE] atapci1: [ITHREAD] device_attach: atapci1 attach returned 6 Driver failed to allocate MMIO resources. Attached patch adds a fallback path. It uses generic IDE facilities if sii-specific allocations failed. After path we have: atapci1: port 0xa800-0xa807,0xa400-0xa403,0xa000-0xa007,0x9800-0x9803,0x9400-0x940f irq 21 at device 11.0 on pci1 atapci1: Reserved 0x10 bytes for rid 0x20 type 4 at 0x9400 ioapic0: routing intpin 21 (PCI IRQ 21) to vector 54 atapci1: [MPSAFE] atapci1: [ITHREAD] ata4: on atapci1 atapci1: Reserved 0x8 bytes for rid 0x10 type 4 at 0xa800 atapci1: Reserved 0x4 bytes for rid 0x14 type 4 at 0xa400 ata4: reset tp1 mask=03 ostat0=50 ostat1=00 ata4: stat0=0x00 err=0x01 lsb=0x14 msb=0xeb ata4: stat1=0x00 err=0x04 lsb=0x0e msb=0x00 ata4: reset tp2 stat0=00 stat1=00 devices=0x4 ata4: [MPSAFE] ata4: [ITHREAD] ata5: on atapci1 atapci1: Reserved 0x8 bytes for rid 0x18 type 4 at 0xa000 atapci1: Reserved 0x4 bytes for rid 0x1c type 4 at 0x9800 ata5: reset tp1 mask=03 ostat0=7f ostat1=7f ata5: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata5: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata5: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata5: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata5: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata5: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata5: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata5: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata5: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata5: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata5: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata5: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata5: stat1=0x7f err=0x7f lsb=0x7f msb=0x7f ata5: reset tp2 stat0=ff stat1=ff devices=0x0 ata5: [MPSAFE] ata5: [ITHREAD] isab0: at device 31.0 on pci0 ... ata4-master: pio=PIO4 wdma=WDMA2 udma=UDMA33 cable=40 wire acd0: setting PIO4 on 0680 chip acd0: setting UDMA33 on 0680 chip acd0: DVDR drive at ata4 as master acd0: read 8268KB/s (8268KB/s) write 8268KB/s (8268KB/s), 2048KB buffer, UDMA33 acd0: Reads: CDR, CDRW, CDDA stream, DVDROM, DVDR, DVDRAM, packet acd0: Writes: CDR, CDRW, DVDR, DVDRAM, test write, burnproof acd0: Audio: play, 256 volume levels acd0: Mechanism: ejectable tray, unlocked acd0: Medium: no/blank disc >How-To-Repeat: Can be repeated on some buggy(?) controllers. >Fix: --- sii_680_alloc_resource_fallback_path.diff begins here --- --- ata-chipset.c.orig 2008-03-25 13:32:44.000000000 +0300 +++ ata-chipset.c 2008-03-25 14:25:32.000000000 +0300 @@ -4514,12 +4514,15 @@ ata_sii_chipinit(device_t dev) ctlr->r_type2 = SYS_RES_MEMORY; ctlr->r_rid2 = PCIR_BAR(5); if (!(ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, - &ctlr->r_rid2, RF_ACTIVE))) - return ENXIO; + &ctlr->r_rid2, RF_ACTIVE))) { + if (ctlr->chip->chipid != ATA_SII0680 || + (pci_read_config(dev, 0x8a, 1) & 1)) + return ENXIO; + } if (ctlr->chip->cfg2 & SIISETCLK) { if ((pci_read_config(dev, 0x8a, 1) & 0x30) != 0x10) - pci_write_config(dev, 0x8a, + pci_write_config(dev, 0x8a, (pci_read_config(dev, 0x8a, 1) & 0xcf)|0x10,1); if ((pci_read_config(dev, 0x8a, 1) & 0x30) != 0x10) device_printf(dev, "%s could not set ATA133 clock\n", @@ -4539,7 +4542,9 @@ ata_sii_chipinit(device_t dev) /* enable PCI interrupt as BIOS might not */ pci_write_config(dev, 0x8a, (pci_read_config(dev, 0x8a, 1) & 0x3f), 1); - ctlr->allocate = ata_sii_allocate; + if (ctlr->r_res2) + ctlr->allocate = ata_sii_allocate; + if (ctlr->chip->max_dma >= ATA_SA150) { ctlr->reset = ata_sii_reset; ctlr->setmode = ata_sata_setmode; --- sii_680_alloc_resource_fallback_path.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: