Bug 21461

Summary: ISA PnP resource allocator problem
Product: Base System Reporter: D.Rock <D.Rock>
Component: kernAssignee: Warner Losh <imp>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description D.Rock 2000-09-21 20:00:01 UTC
if a resource is already held by another PnP device, the code in
/sys/kern/subr_rman.c automatically tries to find another region, but
doesn't honour alignment requirements. The code in /sys/isa/isa_common.c
(function isa_find_port()) is therefor pretty useless.

This code is present in the system since FreeBSD switched to the new PnP
code (about a year ago)

Fix: The following code releases the region if it is not exactly the one
requested, which was the original intention of the code but didn't
work because of the additional "intelligence" by the resource allocator.

Quick - but ugly - hack (worked for me since I discovered the bug):
How-To-Repeat: I have different ISA PnP devices in my system (output from pnpinfo):

   I/O Range 0x100 .. 0x3ff, alignment 0x1, len 0x1
        [16-bit addr]

   I/O Range 0x100 .. 0x3f0, alignment 0x8, len 0x8
        [not 16-bit addr]

For the first device the I/O port 0x100 is allocated. This port isn't
available for the second device, but the code in /sys/kern/subr_rman.c
automatically "finds" an area large enough at 0x101, but doesn't know
the alignment constraint. Instead the second device should be allocated
at 0x108-0x10f

Wrong boot output:
unknown10: <EEPROM> at port 0x100 on isa0
isic0: <Sedlbauer WinSpeed> at port 0x101-0x108 irq 11 on isa0

should be:
unknown10: <EEPROM> at port 0x100 on isa0
isic0: <Sedlbauer WinSpeed> at port 0x108-0x10f irq 11 on isa0
Comment 1 Warner Losh freebsd_committer freebsd_triage 2001-06-06 23:38:40 UTC
Responsible Changed
From-To: freebsd-bugs->imp

I'll look into this.
Comment 2 K. Macy freebsd_committer freebsd_triage 2007-11-16 04:00:19 UTC
State Changed
From-To: open->feedback


Likely fixed.
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2008-03-01 19:40:54 UTC
State Changed
From-To: feedback->closed

Feedback timeout (> 3 months).