From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: Justin Forbes <jmforbes@linuxtx.org>,
Zwane Mwaikambo <zwane@arm.linux.org.uk>,
"Theodore Ts'o" <tytso@mit.edu>,
Randy Dunlap <rdunlap@xenotime.net>,
Dave Jones <davej@redhat.com>,
Chuck Wolber <chuckw@quantumlinux.com>,
Chris Wedgwood <reviews@ml.cw.f00f.org>,
Michael Krufky <mkrufky@linuxtv.org>,
Chuck Ebbert <cebbert@redhat.com>,
Domenico Andreoli <cavokz@gmail.com>, Willy Tarreau <w@1wt.eu>,
Rodrigo Rubira Branco <rbranco@la.checkpoint.com>,
Jake Edge <jake@lwn.net>, Eugene Teo <eteo@redhat.com>,
torvalds@linux-foundation.org, akpm@linux-foundation.org,
alan@lxorguk.ukuu.org.uk, epprecht@solnet.ch,
Zhao Yakui <yakui.zhao@intel.com>,
Zhang Rui <rui.zhang@intel.com>, Andi Kleen <ak@linux.intel.com>
Subject: [patch 10/28] ACPI: Avoid bogus EC timeout when EC is in Polling mode
Date: Mon, 6 Oct 2008 16:17:19 -0700 [thread overview]
Message-ID: <20081006231719.GK20567@suse.de> (raw)
In-Reply-To: <20081006231639.GA20567@suse.de>
[-- Attachment #1: acpi-avoid-bogus-ec-timeout-when-ec-is-in-polling-mode.patch --]
[-- Type: text/plain, Size: 2246 bytes --]
2.6.25-stable review patch. If anyone has any objections, please let us
know.
------------------
From: Zhao Yakui <yakui.zhao@intel.com>
commit 9d699ed92a459cb408e2577e8bbeabc8ec3989e1 upstream
When EC is in Polling mode, OS will check the EC status continually by using
the following source code:
clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
while (time_before(jiffies, delay)) {
if (acpi_ec_check_status(ec, event))
return 0;
msleep(1);
}
But msleep is realized by the function of schedule_timeout. At the same time
although one process is already waken up by some events, it won't be scheduled
immediately. So maybe there exists the following phenomena:
a. The current jiffies is already after the predefined jiffies.
But before timeout happens, OS has no chance to check the EC
status again.
b. If preemptible schedule is enabled, maybe preempt schedule will happen
before checking loop. When the process is resumed again, maybe
timeout already happens, which means that OS has no chance to check
the EC status.
In such case maybe EC status is already what OS expects when timeout happens.
But OS has no chance to check the EC status and regards it as AE_TIME.
So it will be more appropriate that OS will try to check the EC status again
when timeout happens. If the EC status is what we expect, it won't be regarded
as timeout. Only when the EC status is not what we expect, it will be regarded
as timeout, which means that EC controller can't give a response in time.
http://bugzilla.kernel.org/show_bug.cgi?id=9823
http://bugzilla.kernel.org/show_bug.cgi?id=11141
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/acpi/ec.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -228,6 +228,8 @@ static int acpi_ec_wait(struct acpi_ec *
if (acpi_ec_check_status(ec, event))
goto end;
}
+ if (acpi_ec_check_status(ec,event))
+ return 0;
}
pr_err(PREFIX "acpi_ec_wait timeout,"
" status = %d, expect_event = %d\n",
--
next prev parent reply other threads:[~2008-10-06 23:24 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20081006225949.357365087@mini.kroah.org>
2008-10-06 23:16 ` [patch 00/28] 2.6.25-stable review Greg KH
2008-10-06 23:16 ` [patch 01/28] USB: fix hcd interrupt disabling Greg KH
2008-10-06 23:17 ` [patch 02/28] pxa2xx_spi: dma bugfixes Greg KH
2008-10-07 0:15 ` Ned Forrester
2008-10-06 23:17 ` [patch 03/28] pxa2xx_spi: chipselect bugfixes Greg KH
2008-10-06 23:17 ` [patch 04/28] drivers/mmc/card/block.c: fix refcount leak in mmc_block_open() Greg KH
2008-10-06 23:17 ` [patch 05/28] ALSA: hda - Fix model for Dell Inspiron 1525 Greg KH
2008-10-07 5:55 ` Takashi Iwai
2008-10-09 2:38 ` Greg KH
2008-10-06 23:17 ` [patch 06/28] i2c-dev: Return correct error code on class_create() failure Greg KH
2008-10-06 23:17 ` [patch 07/28] ACPI: Fix thermal shutdowns Greg KH
2008-10-06 23:17 ` [patch 08/28] x86: add io delay quirk for Presario F700 Greg KH
2008-10-06 23:17 ` [patch 09/28] rtc: fix deadlock Greg KH
2008-10-06 23:17 ` Greg KH [this message]
2008-10-06 23:17 ` [patch 11/28] clockevents: prevent clockevent event_handler ending up handler_noop Greg KH
2008-10-06 23:17 ` [patch 12/28] clockevents: prevent endless loop in periodic broadcast handler Greg KH
2008-10-06 23:17 ` [patch 13/28] clockevents: enforce reprogram in oneshot setup Greg KH
2008-10-06 23:17 ` [patch 14/28] clockevents: prevent multiple init/shutdown Greg KH
2008-10-06 23:17 ` [patch 15/28] clockevents: prevent endless loop lockup Greg KH
2008-10-06 23:17 ` [patch 16/28] HPET: make minimum reprogramming delta useful Greg KH
2008-10-06 23:17 ` [patch 17/28] clockevents: broadcast fixup possible waiters Greg KH
2008-10-06 23:17 ` [patch 18/28] x86: HPET fix moronic 32/64bit thinko Greg KH
2008-10-06 23:17 ` [patch 19/28] x86: HPET: read back compare register before reading counter Greg KH
2008-10-06 23:17 ` [patch 20/28] ntp: fix calculation of the next jiffie to trigger RTC sync Greg KH
2008-10-06 23:17 ` [patch 21/28] clockevents: remove WARN_ON which was used to gather information Greg KH
2008-10-06 23:17 ` [patch 22/28] x86: Fix broken LDT access in VMI Greg KH
2008-10-06 23:17 ` [patch 23/28] ipv6: Fix OOPS in ip6_dst_lookup_tail() Greg KH
2008-10-06 23:51 ` Neil Horman
2008-10-06 23:17 ` [patch 24/28] niu: panic on reset Greg KH
2008-10-06 23:17 ` [patch 25/28] netlink: fix overrun in attribute iteration Greg KH
2008-10-06 23:17 ` [patch 26/28] sctp: do not enable peer features if we cant do them Greg KH
2008-10-06 23:17 ` [patch 27/28] sctp: Fix oops when INIT-ACK indicates that peer doesnt support AUTH Greg KH
2008-10-06 23:18 ` [patch 28/28] udp: Fix rcv socket locking Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081006231719.GK20567@suse.de \
--to=gregkh@suse.de \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=cavokz@gmail.com \
--cc=cebbert@redhat.com \
--cc=chuckw@quantumlinux.com \
--cc=davej@redhat.com \
--cc=epprecht@solnet.ch \
--cc=eteo@redhat.com \
--cc=jake@lwn.net \
--cc=jmforbes@linuxtx.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkrufky@linuxtv.org \
--cc=rbranco@la.checkpoint.com \
--cc=rdunlap@xenotime.net \
--cc=reviews@ml.cw.f00f.org \
--cc=rui.zhang@intel.com \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
--cc=w@1wt.eu \
--cc=yakui.zhao@intel.com \
--cc=zwane@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).