Re: Checking for other kernel modules on load



On Wed, Dec 28, 2011 at 02:53:42PM +0000, Chris Rees wrote:
2011/12/28 Kostik Belousov <kostikbel@xxxxxxxxx>:
On Wed, Dec 28, 2011 at 12:23:58PM +0000, Chris Rees wrote:
On 28 December 2011 12:21, Daniel O'Connor <doconnor@xxxxxxxxxxxx> wrote:

On 28/12/2011, at 22:07, Chris Rees wrote:
Is there a simple way to check for existence of a driver?  I could
even check for /dev/sndstat, though that doesn't seem elegant to me...

kldstat -v, but really /dev/sndstat seems simpler and just as effective.


Cheers-- I was thinking of a kernel-level function though.

cognet@ suggested using modfind("sound"), I'll go with that.
Obvious question is what the panic is. Checking for modules loaded is
papering over some issue.

True, although I figured that it was a simple conflict, possibly to do
with sndstat.

Also, I'm getting panics with the following patch, whether sound is
loaded or not :)

+ if (modfind("sound") >= 0)
+ {
+ cmn_err (CE_WARN, "A conflicting sound driver is already loaded");
+ return EBUSY;
+ }
+

Is there a better way to handle such conflicts?

You have missed the point. There is some bug in oss driver that causing
the panic. Presumed 'conflict' cannot cause the harm itself, besides not
allowing second driver to attach to the same device, and should not result
in panic. Trying to implement a half-measure that only covers the problem
you do a mis-service.

And you still did not provided the panic message.

Attachment: pgpd0rLNfDJBN.pgp
Description: PGP signature



Relevant Pages

  • Re: Checking for other kernel modules on load
    ... True, although I figured that it was a simple conflict, possibly to do ... Also, I'm getting panics with the following patch, whether sound is ... There is some bug in oss driver that causing ... by devfs node. ...
    (freebsd-hackers)
  • Re: Checking for other kernel modules on load
    ... though that doesn't seem elegant to me.... ... kldstat -v, but really /dev/sndstat seems simpler and just as effective. ... True, although I figured that it was a simple conflict, possibly to do ... Also, I'm getting panics with the following patch, whether sound is ...
    (freebsd-hackers)
  • Re: Checking for other kernel modules on load
    ... True, although I figured that it was a simple conflict, possibly to do ... Also, I'm getting panics with the following patch, whether sound is ... There is some bug in oss driver that causing ... by devfs node. ...
    (freebsd-hackers)
  • Re: Checking for other kernel modules on load
    ... True, although I figured that it was a simple conflict, possibly to do ... Also, I'm getting panics with the following patch, whether sound is ... There is some bug in oss driver that causing ... by devfs node. ...
    (freebsd-hackers)
  • Re: Checking for other kernel modules on load
    ... True, although I figured that it was a simple conflict, possibly to do ... Also, I'm getting panics with the following patch, whether sound is ... There is some bug in oss driver that causing ... by devfs node. ...
    (freebsd-hackers)