From owner-freebsd-drivers@FreeBSD.ORG Fri Jun 5 13:55:06 2009 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E6F4106566B for ; Fri, 5 Jun 2009 13:55:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 505A38FC15 for ; Fri, 5 Jun 2009 13:55:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id E824E46B29; Fri, 5 Jun 2009 09:55:05 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id A55B18A041; Fri, 5 Jun 2009 09:55:04 -0400 (EDT) From: John Baldwin To: freebsd-drivers@freebsd.org Date: Fri, 5 Jun 2009 08:36:04 -0400 User-Agent: KMail/1.9.7 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200906050836.04538.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 05 Jun 2009 09:55:04 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: AJ Shipley Subject: Re: Kernel Loadable Driver vs. Custom Compiled Driver Question X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 13:55:07 -0000 On Thursday 04 June 2009 3:02:30 pm AJ Shipley wrote: > Hi, >=20 > I am in the process of integrating a 3rd party HW vendor=92s driver into > our FreeBSD code base. The driver works when it is loaded as a KLM > using kldload =96v but when I modified the kernel using > config and compiled the driver into the kernel, it does not work. The > kernel builds and installs fine, but the driver does not load > correctly. >=20 > I was able to verify that the first 10 steps of the driver works > during load in both cases and that the driver is loading the device > into the same PCI memory range (it=92s a PCI based HW card). However, > at a critical step in the driver, it polls an ISR register waiting for > a bit to toggle high indicating that the board is ready and out of > reset and it never does, and eventually hits the driver timeout and > aborts its load. >=20 > Why would a driver work as a KLM but not statically compiled into the=20 kernel? Are you depending on working interrupts? If so, you will need to defer tha= t=20 work using config_intrhook(9). =2D-=20 John Baldwin