All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Yinghai <yinghai.lu@oracle.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>,
	Graham Ramsey <ramsey.graham@ntlworld.com>,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	bugzilla-daemon@bugzilla.kernel.org,
	Myron Stowe <myron.stowe@hp.com>,
	Robert Richter <robert.richter@amd.com>,
	Harald Welte <HaraldWelte@viatech.com>,
	Joseph Chan <JosephChan@via.com.tw>
Subject: Re: [Bug 16007] x86/pci Oops with CONFIG_SND_HDA_INTEL
Date: Fri, 11 Jun 2010 15:49:04 -0600	[thread overview]
Message-ID: <201006111549.05164.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <201006021058.57361.bjorn.helgaas@hp.com>

[If you haven't been following this bug, the report is at [3].]

Here's a theory.  I'm not an expert in HyperTransport, so maybe somebody
who knows HyperTransport and/or VIA chipsets can validate or refute it.

This is based on the _HyperTransport I/O Link Specification_, rev 3.10b [1],
and the _BIOS and Kernel Developer's Guide (BKDG) for AMD Family 10h
Processors_ [2].

In a nutshell, I think the problem is that amd_bus.c treats a
HyperTransport (HT) host bridge as though it were a PCI host bridge.  In
particular, when an HT chain contains more than one PCI host bridge, the
HT host bridge apertures encompass all the PCI host bridges, but
amd_bus.c mistakenly assigns all those resources to one PCI host bridge.

>From a software point of view, HyperTransport is similar but not
identical to PCI.  It is possible to make native HyperTransport
peripheral devices, but PCI devices must be attached via a
HyperTransport-to-PCI bridge [1, sec 4.1].

A PCI host bridge has a platform-specific non-PCI connection, e.g., a
front-side bus, on the primary (upstream) side and a PCI bus on the
secondary (downstream) side.  Note that in the HyperTransport spec,
"host bridge" refers to the interface from the host, e.g., CPU cores, to
a HyperTransport chain.  This HyperTransport host bridge has a
HyperTransport link on the secondary side, *not* a PCI bus.

A HyperTransport-to-PCI bridge is one kind of PCI host bridge, because
the primary side is HyperTransport and the secondary side is PCI.

Graham's machine contains one HT host bridge leading to an HT chain, and
it has PCI devices on buses 00, 02, 03, 06, and 80.  In addition, the HT
host bridge configuration registers appear at device 18 (hex) in bus 00
configuration space, though they are not actually PCI functions.  PCI
buses 02, 03, and 06 are reachable from bus 00 via the PCI-to-PCI
bridges at 00:03.3, 00:03.2, and 00:02.0, respectively.

However, there are no PCI-to-PCI bridges that lead to bus 00 or bus 80,
so the HT chain must contain two separate PCI host bridges that lead to
them.

Now, here's the problem: amd_bus.c reads the HT host bridge configuration
and learns that it routes buses 00-ff and the related address space,
including the following range, down the HT chain at node 0, link 0:

    [mem 0x80000000-0xfcffffffff]

That makes sense, because both PCI host bridges are on that HT chain, so
the HT host bridge has to forward all that address space.  The problem
is that amd_bus.c assumes there's only one PCI host bridge on the
chain, so it assigns *all* that address space to PCI bus 00.

This doesn't work because parts of that address space belong to bus 80,
not bus 00, and we can't reach bus 80 from PCI bus 00.  In particular,
we know that at least the following address space is routed to bus 80,
because the 80:01.0 device does work at this address, which is in the
middle of the range we found above:

    [mem 0xfebfc000-0xfebfffff]

(Note that we can reach bus 80 from the HT chain, but the HT chain is
outside the PCI domain, even though some of the HT registers appear in
PCI bus 00 config space.  We need a second PCI host bridge from the HT
chain to PCI bus 80.)

The HT spec does suggest that an HT/PCI host bridge should implement a
HyperTransport Bridge Header [1, sec 7.4].  This header would make the
HT/PCI host bridge look just like a PCI-to-PCI bridge, with the usual
primary/secondary/subordinate bus numbers, memory, prefetchable memory,
and I/O port apertures, etc.

If all the HT/PCI host bridges on a chain were implemented this way, I
think it probably would work to pretend the HT host bridge is a PCI host
bridge.  But this sort of implementation is apparently not universal.
The VIA chipset in Graham's machine doesn't do it that way, and the
Serverworks HT-2100 chipset in the HP DL785 doesn't either.


[1] http://www.hypertransport.org/docs/twgdocs/HTC20051222-0046-0033_changes.pdf
[2] http://support.amd.com/us/Embedded_TechDocs/31116-Public-GH-BKDG_3-28_5-28-09.pdf
[3] https://bugzilla.kernel.org/show_bug.cgi?id=16007

  reply	other threads:[~2010-06-11 21:49 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-19 15:13 x86/pci Oops with CONFIG_SND_HDA_INTEL Graham Ramsey
2010-05-19 16:44 ` Bjorn Helgaas
2010-05-19 17:16   ` Graham Ramsey
2010-05-19 18:01     ` Yinghai
2010-05-19 22:47       ` Graham Ramsey
2010-05-20  0:03         ` Yinghai
2010-05-20  0:22           ` Jesse Barnes
2010-05-20  0:36             ` Yinghai
2010-05-20 17:08               ` [Bug 16007] " Bjorn Helgaas
2010-06-02 16:58                 ` Bjorn Helgaas
2010-06-11 21:49                   ` Bjorn Helgaas [this message]
2010-06-11 22:08                     ` Yinghai Lu
2010-06-11 23:06                     ` Yinghai Lu
2010-06-14 14:18                       ` Bjorn Helgaas
2010-06-14 17:47                       ` [PATCH -v2] x86, pci: Handle fallout pci devices with peer root bus Yinghai Lu
2010-06-14 18:14                         ` Jesse Barnes
2010-06-14 18:22                           ` Yinghai Lu
2010-06-14 18:34                         ` Bjorn Helgaas
2010-06-14 18:39                           ` H. Peter Anvin
2010-06-14 18:55                             ` Yinghai Lu
2010-06-14 20:00                               ` Bjorn Helgaas
2010-06-14 20:08                                 ` H. Peter Anvin
2010-06-14 20:20                                   ` Bjorn Helgaas
2010-06-14 21:10                                     ` H. Peter Anvin
2010-06-15  1:49                                       ` Bjorn Helgaas
2010-06-15  1:56                                         ` H. Peter Anvin
2010-06-15 15:30                                           ` Bjorn Helgaas
2010-06-14 19:43                             ` Bjorn Helgaas
2010-06-21 17:28                       ` [Bug 16007] x86/pci Oops with CONFIG_SND_HDA_INTEL Bjorn Helgaas
2010-06-13 14:45 2.6.35-rc3: Reported regressions 2.6.33 -> 2.6.34 Rafael J. Wysocki
2010-06-13 14:49 ` [Bug #16007] x86/pci Oops with CONFIG_SND_HDA_INTEL Rafael J. Wysocki
2010-06-13 14:49   ` Rafael J. Wysocki
2010-06-20 22:32 2.6.35-rc3: Reported regressions 2.6.33 -> 2.6.34 Rafael J. Wysocki
2010-06-20 22:34 ` [Bug #16007] x86/pci Oops with CONFIG_SND_HDA_INTEL Rafael J. Wysocki
2010-07-10  0:24 2.6.35-rc4-git4: Reported regressions 2.6.33 -> 2.6.34 Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #16007] x86/pci Oops with CONFIG_SND_HDA_INTEL Rafael J. Wysocki
2010-07-23 12:11 2.6.35-rc6: Reported regressions 2.6.33 -> 2.6.34 Rafael J. Wysocki
2010-07-23 12:15 ` [Bug #16007] x86/pci Oops with CONFIG_SND_HDA_INTEL Rafael J. Wysocki
2010-07-23 12:15   ` Rafael J. Wysocki
2010-07-23 14:20   ` Bjorn Helgaas
2010-07-23 19:51     ` Rafael J. Wysocki
2010-08-01 14:27 2.6.35-rc6-git6: Reported regressions 2.6.33 -> 2.6.34 Rafael J. Wysocki
2010-08-01 14:44 ` [Bug #16007] x86/pci Oops with CONFIG_SND_HDA_INTEL Rafael J. Wysocki

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=201006111549.05164.bjorn.helgaas@hp.com \
    --to=bjorn.helgaas@hp.com \
    --cc=HaraldWelte@viatech.com \
    --cc=JosephChan@via.com.tw \
    --cc=bugzilla-daemon@bugzilla.kernel.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=myron.stowe@hp.com \
    --cc=ramsey.graham@ntlworld.com \
    --cc=robert.richter@amd.com \
    --cc=yinghai.lu@oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.