From: Andreas Herrmann <andreas.herrmann3@amd.com>
To: Manoj Iyer <manoj.iyer@canonical.com>,
"James C. Georgas" <james.georgas@yahoo.ca>
Cc: Borislav Petkov <bp@amd64.org>,
Matthew Garrett <mjg59@srcf.ucam.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] Quirk to fix suspend/resume on Lenovo Edge 11,13,14,15
Date: Fri, 28 Jan 2011 18:59:10 +0100 [thread overview]
Message-ID: <20110128175910.GB4599@alberich.amd.com> (raw)
In-Reply-To: <AANLkTik7DgsmFv1KN6r92jai-Git5G9+kQLF9J0u=6e0@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2353 bytes --]
On Fri, Jan 14, 2011 at 02:55:30PM -0500, Manoj Iyer wrote:
> Borislav,
>
> Any more thoughts on this one ?
Seems that we've identified the root cause.
I wondered why systems with the problem have configured IOAPIC pin
with polarity=1 (low active). That was different to what the working
systems used.
Switching the configuration to the usual polarity=0 (high active)
fixed the issue.
The explanation is that when hpet interrupt is triggerd, signal goes
from low to high. (AFAIK HPET spec even mentions that HPET interrupts
are all active high.)
Now if IO-APIC pin is configured as low active it just ignores this
signal change. It just triggers later when for next interrupt signal
will go from high to low and high again. (That happens the first time
after resume when the HPET counter wrapped around.)
Setting the correct polarity fixes the detection of the first hpet
interrupt after resume.
To confirm that your systems behave similar you should boot with
"apic=debug" kernel parameter. The output for IO APIC should show
polarity=1 for IO APIC pin 2, e.g.
[ 0.158179] IO APIC #2......
...
[ 0.158205] NR Dst Mask Trig IRR Pol Stat Dmod Deli Vect:
[ 0.158210] 00 000 1 0 0 0 0 0 0 00
[ 0.158217] 01 003 0 0 0 0 0 1 1 31
[ 0.158224] 02 003 0 0 0 1 0 1 1 30
Furthermore you can check with attached test patch whether changing
the polarity fixes the problem on your system. IO APIC debug output
with this patch should change to
[ 0.156170] IO APIC #2......
...
[ 0.156197] NR Dst Mask Trig IRR Pol Stat Dmod Deli Vect:
[ 0.156202] 00 000 1 0 0 0 0 0 0 00
[ 0.156209] 01 003 0 0 0 0 0 1 1 31
[ 0.156216] 02 003 0 0 0 0 0 1 1 30
I'll come up with an SB800 quirk asap. (Of course we'll also try to
fix the respective BIOSes but too often BIOS updates are only
available for a limited time period.)
Regards,
Andreas
--
Operating | Advanced Micro Devices GmbH
System | Einsteinring 24, 85609 Dornach b. München, Germany
Research | Geschäftsführer: Alberto Bozzo, Andrew Bowd
Center | Sitz: Dornach, Gemeinde Aschheim, Landkreis München
(OSRC) | Registergericht München, HRB Nr. 43632
[-- Attachment #2: polarity-fix.diff --]
[-- Type: text/plain, Size: 549 bytes --]
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 697dc34..9bf2b87 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1365,6 +1365,10 @@ static void setup_ioapic_irq(int apic_id, int pin, unsigned int irq,
apic_id, mp_ioapics[apic_id].apicid, pin, cfg->vector,
irq, trigger, polarity);
+ if (pin == 2) {
+ polarity = 0;
+ trigger = 0;
+ }
if (setup_ioapic_entry(mp_ioapics[apic_id].apicid, irq, &entry,
dest, trigger, polarity, cfg->vector, pin)) {
next prev parent reply other threads:[~2011-01-28 17:59 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-13 16:02 [PATCH 0/1] Quirk to fix suspend/resume on Lenovo Edge 11,13,14,15 Manoj Iyer
2011-01-13 16:02 ` [PATCH] " Manoj Iyer
2011-01-13 16:46 ` Matthew Garrett
2011-01-13 17:10 ` Thomas Gleixner
2011-01-13 17:22 ` Borislav Petkov
2011-01-13 17:33 ` Manoj Iyer
2011-01-13 17:55 ` Borislav Petkov
2011-01-13 18:11 ` Manoj Iyer
2011-01-13 18:30 ` Borislav Petkov
2011-01-13 18:51 ` Thomas Gleixner
2011-01-13 18:58 ` Matthew Garrett
2011-01-13 19:07 ` Borislav Petkov
2011-01-13 19:13 ` Thomas Gleixner
2011-01-13 19:28 ` Borislav Petkov
2011-01-13 19:41 ` Thomas Gleixner
2011-01-13 20:33 ` Manoj Iyer
2011-01-13 21:12 ` Manoj Iyer
2011-01-13 21:40 ` Thomas Gleixner
2011-01-13 21:48 ` Manoj Iyer
2011-01-13 22:40 ` Thomas Gleixner
2011-01-13 21:09 ` Borislav Petkov
2011-01-13 21:30 ` Thomas Gleixner
2011-01-13 21:48 ` Borislav Petkov
2011-01-13 22:55 ` Thomas Gleixner
2011-01-14 19:55 ` Manoj Iyer
2011-01-14 21:41 ` Borislav Petkov
2011-01-28 17:59 ` Andreas Herrmann [this message]
2011-01-31 16:44 ` Manoj Iyer
2011-01-31 17:54 ` Manoj Iyer
2011-01-13 19:11 ` Thomas Gleixner
2011-01-13 18:57 ` Manoj Iyer
2011-01-13 17:39 ` Matthew Garrett
[not found] ` <AANLkTimk_Y4Q_cxg1SJxZiTT2gT9ywr5UGmsqPqwmeCy@mail.gmail.com>
2011-01-13 17:56 ` Matthew Garrett
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=20110128175910.GB4599@alberich.amd.com \
--to=andreas.herrmann3@amd.com \
--cc=bp@amd64.org \
--cc=james.georgas@yahoo.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=manoj.iyer@canonical.com \
--cc=mjg59@srcf.ucam.org \
--cc=rjw@sisk.pl \
--cc=tglx@linutronix.de \
/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