From owner-freebsd-current@FreeBSD.ORG Tue Apr 13 10:20:06 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AD75F16A4CE for ; Tue, 13 Apr 2004 10:20:06 -0700 (PDT) Received: from spider.deepcore.dk (cpe.atm2-0-53484.0x50a6c9a6.abnxx9.customer.tele.dk [80.166.201.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id A74E443D53 for ; Tue, 13 Apr 2004 10:20:04 -0700 (PDT) (envelope-from sos@DeepCore.dk) Received: from DeepCore.dk (sos.deepcore.dk [194.192.25.130]) by spider.deepcore.dk (8.12.11/8.12.10) with ESMTP id i3DHJv5J067568; Tue, 13 Apr 2004 19:20:02 +0200 (CEST) (envelope-from sos@DeepCore.dk) Message-ID: <407C213D.8080205@DeepCore.dk> Date: Tue, 13 Apr 2004 19:19:57 +0200 From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= User-Agent: Mozilla Thunderbird 0.5 (X11/20040329) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sean McNeil References: <1081874641.1067.4.camel@server.mcneil.com> In-Reply-To: <1081874641.1067.4.camel@server.mcneil.com> Content-Type: multipart/mixed; boundary="------------030504050506020804090701" X-mail-scanned: by DeepCore Virus & Spam killer v1.4 cc: freebsd-current@freebsd.org Subject: Re: Lastest ATA checkings make my driver fail X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2004 17:20:06 -0000 This is a multi-part message in MIME format. --------------030504050506020804090701 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Sean McNeil wrote: > I have two disks that I use in a software raid (because my hardware raid > controller isn't recognized). All was working great until the latest > checkin. Now, This is partly because of the pci code changes, you need this patch to make it work: -- -Søren --------------030504050506020804090701 Content-Type: text/plain; name="pci-diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pci-diff" Index: pci.c =================================================================== RCS file: /home/ncvs/src/sys/dev/pci/pci.c,v retrieving revision 1.240 diff -u -r1.240 pci.c --- pci.c 11 Apr 2004 07:02:49 -0000 1.240 +++ pci.c 13 Apr 2004 07:26:05 -0000 @@ -1464,17 +1464,21 @@ * Weed out the bogons, and figure out how large the BAR/map is. */ map = pci_read_config(child, *rid, 4); - if (pci_maptype(map) & PCI_MAPMEM) { - if (type != SYS_RES_MEMORY) { - device_printf(child, "rid %#x says memory, driver wants %d failed.\n", *rid, type); - return (NULL); - } - } else { - if (type != SYS_RES_IOPORT) { - device_printf(child, "rid %#x says ioport, driver wants %d failed.\n", *rid, type); - return (NULL); + if (map) { + if (pci_maptype(map) & PCI_MAPMEM) { + if (type != SYS_RES_MEMORY) { + device_printf(child, "rid %#x says memory, driver wants %d failed.\n", *rid, type); + return (NULL); + } + } else { + if (type != SYS_RES_IOPORT) { + device_printf(child, "rid %#x says ioport, driver wants %d failed.\n", *rid, type); + return (NULL); + } } } + else + device_printf(child, "NULL BAR ignored, using supplied values\n"); pci_write_config(child, *rid, 0xffffffff, 4); testval = pci_read_config(child, *rid, 4); @@ -1483,10 +1487,12 @@ * appropriate bar for that resource (this is the part * I'm not sure is good for 64-bit bars). */ - mapsize = pci_mapsize(testval); - count = 1 << mapsize; - if (RF_ALIGNMENT(flags) < mapsize) - flags = (flags & ~RF_ALIGNMENT_MASK) | RF_ALIGNMENT_LOG2(mapsize); + if (testval) { + mapsize = pci_mapsize(testval); + count = 1 << mapsize; + if (RF_ALIGNMENT(flags) < mapsize) + flags = (flags & ~RF_ALIGNMENT_MASK) | RF_ALIGNMENT_LOG2(mapsize); + } res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid, start, end, count, flags); if (res == NULL) { --------------030504050506020804090701--