kern/61734: [PATCH]Incorrect unit number when kldload module

Jun Su junsu at m-net.arbornet.org
Thu Jan 22 08:30:21 PST 2004


>Number:         61734
>Category:       kern
>Synopsis:       [PATCH]Incorrect unit number when kldload module
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 22 08:30:16 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Jun Su
>Release:        FreeBSD 4.6.2-RELEASE-p26 i386
>Organization:
NONE
>Environment:
System: FreeBSD 5.2 -Curret


	
>Description:
	If a device has some hint value in device.hints, when kldload the module after boot,
	the unit number is incorrect.

	for example, if_lnc driver.
	in device.hints:
	hint.lnc.0.at="isa"
	hint.lnc.0.disabled="1"
	hint.lnc.0.port="0x280"
	hint.lnc.0.irq="10"
	hint.lnc.0.drq="0"

	Don;t load the if_lnc.ko when boot. Also don't compile the driver into kernel.
	When kldload if_lnc.ko, the device will be lnc1 instead of lnc0.

	This name change make the config in rc.conf incorrect. I think we need fix this.
>How-To-Repeat:
	This behavir will be occured in any isa driver.
>Fix:
--- /usr/src/sys/isa/isa_common.c       Wed Jul  9 02:56:58 2003
+++ isa_common.c        Thu Jan 22 09:08:34 2004
@@ -613,7 +613,16 @@
                        }
                }
        }
+       for (i = 0; i < nchildren; i++) {
+         device_t child = children[i];
+         struct isa_device *idev = DEVTOISA(child);

+         if (TAILQ_FIRST(&idev->id_configs))
+           continue;
+
+         device_delete_child(dev, child);
+       }
+
        free(children, M_TEMP);

        isa_running = 1;



>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list