From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 18 12:08:48 2013 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 03D1F8CB for ; Fri, 18 Jan 2013 12:08:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 45D56271 for ; Fri, 18 Jan 2013 12:08:47 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA20966; Fri, 18 Jan 2013 14:08:42 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1TwAkU-0001b0-CY; Fri, 18 Jan 2013 14:08:42 +0200 Message-ID: <50F93B49.5080902@FreeBSD.org> Date: Fri, 18 Jan 2013 14:08:41 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Jimmy Olgeni Subject: Re: [GIANT-LOCKED] even without D_NEEDGIANT References: In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2013 12:08:48 -0000 on 18/01/2013 13:39 Jimmy Olgeni said the following: > > Hello list, > > At $DAILY_JOB I got involved with an ASI board that didn't have any kind of > FreeBSD support, so I ended up writing a driver for it. > > If you try to ignore the blatant style(9) violations (of which there are many, > hopefully on the way to be cleaned up) it seems to work fine. > > However, I noticed that when loading the driver I always get a > message about the giant lock being used, even if D_NEEDGIANT is not > specified anywhere. > > The actual output when loading is this (FreeBSD 9-STABLE i386): > > dektec0: mem 0xfeaff800-0xfeafffff irq 16 at device 13.0 on pci0 > dektec0: [GIANT-LOCKED] > dektec0: [ITHREAD] > dektec0: board model 145, firmware version 2 (tx: 0, rx: 2), tx fifo 16384 MB > > Source code here: > > https://github.com/olgeni/freebsd-dektec/blob/master/dektec.c > > Can anybody offer a clue about what could be triggering the GIANT > requirement? Could I be doing something that has this, and possibly > other, unintended side effects? > See INTR_MPSAFE in bus_setup_intr(9). -- Andriy Gapon