More on problems with new pnp code

1999-12-16 Thread D. Rock

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

--- isa_common.c.orig   Thu Dec 16 18:27:23 1999
+++ isa_common.cThu 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;



problems with new pnp code

1999-12-15 Thread D. Rock

Hi,

just noticed a bug in the new pnp code. The resource allocator
seems to ignore the align flag for port addresses.

dmesg output:
[...]
AZT5001: start dependant
AZT5001: adding io range 0x100-0x3ff, size=0x1, align=0x1
AZT5001: end dependant
[...]
SAG0001: start dependant
SAG0001: adding io range 0x100-0x3f7, size=0x8, align=0x8
SAG0001: adding irq mask 0xbcb8
SAG0001: start dependant
SAG0001: adding io range 0x100-0x3f7, size=0x8, align=0x8
SAG0001: adding irq mask 0x20
SAG0001: start dependant
SAG0001: adding io range 0x100-0x3f7, size=0x8, align=0x8
SAG0001: adding irq mask 0x80
SAG0001: end dependant
[...]
unknown11:  at port 0x100 on isa0
isic0:  at port 0x101-0x108 irq 10 on isa0
isic0: HSCX VSTR test failed for SWS PnP
isic0: HSC0: VSTR: 0xee
isic0: HSC1: VSTR: 0xee
device_probe_and_attach: isic0 attach returned 6
[...]

Shouldn't the port for isic0 be chosen as 0x108-10f?

This used to be the assignment by the BIOS with the old code.

Daniel


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message