From owner-freebsd-acpi@FreeBSD.ORG Fri Oct 14 12:40:31 2011 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F145C1065670; Fri, 14 Oct 2011 12:40:31 +0000 (UTC) (envelope-from gelraen.ua@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9DB658FC13; Fri, 14 Oct 2011 12:40:30 +0000 (UTC) Received: by vcbfo13 with SMTP id fo13so1054069vcb.13 for ; Fri, 14 Oct 2011 05:40:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:cc:content-type; bh=NK5tpDkLOrR6MXoMi2hufHXjiH83QJX4E+DECBsC2DE=; b=f/i2IGGxzr9jLgTQNI5Ee5jtYgIUjaZ9IqM973NY/YeDfSwLdj/YsWXxQ6qDmrv77D T5WWTycLToT8bOsKOv/r+Vn6jAXkB0ln+lqtd8AKysvbtIdu/g2hPxnPHLVoHFvdNFWy Ut0jIh7OpI8m4Hj9+8Otv52r8ct4YsNO8bvEw= Received: by 10.52.70.242 with SMTP id p18mr8685187vdu.28.1318594290843; Fri, 14 Oct 2011 05:11:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.185.129 with HTTP; Fri, 14 Oct 2011 05:11:10 -0700 (PDT) From: Maxim Ignatenko Date: Fri, 14 Oct 2011 15:11:10 +0300 Message-ID: To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: freebsd-acpi@freebsd.org Subject: Acquiring ACPI_LOCK(acpi) from kernel module during boot process X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2011 12:40:32 -0000 Hi, I have this code: https://gitorious.org/acpi_call-freebsd/acpi_call-freebsd/blobs/5e6a79869721a2bd8de88b5cfa90c14b429cb5c7/acpi_call.c It works just fine when loaded into kernel manually, but crashes if loaded during boot via loader.conf: http://i.imgur.com/fLPen.png I've added some printf's to acpi_register_ioctl() to track down where it hangs and crashes after about one minute: http://pastebin.com/vvJutWLA What am I missing? Do I need to somehow (how?) specify module initialization order? Or just call acpi_register_ioctl() by some other mean when it would not cause panic? Thanks.