From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 29 22:57:04 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0876C16A5D5 for ; Thu, 29 Jun 2006 22:57:04 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id E4A5845A0D for ; Thu, 29 Jun 2006 22:36:20 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (5i8iug2bzhqg26a0@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id k5TMaJfa006211; Thu, 29 Jun 2006 15:36:19 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id k5TMaIGb006210; Thu, 29 Jun 2006 15:36:18 -0700 (PDT) (envelope-from jmg) Date: Thu, 29 Jun 2006 15:36:18 -0700 From: John-Mark Gurney To: hongz@promisechina.com Message-ID: <20060629223618.GR82074@funkthat.com> Mail-Followup-To: hongz@promisechina.com, freebsd-hackers@freebsd.org References: <1150354522$36510$27619252@hongz@promisechina.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1150354522$36510$27619252@hongz@promisechina.com> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: freebsd-hackers@freebsd.org Subject: Re: Help:why bus resource shortage? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2006 22:57:04 -0000 hongz@promisechina.com wrote this message on Thu, Jun 15, 2006 at 14:55 +0800: > I failed to get the pci bus resource after the driver is loaded (sc->r_mem > is NULL after bus_alloc_resource_any is called). Is it because bus resources > have been consumed by other drivers? Or other something happened? Please > help me on this! Please provide a verbose boot (boot -v) output of the pci card... > rid = 0x10; You really should be using PCIR_BAR macro instead of hard coding it... > sc->r_mem = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, &rid, > RF_ACTIVE); > > if (!sc->r_mem) return ENOMEM; > > > > The pci resources on our cards: > > shasta0: port 0x2400-0x247f, > 0x2000-0x20ff mem 0xe9021000-0xe9021fff, 0xe9000000-0xe901ffff irq 17 at > device 5.0 on pci2 The resources could be in a different order than listed... Are you sure the memory resource is in the first bar possition? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."