RE: [PATCH] Do not hide resource for pci/pcie when configured as Agent/EP
From: Jia Hongtao-B38951 <hidden>
Date: 2011-11-22 06:18:36
Subsystem:
linux for powerpc (32-bit and 64-bit), the rest · Maintainers:
Madhavan Srinivasan, Linus Torvalds
Hi Kumar, We want more comments on this patch to speed up the pushing-to-kernel progr= ess. Thanks. -----Original Message----- From: Jia Hongtao-B38951=20 Sent: Friday, October 28, 2011 4:08 PM To: linuxppc-dev@lists.ozlabs.org Cc: Li Yang-R58472; Gala Kumar-B11780; Jia Hongtao-B38951 Subject: [PATCH] Do not hide resource for pci/pcie when configured as Agent= /EP From: Jason Jin <redacted> Current pci/pcie init code will hide the pci/pcie host resource. But did not judge it is host/RC or agent/EP. If configured as agent/EP, we = should avoid hiding its resource in the host side. In PCI system, the Programing Interface can be used to judge the host/agent= status: Programing Interface =3D 0: host Programing Interface =3D 1: Agent In PCIE system, both the Programing Interface and Header type can be used t= o judge the RC/EP status. Header Type =3D 0: EP Header Type =3D 1: RC Signed-off-by: Jason Jin <redacted> Signed-off-by: Mingkai Hu <redacted> Signed-off-by: Jia Hongtao <redacted> Signed-off-by: Li Yang <redacted> --- arch/powerpc/kernel/pci-common.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-com=mon.c index 4f134132c..bc61a69 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c@@ -1732,10 +1732,13 @@ void __devinit pcibios_scan_phb(struct pci_controll=er *hose) static void fixup_hide_host_resource_fsl(struct pci_dev *dev) {
int i, class =3D dev->class >> 8;
+ /* When configured as agent, programing interface =3D 1 */
+ int prog_if =3D dev->class & 0xf;
=20
if ((class =3D=3D PCI_CLASS_PROCESSOR_POWERPC ||
class =3D=3D PCI_CLASS_BRIDGE_OTHER) &&
(dev->hdr_type =3D=3D PCI_HEADER_TYPE_NORMAL) &&
+ (prog_if =3D=3D 0) &&
(dev->bus->parent =3D=3D NULL)) {
for (i =3D 0; i < DEVICE_COUNT_RESOURCE; i++) {
dev->resource[i].start =3D 0;
--
1.7.5.1