From owner-freebsd-bugs Tue Oct 16 11:30:10 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 9F37637B409 for ; Tue, 16 Oct 2001 11:30:00 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9GIU0G10424; Tue, 16 Oct 2001 11:30:00 -0700 (PDT) (envelope-from gnats) Received: from h132-197-97-45.gte.com (h132-197-179-27.gte.com [132.197.179.27]) by hub.freebsd.org (Postfix) with ESMTP id 2063937B405 for ; Tue, 16 Oct 2001 11:28:25 -0700 (PDT) Received: (from ak03@localhost) by h132-197-97-45.gte.com (8.11.6/8.11.4) id f9GISO449220; Tue, 16 Oct 2001 14:28:24 -0400 (EDT) (envelope-from ak03) Message-Id: <200110161828.f9GISO449220@h132-197-97-45.gte.com> Date: Tue, 16 Oct 2001 14:28:24 -0400 (EDT) From: "Alexander N. Kabaev" Reply-To: "Alexander N. Kabaev" To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: kern/31316: kldxref introduction broke snd_driver.ko Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 31316 >Category: kern >Synopsis: kldxref introduction broke snd_driver.ko >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Oct 16 11:30:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Alexander N. Kabaev >Release: FreeBSD 5.0-CURRENT i386 >Organization: Verizon Data Services >Environment: System: FreeBSD kanpc.gte.com 5.0-CURRENT FreeBSD 5.0-CURRENT #6: Tue Oct 16 11:03:35 EDT 2001 root@kanpc.gte.com:/usr/src/sys/i386/compile/KANPC i386 >Description: snd_driver uses MODULE_DEPEND(name, ....) to load specific cards drivers. Previously, the 'name' above was treated as a name of the kernel module binary, i.e system would try to load name.ko in the above case. This has changed with kldxref and corresponding kernel module linker changes. Linker currently looks for the name, specified in the DRIVER_MODULE() macro instead. Several sound drivers currently have driver name which differs from the module filename, and since snd_driver tries to depend on them using their filenames, it is unable to load and fails with an 'unavailable dependency' error. The patch below simply restores one-to-one mapping between driver name and its module name. This way the same code will work as expected on both -CURRENT and -STABLE. >How-To-Repeat: kldload snd_driver.ko should suffice. >Fix: Index: pci/als4000.c =================================================================== RCS file: /usr/ncvs/src/sys/dev/sound/pci/als4000.c,v retrieving revision 1.7 diff -u -r1.7 als4000.c --- pci/als4000.c 10 Oct 2001 17:56:35 -0000 1.7 +++ pci/als4000.c 16 Oct 2001 18:00:36 -0000 @@ -897,6 +897,6 @@ PCM_SOFTC_SIZE, }; -DRIVER_MODULE(snd_als, pci, als_driver, pcm_devclass, 0, 0); -MODULE_DEPEND(snd_als, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER); -MODULE_VERSION(snd_als, 1); +DRIVER_MODULE(snd_als4000, pci, als_driver, pcm_devclass, 0, 0); +MODULE_DEPEND(snd_als4000, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER); +MODULE_VERSION(snd_als4000, 1); Index: pci/cmi.c =================================================================== RCS file: /usr/ncvs/src/sys/dev/sound/pci/cmi.c,v retrieving revision 1.13 diff -u -r1.13 cmi.c --- pci/cmi.c 10 Oct 2001 17:56:35 -0000 1.13 +++ pci/cmi.c 16 Oct 2001 18:03:06 -0000 @@ -981,6 +981,6 @@ PCM_SOFTC_SIZE }; -DRIVER_MODULE(snd_cmipci, pci, cmi_driver, pcm_devclass, 0, 0); -MODULE_DEPEND(snd_cmipci, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER); -MODULE_VERSION(snd_cmipci, 1); +DRIVER_MODULE(snd_cmi, pci, cmi_driver, pcm_devclass, 0, 0); +MODULE_DEPEND(snd_cmi, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER); +MODULE_VERSION(snd_cmi, 1); Index: pci/via82c686.c =================================================================== RCS file: /usr/ncvs/src/sys/dev/sound/pci/via82c686.c,v retrieving revision 1.15 diff -u -r1.15 via82c686.c --- pci/via82c686.c 8 Oct 2001 05:55:03 -0000 1.15 +++ pci/via82c686.c 16 Oct 2001 18:10:51 -0000 @@ -584,8 +584,8 @@ PCM_SOFTC_SIZE, }; -DRIVER_MODULE(via, pci, via_driver, pcm_devclass, 0, 0); -MODULE_DEPEND(via, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER); -MODULE_VERSION(via, 1); +DRIVER_MODULE(snd_via82c686, pci, via_driver, pcm_devclass, 0, 0); +MODULE_DEPEND(snd_via82c686, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER); +MODULE_VERSION(snd_via82c686, 1); Index: pci/vibes.c =================================================================== RCS file: /usr/ncvs/src/sys/dev/sound/pci/vibes.c,v retrieving revision 1.10 diff -u -r1.10 vibes.c --- pci/vibes.c 10 Oct 2001 17:56:35 -0000 1.10 +++ pci/vibes.c 16 Oct 2001 18:12:11 -0000 @@ -940,6 +940,6 @@ PCM_SOFTC_SIZE }; -DRIVER_MODULE(snd_sonicvibes, pci, sonicvibes_driver, pcm_devclass, 0, 0); -MODULE_DEPEND(snd_sonicvibes, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER); -MODULE_VERSION(snd_sonicvibes, 1); +DRIVER_MODULE(snd_vibes, pci, sonicvibes_driver, pcm_devclass, 0, 0); +MODULE_DEPEND(snd_vibes, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER); +MODULE_VERSION(snd_vibes, 1); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message