From: Linus Torvalds <torvalds@linux-foundation.org>
To: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>, Greg KH <gregkh@suse.de>,
Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
Len Brown <lenb@kernel.org>,
bugme-daemon@bugzilla.kernel.org
Subject: Re: [Bug 9528] x86: Increase PCIBIOS_MIN_IO to 0x1500 to fix nForce 4 suspend-to-RAM
Date: Sun, 23 Dec 2007 09:53:45 -0800 (PST) [thread overview]
Message-ID: <alpine.LFD.0.9999.0712230933570.21557@woody.linux-foundation.org> (raw)
In-Reply-To: <200712231419.40207.carlos@strangeworlds.co.uk>
On Sun, 23 Dec 2007, Carlos Corbacho wrote:
>
> Fix suspend-to-RAM on nForce 4 (CK804) boards by increasing
> PCIBIOS_MIN_IO.
>
> Fixes kernel bugzilla #9528
>
> Problem:
>
> Linus' patch (52ade9b3b97fd3bea42842a056fe0786c28d0555) to re-order
> suspend (and fix fall out from Rafael's earlier suspend reordering work)
> broke suspend-to-RAM on nForce 4 (CK804) boards.
>
> Why:
>
> After debugging _PTS() in the DSDT, it turns out these nVidia boards are
> trying to write to an IO port > 0x1000 (0x142E) during suspend. Before the
> re-ordering, we got away with this.
Very interesting.
HOWEVER.
I'd much rather figure out what the magic IO resource is that clashes.
It's almost certainly some hidden and undocumented (or badly documented)
ACPI IO area that the kernel doesn't know about, because it's not a
regular PCI BAR resource, but some northbridge (or southbridge) magic
register range.
Those ranges *should* be reserved by the BIOS in the ACPI tables, but this
would definitely not be the first time that doesn't happen.
But the right fix would be for us to just figure out what the range is ass
a PCI quirk, and just know to avoid it on purpose, ratehr than just being
lucky and happen to avoid it because PCIBIOS_MIN_IO just happens to be
bigger than the particular address.
So can you:
- show what your /proc/ioports contains (*with* the bug triggering, ie
non-working suspend, so we see what it is that actually ends up using
that area)
- send out 'dmesg' for a boot (same deal)
- add "lspci -xxxvv" output to the deal too.
and also make them part of the bugzilla history (I'm cc'ing bugzilla here,
and added the bug number to the subject, so hopefully this thread ends up
being archived there too).
> There was some previous work in the PCIBIOS_MIN_IO area over two years ago
> (71db63acff69618b3d9d3114bd061938150e146b) which bumped this to 0x4000,
> but this was reverted (2ba84684e8cf6f980e4e95a2300f53a505eb794e) after
> causing new and entirely different problems on another nForce board.
The problem here is classic: these magic ranges tend to be *different* on
different boards (because they don't tend to be fixed by hardware, they
are programmed regions set up by firmware), so trying to change
PCIBIOS_MIN_IO to avoid a problem on one board is almost certain to just
introduce it on another board instead.
On *your* particular board, 0x142E is used for something, but on somebody
elses board it might be 0x162E, and now changing PCIBIOS_MIN_IO to 0x1500
might make that other board hang instead.
So you seem to have debugged this very successfully, and I'm wondering if
you might be able to find out where that 0x142e comes from, and we could
fix it for *all* boards using that chipset by just figuring out what the
*hardware* rules (rather than the random firmware setup that will be
different on different boards) for that chipset actually are!
For an example of what I mean, see the file "drivers/pci/quirks.c", and
check out the quirks for various chipsets:
- quirk_ali7101_acpi()
Knows about the magic ALI ACPI and SMB OI regions
- quirk_piix4_acpi(), quirk_ich6_lpc_acpi(), quirk_ich4_lpc_acpi()
Same thing for the Intel chipsets
- quirk_vt82c586_acpi(), quirk_vt82c686_acpi()
VIA chipsets
etc etc.
It would be *wonderful* if somebody could figure out what the equivalent
quirks for nVidia chipsets are! Because otherwise we'll just end up
bouncing back and forth between different random IO allocations, and they
are all almost guaranteed to cause the same problems, just on different
boards!
It's sometimes possible to even just guess what the registers are, even if
things are undocumented. In particular, that 142E range is almost
certainly programmed into the host bridge or possibly a "LPC controller"
or similar, and it will probably show up as the bytes "20 14" in the
output from lspci, so we can guess which register it is that sets the
base. That's not *always* how it works, but it's sometimes possible to
guess (although you usually need to see a few different cases of the same
chipset to have any kind of confirmation of the guess).
Linus
next prev parent reply other threads:[~2007-12-23 17:56 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200712231419.40207.carlos@strangeworlds.co.uk>
2007-12-23 16:30 ` Rafael J. Wysocki
2007-12-23 17:57 ` Ingo Molnar
2007-12-23 18:00 ` Linus Torvalds
2007-12-23 22:20 ` Rafael J. Wysocki
2007-12-23 23:12 ` H. Peter Anvin
2007-12-24 0:09 ` Carlos Corbacho
2007-12-24 0:56 ` Linus Torvalds
2007-12-24 1:14 ` Linus Torvalds
2007-12-24 3:05 ` Carlos Corbacho
2007-12-24 13:44 ` Rafael J. Wysocki
2007-12-24 18:34 ` Linus Torvalds
2007-12-24 21:53 ` Carlos Corbacho
2007-12-25 16:13 ` Suspend code ordering (again) (was: Re: x86: Increase PCIBIOS_MIN_IO to 0x1500 to fix nForce 4 suspend-to-RAM) Rafael J. Wysocki
2007-12-26 4:11 ` Linus Torvalds
2007-12-26 15:07 ` Rafael J. Wysocki
2007-12-26 15:24 ` Suspend code ordering (again) Alexey Starikovskiy
2007-12-26 17:50 ` H. Peter Anvin
2007-12-25 12:12 ` x86: Increase PCIBIOS_MIN_IO to 0x1500 to fix nForce 4 suspend-to-RAM Pavel Machek
2007-12-25 12:28 ` Carlos Corbacho
2007-12-23 17:53 ` Linus Torvalds [this message]
2007-12-23 17:58 ` [Bug 9528] " Linus Torvalds
2007-12-23 19:19 ` Ingo Molnar
2007-12-23 19:29 ` Linus Torvalds
2007-12-23 20:43 ` Yinghai Lu
[not found] <fa.Tr7qmPdet0rF2FSRX/94s2UEMSE@ifi.uio.no>
[not found] ` <fa.n/XQFa64Zg8snHoyB/rrKzCvAL0@ifi.uio.no>
2007-12-24 16:59 ` Robert Hancock
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=alpine.LFD.0.9999.0712230933570.21557@woody.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=bugme-daemon@bugzilla.kernel.org \
--cc=carlos@strangeworlds.co.uk \
--cc=gregkh@suse.de \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--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
all inboxes | Powered by JetHome®