From owner-acpi-jp@jp.freebsd.org  Fri Oct 20 23:30:34 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id XAA54565;
	Fri, 20 Oct 2000 23:30:34 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from shidahara1.planet.sci.kobe-u.ac.jp (shidahara1.planet.sci.kobe-u.ac.jp [133.30.50.200])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id XAA54560
	for <acpi-jp@jp.freebsd.org>; Fri, 20 Oct 2000 23:30:34 +0900 (JST)
	(envelope-from takawata@shidahara1.planet.sci.kobe-u.ac.jp)
From: takawata@shidahara1.planet.sci.kobe-u.ac.jp
Received: from libr.scitec.kobe-u.ac.jp (skai0700.ppp.infoweb.ne.jp [202.248.10.208])
	by shidahara1.planet.sci.kobe-u.ac.jp (8.9.3/8.9.3) with ESMTP id XAA32893
	for <acpi-jp@jp.freebsd.org>; Fri, 20 Oct 2000 23:29:17 +0900 (JST)
	(envelope-from takawata@shidahara1.planet.sci.kobe-u.ac.jp)
Received: from shidahara1.planet.kobe-u.ac.jp (localhost [127.0.0.1]) by libr.scitec.kobe-u.ac.jp (8.9.1/3.5Wpl7) with ESMTP id XAA16939 for <acpi-jp@jp.freebsd.org>; Fri, 20 Oct 2000 23:16:59 +0900 (JST)
Message-Id: <200010201416.XAA16939@libr.scitec.kobe-u.ac.jp>
To: acpi-jp@jp.freebsd.org
Date: Fri, 20 Oct 2000 23:16:58 +0900
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: acpi-jp 885
Subject: [acpi-jp 885] Can we call tsleep in taskqueue_swi task?
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: takawata@shidahara1.planet.sci.kobe-u.ac.jp

I measured How often EcWait routine is called and found that it
is called 1024 times in 14-30 second e.g. It is called each 13.6ms.

And the code make polling loop more than 1ms(I think 2-3 ms). 
It is no wonder if it cause performance loss.
 
So I try to convert EC driver to use interrupt while it read or write.
I modified ACPICA to call EC handler without queueing.
But when I modified EC driver to use tsleep() the machine will hangup.

I noticed that taskqueue_swi task is called with Giant lock held.
(in intr_soft()@kern_intr.c) 
Is it permitted to call tsleep in taskqueue_swi?
Does it stop heartbeat of system?

Do we need acpi task thread to use tsleep context?

Takanori Watanabe
<a href="http://www.planet.sci.kobe-u.ac.jp/~takawata/key.html">
Public Key</a>
Key fingerprint =  2C 51 E2 78 2C E1 C5 2D  0F F1 20 A3 11 3A 62 2A 
 
