linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Do not hide resource for pci/pcie when configured as Agent/EP
@ 2011-10-28  8:08 Jia Hongtao
  2011-11-22  6:18 ` Jia Hongtao-B38951
  2011-11-24  5:04 ` Kumar Gala
  0 siblings, 2 replies; 3+ messages in thread
From: Jia Hongtao @ 2011-10-28  8:08 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: B11780, b38951

From: Jason Jin <Jason.jin@freescale.com>

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 = 0: host
Programing Interface = 1: Agent

In PCIE system, both the Programing Interface and Header type can
be used to judge the RC/EP status.
Header Type = 0: EP
Header Type = 1: RC

Signed-off-by: Jason Jin <Jason.jin@freescale.com>
Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com>
Signed-off-by: Jia Hongtao <B38951@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
---
 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-common.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_controller *hose)
 static void fixup_hide_host_resource_fsl(struct pci_dev *dev)
 {
 	int i, class = dev->class >> 8;
+	/* When configured as agent, programing interface = 1 */
+	int prog_if = dev->class & 0xf;
 
 	if ((class == PCI_CLASS_PROCESSOR_POWERPC ||
 	     class == PCI_CLASS_BRIDGE_OTHER) &&
 		(dev->hdr_type == PCI_HEADER_TYPE_NORMAL) &&
+		(prog_if == 0) &&
 		(dev->bus->parent == NULL)) {
 		for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
 			dev->resource[i].start = 0;
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] Do not hide resource for pci/pcie when configured as Agent/EP
  2011-10-28  8:08 [PATCH] Do not hide resource for pci/pcie when configured as Agent/EP Jia Hongtao
@ 2011-11-22  6:18 ` Jia Hongtao-B38951
  2011-11-24  5:04 ` Kumar Gala
  1 sibling, 0 replies; 3+ messages in thread
From: Jia Hongtao-B38951 @ 2011-11-22  6:18 UTC (permalink / raw)
  To: Gala Kumar-B11780
  Cc: linuxppc-dev@lists.ozlabs.org, Li Yang-R58472, Jia Hongtao-B38951

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 <Jason.jin@freescale.com>

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 <Jason.jin@freescale.com>
Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com>
Signed-off-by: Jia Hongtao <B38951@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Do not hide resource for pci/pcie when configured as Agent/EP
  2011-10-28  8:08 [PATCH] Do not hide resource for pci/pcie when configured as Agent/EP Jia Hongtao
  2011-11-22  6:18 ` Jia Hongtao-B38951
@ 2011-11-24  5:04 ` Kumar Gala
  1 sibling, 0 replies; 3+ messages in thread
From: Kumar Gala @ 2011-11-24  5:04 UTC (permalink / raw)
  To: Jia Hongtao; +Cc: B11780, linuxppc-dev


On Oct 28, 2011, at 3:08 AM, Jia Hongtao wrote:

> From: Jason Jin <Jason.jin@freescale.com>
> 
> 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 = 0: host
> Programing Interface = 1: Agent
> 
> In PCIE system, both the Programing Interface and Header type can
> be used to judge the RC/EP status.
> Header Type = 0: EP
> Header Type = 1: RC
> 
> Signed-off-by: Jason Jin <Jason.jin@freescale.com>
> Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com>
> Signed-off-by: Jia Hongtao <B38951@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> ---
> arch/powerpc/kernel/pci-common.c |    3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)

applied to next

- k

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-24  5:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-28  8:08 [PATCH] Do not hide resource for pci/pcie when configured as Agent/EP Jia Hongtao
2011-11-22  6:18 ` Jia Hongtao-B38951
2011-11-24  5:04 ` Kumar Gala

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).