From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 12:50:16 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F06CA1065679; Sun, 2 Nov 2008 12:50:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF62A8FC14; Sun, 2 Nov 2008 12:50:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2CoG2w038958; Sun, 2 Nov 2008 12:50:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2CoGs1038957; Sun, 2 Nov 2008 12:50:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200811021250.mA2CoGs1038957@svn.freebsd.org> From: Alexander Motin Date: Sun, 2 Nov 2008 12:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184558 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 12:50:17 -0000 Author: mav Date: Sun Nov 2 12:50:16 2008 New Revision: 184558 URL: http://svn.freebsd.org/changeset/base/184558 Log: As soon as we have several threads per process now, it is not correct to use process ID as ACPI thread ID. Concurrent requests with equal thread IDs broke ACPI mutexes operation causing unpredictable errors including AE_AML_MUTEX_NOT_ACQUIRED that I have seen. Use kernel thread ID instead of process ID for ACPI thread. Modified: head/sys/dev/acpica/Osd/OsdSchedule.c Modified: head/sys/dev/acpica/Osd/OsdSchedule.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSchedule.c Sun Nov 2 11:49:19 2008 (r184557) +++ head/sys/dev/acpica/Osd/OsdSchedule.c Sun Nov 2 12:50:16 2008 (r184558) @@ -187,13 +187,9 @@ AcpiOsStall(UINT32 Microseconds) ACPI_THREAD_ID AcpiOsGetThreadId(void) { - struct proc *p; /* XXX do not add ACPI_FUNCTION_TRACE here, results in recursive call. */ - p = curproc; - KASSERT(p != NULL, ("%s: curproc is NULL!", __func__)); - /* Returning 0 is not allowed. */ - return (p->p_pid + 1); + return (curthread->td_tid + 1); }