Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Dec 1999 18:30:35 +0100 (CET)
From:      "D. Rock" <rock@dead-end.net>
To:        current@FreeBSD.org
Subject:   More on problems with new pnp code
Message-ID:  <199912161730.SAA42830@dead-end.net>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199912161730.SAA42830>