From owner-freebsd-current Thu Dec 16 9:30:41 1999 Delivered-To: freebsd-current@freebsd.org Received: from dead-end.net (dead-end.net [216.15.131.2]) by hub.freebsd.org (Postfix) with ESMTP id 396C7150D2 for ; Thu, 16 Dec 1999 09:30:38 -0800 (PST) (envelope-from rock@dead-end.net) Received: (from nopriv@localhost) by dead-end.net (8.9.3/DEAD-END/1999102300-Deliver) id SAA42830; Thu, 16 Dec 1999 18:30:35 +0100 (CET) (envelope-from rock@dead-end.net) Date: Thu, 16 Dec 1999 18:30:35 +0100 (CET) From: "D. Rock" Message-Id: <199912161730.SAA42830@dead-end.net> X-Authentication-Warning: dead-end.net: nopriv set sender to rock@dead-end.net using -f To: current@FreeBSD.org Reply-To: rock@dead-end.net MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="-MOQ94536543503c0bde80a2899ef775e4a06f9ea0ab1" User-Agent: IMP/PHP3 Imap webMail Program 2.0.11 Subject: More on problems with new pnp code Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This message is in MIME format. ---MOQ94536543503c0bde80a2899ef775e4a06f9ea0ab1 Content-Type: text/plain Content-Transfer-Encoding: 8bit Hi, yesterday I reported a bug in the resource allocator for PnP ISA devices: The align-field is ignored for IO port resources, e.g. device A wants io range 0x100-0x3ff, size=0x1, align=0x1 device B wants io range 0x100-0x3f7, size=0x8, align=0x8 device A gets assigned first and will receive at port 0x100 on isa0 device B will then receive at port 0x101-0x108 I have somewhat debug the code and found out that the loop in isa_find_port() [/sys/isa/isa_common.c] is totally useless. The first call to bus_alloc_resource() there will succeed, because the major work of resource allocation (including searching for an alternate region) will be done in rman_reserve_resource() [/sys/kern/subr_rman.c], which doesn\'t know of any alignment constraints. I haven\'t tested it, but shouldn\'t the code in isa_find_port() be something like below? I will test it tonight, though. Daniel ---MOQ94536543503c0bde80a2899ef775e4a06f9ea0ab1 Content-Type: text/plain; name="isa.diff" Content-Transfer-Encoding: 8bit Content-Disposition: inline; filename="isa.diff" --- isa_common.c.orig Thu Dec 16 18:27:23 1999 +++ isa_common.c Thu Dec 16 18:27:25 1999 @@ -205,7 +205,8 @@ start, size); res[i] = bus_alloc_resource(child, SYS_RES_IOPORT, &i, - 0, ~0, 1, RF_ACTIVE); + start, start + size - 1, + 1, RF_ACTIVE); if (res[i]) { result->ic_port[i].ir_start = start; result->ic_port[i].ir_end = start + size - 1; ---MOQ94536543503c0bde80a2899ef775e4a06f9ea0ab1-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message