Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Nov 2008 12:48:24 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        Alexander Motin <mav@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r184558 - head/sys/dev/acpica/Osd
Message-ID:  <200811031248.24713.jhb@freebsd.org>
In-Reply-To: <200811021250.mA2CoGs1038957@svn.freebsd.org>
References:  <200811021250.mA2CoGs1038957@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 02 November 2008 07:50:16 am Alexander Motin wrote:
> 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);
>  }

You don't need the '+ 1' or comment now.  TIDs are never 0.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811031248.24713.jhb>