From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 28 14:54:13 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D157A106566C for ; Wed, 28 Dec 2011 14:54:13 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9AEFD8FC13 for ; Wed, 28 Dec 2011 14:54:13 +0000 (UTC) Received: by iadj38 with SMTP id j38so27548971iad.13 for ; Wed, 28 Dec 2011 06:54:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=tjkRBhPUH+d3Oob87lA9lxE9xvBlRKK5DjJByg5qM0w=; b=c6HEH68CzfEH6WSEGP7Erp8/rE4nU2rvcEIClOI5HDrXU6SoTRbUosWAwzYpvChmL8 pFpT0wlwiS7UoEfXUOM9vM2z7KEObOKUXYWBYsHUz9DHI/MU9w8HrsdFJtZMThqb7AM7 l2x3tAhWp/Bvmq5ARs3S4yHUk0PPJ/gx2r5dM= Received: by 10.50.135.41 with SMTP id pp9mr36162642igb.8.1325084053262; Wed, 28 Dec 2011 06:54:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.207.7 with HTTP; Wed, 28 Dec 2011 06:53:42 -0800 (PST) In-Reply-To: <20111228135641.GV50300@deviant.kiev.zoral.com.ua> References: <20111228135641.GV50300@deviant.kiev.zoral.com.ua> From: Chris Rees Date: Wed, 28 Dec 2011 14:53:42 +0000 Message-ID: To: Kostik Belousov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: hackers@freebsd.org Subject: Re: Checking for other kernel modules on load X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2011 14:54:13 -0000 2011/12/28 Kostik Belousov : > On Wed, Dec 28, 2011 at 12:23:58PM +0000, Chris Rees wrote: >> On 28 December 2011 12:21, Daniel O'Connor wrote= : >> > >> > On 28/12/2011, at 22:07, Chris Rees wrote: >> >> Is there a simple way to check for existence of a driver? =A0I 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 effectiv= e. >> > >> >> 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") >=3D 0) + { + cmn_err (CE_WARN, "A conflicting sound driver is already loaded"); + return EBUSY; + } + Is there a better way to handle such conflicts? Chris