Power supply for PCI inbound/outbound window registers is off when system
go to deep-sleep state. We save the values of registers before suspend
and restore to registers after resume.
Signed-off-by: Jiang Yutang <redacted>
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
Changes for V4:
We just rebase the patch upon following patch:
powerpc/fsl-pci: Unify pci/pcie initialization code
arch/powerpc/include/asm/pci-bridge.h | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 121 +++++++++++++++++++++++++++++++++
2 files changed, 122 insertions(+), 1 deletions(-)
@@ -89,9 +89,9 @@ struct pci_controller {#ifdef CONFIG_PPC64unsignedlongbuid;+#endif /* CONFIG_PPC64 */void*private_data;-#endif /* CONFIG_PPC64 */};/* These are used for config access before all the PCI probing
From: Kumar Gala <hidden> Date: 2012-09-18 05:03:38
On Sep 17, 2012, at 9:10 PM, Jia Hongtao wrote:
Power supply for PCI inbound/outbound window registers is off when =
system
go to deep-sleep state. We save the values of registers before suspend
and restore to registers after resume.
=20
Signed-off-by: Jiang Yutang <redacted>
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
Changes for V4:
We just rebase the patch upon following patch:
powerpc/fsl-pci: Unify pci/pcie initialization code
=20
arch/powerpc/include/asm/pci-bridge.h | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 121 =
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Tuesday, September 18, 2012 1:04 PM
To: Jia Hongtao-B38951
Cc: linuxppc-dev@lists.ozlabs.org; Li Yang-R58472; Wood Scott-B07421
Subject: Re: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM
support
=20
=20
On Sep 17, 2012, at 9:10 PM, Jia Hongtao wrote:
=20
quoted
Power supply for PCI inbound/outbound window registers is off when
system go to deep-sleep state. We save the values of registers before
suspend and restore to registers after resume.
Signed-off-by: Jiang Yutang <redacted>
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
Changes for V4:
We just rebase the patch upon following patch:
powerpc/fsl-pci: Unify pci/pcie initialization code
arch/powerpc/include/asm/pci-bridge.h | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 121
=20
Did you ever compare this to just re-parsing device tree method?
=20
- k
I tested the re-parsing way by using setup_pci_atmu() when resume.
And I found out that re-parsing will *change* outbound IO translation
address regitster.
It seems that in the first bootup, after setup_atmu()
pcibios_setup_phb_resources() may update hose->io_resource, but atmu
is not updated according to the new hose->io_resource value.
In resume from sleep setup_atmu() will reset atmu according to the
new hose->io_resource value. So the setup_atmu() will cause different
result on outbound IO register between first bootup and resume from
sleep.
So... There's a possibility that in the first bootup atmu is not setup
properly.
Anyway, if setup_pci_atmu() at resume is functionally right then re-parsing
is a good way for PM. I also test the latency of re-parsing and save/restor=
e,
both way are acceptable.
- Hongtao.
From: Kumar Gala <hidden> Date: 2012-09-19 14:27:35
On Sep 19, 2012, at 2:10 AM, Jia Hongtao-B38951 wrote:
=20
=20
quoted
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Tuesday, September 18, 2012 1:04 PM
To: Jia Hongtao-B38951
Cc: linuxppc-dev@lists.ozlabs.org; Li Yang-R58472; Wood Scott-B07421
Subject: Re: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM
support
=20
=20
On Sep 17, 2012, at 9:10 PM, Jia Hongtao wrote:
=20
quoted
Power supply for PCI inbound/outbound window registers is off when
system go to deep-sleep state. We save the values of registers =
before
quoted
quoted
suspend and restore to registers after resume.
=20
Signed-off-by: Jiang Yutang <redacted>
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
Changes for V4:
We just rebase the patch upon following patch:
powerpc/fsl-pci: Unify pci/pcie initialization code
=20
arch/powerpc/include/asm/pci-bridge.h | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 121
=20
Did you ever compare this to just re-parsing device tree method?
=20
- k
=20
I tested the re-parsing way by using setup_pci_atmu() when resume.
And I found out that re-parsing will *change* outbound IO translation
address regitster.
=20
It seems that in the first bootup, after setup_atmu()
pcibios_setup_phb_resources() may update hose->io_resource, but atmu
is not updated according to the new hose->io_resource value.
In resume from sleep setup_atmu() will reset atmu according to the
new hose->io_resource value. So the setup_atmu() will cause different
result on outbound IO register between first bootup and resume from
sleep.
=20
So... There's a possibility that in the first bootup atmu is not setup
properly.
Are you seeing this happen in your testing? If so its a bug we need to =
look at fixing.
=20
Anyway, if setup_pci_atmu() at resume is functionally right then =
re-parsing
is a good way for PM. I also test the latency of re-parsing and =
=0A=
________________________________________=0A=
From: Kumar Gala [galak@kernel.crashing.org]=0A=
Sent: Wednesday, September 19, 2012 10:27 PM=0A=
To: Jia Hongtao-B38951=0A=
Cc: linuxppc-dev@lists.ozlabs.org; Li Yang-R58472; Wood Scott-B07421=0A=
Subject: Re: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM suppo=
rt=0A=
=0A=
On Sep 19, 2012, at 2:10 AM, Jia Hongtao-B38951 wrote:=0A=
=0A=
=0A=
=0A=
quoted
-----Original Message-----=0A=
From: Kumar Gala [mailto:galak@kernel.crashing.org]=0A=
Sent: Tuesday, September 18, 2012 1:04 PM=0A=
To: Jia Hongtao-B38951=0A=
Cc: linuxppc-dev@lists.ozlabs.org; Li Yang-R58472; Wood Scott-B07421=0A=
Subject: Re: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM=0A=
support=0A=
=0A=
=0A=
On Sep 17, 2012, at 9:10 PM, Jia Hongtao wrote:=0A=
=0A=
quoted
Power supply for PCI inbound/outbound window registers is off when=0A=
system go to deep-sleep state. We save the values of registers before=
=0A=
quoted
quoted
suspend and restore to registers after resume.=0A=
=0A=
Signed-off-by: Jiang Yutang <redacted>=0A=
Signed-off-by: Jia Hongtao <redacted>=0A=
Signed-off-by: Li Yang <redacted>=0A=
---=0A=
Changes for V4:=0A=
We just rebase the patch upon following patch:=0A=
powerpc/fsl-pci: Unify pci/pcie initialization code=0A=
=0A=
arch/powerpc/include/asm/pci-bridge.h | 2 +-=0A=
arch/powerpc/sysdev/fsl_pci.c | 121=0A=
=0A=
Did you ever compare this to just re-parsing device tree method?=0A=
=0A=
- k=0A=
=0A=
I tested the re-parsing way by using setup_pci_atmu() when resume.=0A=
And I found out that re-parsing will *change* outbound IO translation=0A=
address regitster.=0A=
=0A=
It seems that in the first bootup, after setup_atmu()=0A=
pcibios_setup_phb_resources() may update hose->io_resource, but atmu=0A=
is not updated according to the new hose->io_resource value.=0A=
In resume from sleep setup_atmu() will reset atmu according to the=0A=
new hose->io_resource value. So the setup_atmu() will cause different=0A=
result on outbound IO register between first bootup and resume from=0A=
sleep.=0A=
=0A=
So... There's a possibility that in the first bootup atmu is not setup=0A=
properly.=0A=
=0A=
[Are you seeing this happen in your testing? If so its a bug we need to lo=
ok at fixing.]=0A=
=0A=
Yes, I see this in my testing.=0A=
Also PCIe ethernet card works well after resuming from sleep in both save/r=
estore=0A=
and re-parsing way. (Maybe PCIe ethernet card don't need outbound IO resour=
ce)=0A=
So, I guess the result of re-parsing (actually it's re-setup) is right and =
ATMU is not setup=0A=
properly at the first bootup.=0A=
=0A=
=0A=
=0A=
=0A=
Anyway, if setup_pci_atmu() at resume is functionally right then re-parsi=
ng=0A=
is a good way for PM. I also test the latency of re-parsing and save/rest=
ore,=0A=
both way are acceptable.=0A=
=0A=
=0A=
- Hongtao.=0A=
From: Kumar Gala <hidden> Date: 2012-09-19 15:49:51
quoted
quoted
On Sep 17, 2012, at 9:10 PM, Jia Hongtao wrote:
=20
quoted
Power supply for PCI inbound/outbound window registers is off when
system go to deep-sleep state. We save the values of registers =
before
quoted
quoted
quoted
suspend and restore to registers after resume.
=20
Signed-off-by: Jiang Yutang <redacted>
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
Changes for V4:
We just rebase the patch upon following patch:
powerpc/fsl-pci: Unify pci/pcie initialization code
=20
arch/powerpc/include/asm/pci-bridge.h | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 121
=20
Did you ever compare this to just re-parsing device tree method?
=20
- k
=20
I tested the re-parsing way by using setup_pci_atmu() when resume.
And I found out that re-parsing will *change* outbound IO translation
address regitster.
=20
It seems that in the first bootup, after setup_atmu()
pcibios_setup_phb_resources() may update hose->io_resource, but atmu
is not updated according to the new hose->io_resource value.
In resume from sleep setup_atmu() will reset atmu according to the
new hose->io_resource value. So the setup_atmu() will cause different
result on outbound IO register between first bootup and resume from
sleep.
=20
So... There's a possibility that in the first bootup atmu is not =
setup
quoted
properly.
=20
[Are you seeing this happen in your testing? If so its a bug we need =
to look at fixing.]
=20
Yes, I see this in my testing.
Also PCIe ethernet card works well after resuming from sleep in both =
save/restore
and re-parsing way. (Maybe PCIe ethernet card don't need outbound IO =
resource)
So, I guess the result of re-parsing (actually it's re-setup) is right =
and ATMU is not setup
properly at the first bootup.
Are you seeing the following message - "PCI: I/O resource not set for =
host bridge" ?
Trying to understand why you'd hit the reassignment of io_resource.
- k
=20
=20
=20
quoted
=20
Anyway, if setup_pci_atmu() at resume is functionally right then =
re-parsing
quoted
is a good way for PM. I also test the latency of re-parsing and =
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Wednesday, September 19, 2012 11:49 PM
To: Jia Hongtao-B38951
Cc: linuxppc-dev@lists.ozlabs.org; Li Yang-R58472; Wood Scott-B07421
Subject: Re: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM
support
=20
quoted
quoted
quoted
On Sep 17, 2012, at 9:10 PM, Jia Hongtao wrote:
quoted
Power supply for PCI inbound/outbound window registers is off when
system go to deep-sleep state. We save the values of registers
before
quoted
quoted
quoted
quoted
suspend and restore to registers after resume.
Signed-off-by: Jiang Yutang <redacted>
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
Changes for V4:
We just rebase the patch upon following patch:
powerpc/fsl-pci: Unify pci/pcie initialization code
arch/powerpc/include/asm/pci-bridge.h | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 121
Did you ever compare this to just re-parsing device tree method?
- k
I tested the re-parsing way by using setup_pci_atmu() when resume.
And I found out that re-parsing will *change* outbound IO translation
address regitster.
It seems that in the first bootup, after setup_atmu()
pcibios_setup_phb_resources() may update hose->io_resource, but atmu
is not updated according to the new hose->io_resource value.
In resume from sleep setup_atmu() will reset atmu according to the
new hose->io_resource value. So the setup_atmu() will cause different
result on outbound IO register between first bootup and resume from
sleep.
So... There's a possibility that in the first bootup atmu is not setup
properly.
[Are you seeing this happen in your testing? If so its a bug we need
to look at fixing.]
quoted
Yes, I see this in my testing.
Also PCIe ethernet card works well after resuming from sleep in both
save/restore
quoted
and re-parsing way. (Maybe PCIe ethernet card don't need outbound IO
resource)
quoted
So, I guess the result of re-parsing (actually it's re-setup) is right
and ATMU is not setup
quoted
properly at the first bootup.
=20
Are you seeing the following message - "PCI: I/O resource not set for
host bridge" ?
No.
=20
Trying to understand why you'd hit the reassignment of io_resource.
=20
- k
=20
I did some investigations and the conclusion is:
io_resource.flags & IORESOURCE_IO are both positive but io_resource.start
is 0 before pcibios_setup_phb_io_space() is done.
The sequence of related process listed below:
fsl_add_bridge() -> setup_pci_atmu()
pcibios_init() -> pcibios_scan_phb() -> pcibios_setup_phb_io_space()
Because fsl_add_bridge() must be finished before pcibios_init() so ATMU
is set when io_resource.start is 0. That means outbound IO regs are not
set.
If system re-setup ATMU the io_resource.start has already updated so
outbound IO regs are set.
My question is:
Is there any problem if outbound IO regs are not set in first bootup?
- Hongtao.
From: Li Yang-R58472 <hidden> Date: 2012-09-21 03:50:56
-----Original Message-----
From: Jia Hongtao-B38951
Sent: Friday, September 21, 2012 11:14 AM
To: Kumar Gala
Cc: linuxppc-dev@lists.ozlabs.org; Li Yang-R58472; Wood Scott-B07421
Subject: RE: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM
support
=20
=20
=20
quoted
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Wednesday, September 19, 2012 11:49 PM
To: Jia Hongtao-B38951
Cc: linuxppc-dev@lists.ozlabs.org; Li Yang-R58472; Wood Scott-B07421
Subject: Re: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM
support
quoted
quoted
quoted
On Sep 17, 2012, at 9:10 PM, Jia Hongtao wrote:
quoted
Power supply for PCI inbound/outbound window registers is off
when system go to deep-sleep state. We save the values of
registers
before
quoted
quoted
quoted
quoted
suspend and restore to registers after resume.
Signed-off-by: Jiang Yutang <redacted>
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
Changes for V4:
We just rebase the patch upon following patch:
powerpc/fsl-pci: Unify pci/pcie initialization code
arch/powerpc/include/asm/pci-bridge.h | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 121
Did you ever compare this to just re-parsing device tree method?
- k
I tested the re-parsing way by using setup_pci_atmu() when resume.
And I found out that re-parsing will *change* outbound IO
translation address regitster.
It seems that in the first bootup, after setup_atmu()
pcibios_setup_phb_resources() may update hose->io_resource, but
atmu is not updated according to the new hose->io_resource value.
In resume from sleep setup_atmu() will reset atmu according to the
new hose->io_resource value. So the setup_atmu() will cause
different result on outbound IO register between first bootup and
resume from sleep.
So... There's a possibility that in the first bootup atmu is not
setup properly.
[Are you seeing this happen in your testing? If so its a bug we
need
to look at fixing.]
quoted
Yes, I see this in my testing.
Also PCIe ethernet card works well after resuming from sleep in both
save/restore
quoted
and re-parsing way. (Maybe PCIe ethernet card don't need outbound IO
resource)
quoted
So, I guess the result of re-parsing (actually it's re-setup) is
right
and ATMU is not setup
quoted
properly at the first bootup.
Are you seeing the following message - "PCI: I/O resource not set for
host bridge" ?
=20
No.
=20
quoted
Trying to understand why you'd hit the reassignment of io_resource.
- k
=20
I did some investigations and the conclusion is:
=20
io_resource.flags & IORESOURCE_IO are both positive but io_resource.start
is 0 before pcibios_setup_phb_io_space() is done.
=20
The sequence of related process listed below:
fsl_add_bridge() -> setup_pci_atmu()
pcibios_init() -> pcibios_scan_phb() -> pcibios_setup_phb_io_space()
=20
Because fsl_add_bridge() must be finished before pcibios_init() so ATMU
is set when io_resource.start is 0. That means outbound IO regs are not
set.
=20
If system re-setup ATMU the io_resource.start has already updated so
outbound IO regs are set.
=20
My question is:
Is there any problem if outbound IO regs are not set in first bootup?
Please also provide the IO resource address range before and after the pci =
scan. Then we can evaluate if the range is needed to be mapped via ATMU.
Leo
-----Original Message-----
From: Li Yang-R58472
Sent: Friday, September 21, 2012 11:51 AM
To: Jia Hongtao-B38951; Kumar Gala
Cc: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421
Subject: RE: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM
support
=20
=20
=20
quoted
-----Original Message-----
From: Jia Hongtao-B38951
Sent: Friday, September 21, 2012 11:14 AM
To: Kumar Gala
Cc: linuxppc-dev@lists.ozlabs.org; Li Yang-R58472; Wood Scott-B07421
Subject: RE: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM
support
quoted
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Wednesday, September 19, 2012 11:49 PM
To: Jia Hongtao-B38951
Cc: linuxppc-dev@lists.ozlabs.org; Li Yang-R58472; Wood Scott-B07421
Subject: Re: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound
PM support
quoted
quoted
quoted
On Sep 17, 2012, at 9:10 PM, Jia Hongtao wrote:
quoted
Power supply for PCI inbound/outbound window registers is off
when system go to deep-sleep state. We save the values of
registers
before
quoted
quoted
quoted
quoted
suspend and restore to registers after resume.
Signed-off-by: Jiang Yutang <redacted>
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
Changes for V4:
We just rebase the patch upon following patch:
powerpc/fsl-pci: Unify pci/pcie initialization code
arch/powerpc/include/asm/pci-bridge.h | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 121
Did you ever compare this to just re-parsing device tree method?
- k
I tested the re-parsing way by using setup_pci_atmu() when resume.
And I found out that re-parsing will *change* outbound IO
translation address regitster.
It seems that in the first bootup, after setup_atmu()
pcibios_setup_phb_resources() may update hose->io_resource, but
atmu is not updated according to the new hose->io_resource value.
In resume from sleep setup_atmu() will reset atmu according to
the new hose->io_resource value. So the setup_atmu() will cause
different result on outbound IO register between first bootup and
resume from sleep.
So... There's a possibility that in the first bootup atmu is not
setup properly.
[Are you seeing this happen in your testing? If so its a bug we
need
to look at fixing.]
quoted
Yes, I see this in my testing.
Also PCIe ethernet card works well after resuming from sleep in
both
save/restore
quoted
and re-parsing way. (Maybe PCIe ethernet card don't need outbound
IO
resource)
quoted
So, I guess the result of re-parsing (actually it's re-setup) is
right
and ATMU is not setup
quoted
properly at the first bootup.
Are you seeing the following message - "PCI: I/O resource not set
for host bridge" ?
No.
quoted
Trying to understand why you'd hit the reassignment of io_resource.
- k
I did some investigations and the conclusion is:
io_resource.flags & IORESOURCE_IO are both positive but
io_resource.start is 0 before pcibios_setup_phb_io_space() is done.
The sequence of related process listed below:
fsl_add_bridge() -> setup_pci_atmu()
pcibios_init() -> pcibios_scan_phb() -> pcibios_setup_phb_io_space()
Because fsl_add_bridge() must be finished before pcibios_init() so
ATMU is set when io_resource.start is 0. That means outbound IO regs
are not set.
If system re-setup ATMU the io_resource.start has already updated so
outbound IO regs are set.
My question is:
Is there any problem if outbound IO regs are not set in first bootup?
=20
Please also provide the IO resource address range before and after the
pci scan. Then we can evaluate if the range is needed to be mapped via
ATMU.
=20
Leo
Since potar is set by out_be32(&pci->pow[j].potar, (hose->io_resource.start=
>> 12);
I provide the result of hose->io_resource.start >> 12 as follows:
pcie@ffe09000:
before pci scan: io_resource.start >> 12: 0
after pci scan : io_resource.start >> 12: ff7ed
pcie@ffe0a000:
before pci scan: io_resource.start >> 12: 0
after pci scan : io_resource.start >> 12: ff7db
pcie@ffe0b000:
before pci scan: io_resource.start >> 12: 0
after pci scan : io_resource.start >> 12: ff7c9
Note that I tested on P1022DS.
- Hongtao.
From: Kumar Gala <hidden> Date: 2012-09-21 13:16:00
quoted
quoted
quoted
quoted
quoted
quoted
=20
On Sep 17, 2012, at 9:10 PM, Jia Hongtao wrote:
=20
quoted
Power supply for PCI inbound/outbound window registers is off
when system go to deep-sleep state. We save the values of
registers
before
quoted
quoted
quoted
quoted
suspend and restore to registers after resume.
=20
Signed-off-by: Jiang Yutang <redacted>
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
Changes for V4:
We just rebase the patch upon following patch:
powerpc/fsl-pci: Unify pci/pcie initialization code
=20
arch/powerpc/include/asm/pci-bridge.h | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 121
=20
Did you ever compare this to just re-parsing device tree method?
=20
- k
=20
I tested the re-parsing way by using setup_pci_atmu() when =
resume.
quoted
quoted
quoted
quoted
quoted
And I found out that re-parsing will *change* outbound IO
translation address regitster.
=20
It seems that in the first bootup, after setup_atmu()
pcibios_setup_phb_resources() may update hose->io_resource, but
atmu is not updated according to the new hose->io_resource value.
In resume from sleep setup_atmu() will reset atmu according to
the new hose->io_resource value. So the setup_atmu() will cause
different result on outbound IO register between first bootup and
resume from sleep.
=20
So... There's a possibility that in the first bootup atmu is not
setup properly.
=20
[Are you seeing this happen in your testing? If so its a bug we
need
to look at fixing.]
quoted
=20
Yes, I see this in my testing.
Also PCIe ethernet card works well after resuming from sleep in
both
save/restore
quoted
and re-parsing way. (Maybe PCIe ethernet card don't need outbound
IO
resource)
quoted
So, I guess the result of re-parsing (actually it's re-setup) is
right
and ATMU is not setup
quoted
properly at the first bootup.
=20
Are you seeing the following message - "PCI: I/O resource not set
for host bridge" ?
=20
No.
=20
quoted
=20
Trying to understand why you'd hit the reassignment of io_resource.
=20
- k
=20
=20
I did some investigations and the conclusion is:
=20
io_resource.flags & IORESOURCE_IO are both positive but
io_resource.start is 0 before pcibios_setup_phb_io_space() is done.
=20
The sequence of related process listed below:
fsl_add_bridge() -> setup_pci_atmu()
pcibios_init() -> pcibios_scan_phb() -> pcibios_setup_phb_io_space()
=20
Because fsl_add_bridge() must be finished before pcibios_init() so
ATMU is set when io_resource.start is 0. That means outbound IO regs
are not set.
=20
If system re-setup ATMU the io_resource.start has already updated so
outbound IO regs are set.
=20
My question is:
Is there any problem if outbound IO regs are not set in first =
bootup?
Yes, it means that IO transactions would not work.
quoted
Please also provide the IO resource address range before and after =
the
quoted
pci scan. Then we can evaluate if the range is needed to be mapped =
via
quoted
ATMU.
=20
Leo
=20
Since potar is set by out_be32(&pci->pow[j].potar, =
(hose->io_resource.start >> 12);
I provide the result of hose->io_resource.start >> 12 as follows:
=20
pcie@ffe09000:
before pci scan: io_resource.start >> 12: 0
after pci scan : io_resource.start >> 12: ff7ed
=20
pcie@ffe0a000:
before pci scan: io_resource.start >> 12: 0
after pci scan : io_resource.start >> 12: ff7db
=20
pcie@ffe0b000:
before pci scan: io_resource.start >> 12: 0
after pci scan : io_resource.start >> 12: ff7c9
=20
Note that I tested on P1022DS.
=20
- Hongtao.
1. What's the device tree nodes for PCIe look like?
2. Can you get the pr_debug() in setup_pci_atmu() to print and report =
results (as well as full boot log)
However, I think the change of the io_resource.start is normal and =
correct behavior.
- k
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Friday, September 21, 2012 9:16 PM
To: Jia Hongtao-B38951
Cc: Li Yang-R58472; linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421
Subject: Re: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM
support
quoted
quoted
quoted
quoted
quoted
quoted
quoted
On Sep 17, 2012, at 9:10 PM, Jia Hongtao wrote:
quoted
Power supply for PCI inbound/outbound window registers is off
when system go to deep-sleep state. We save the values of
registers
before
quoted
quoted
quoted
quoted
suspend and restore to registers after resume.
Signed-off-by: Jiang Yutang <redacted>
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
Changes for V4:
We just rebase the patch upon following patch:
powerpc/fsl-pci: Unify pci/pcie initialization code
arch/powerpc/include/asm/pci-bridge.h | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 121
Did you ever compare this to just re-parsing device tree method?
- k
I tested the re-parsing way by using setup_pci_atmu() when resume.
And I found out that re-parsing will *change* outbound IO
translation address regitster.
It seems that in the first bootup, after setup_atmu()
pcibios_setup_phb_resources() may update hose->io_resource, but
atmu is not updated according to the new hose->io_resource value.
In resume from sleep setup_atmu() will reset atmu according to
the new hose->io_resource value. So the setup_atmu() will cause
different result on outbound IO register between first bootup and
resume from sleep.
So... There's a possibility that in the first bootup atmu is not
setup properly.
[Are you seeing this happen in your testing? If so its a bug we
need
to look at fixing.]
quoted
Yes, I see this in my testing.
Also PCIe ethernet card works well after resuming from sleep in
both
save/restore
quoted
and re-parsing way. (Maybe PCIe ethernet card don't need outbound
IO
resource)
quoted
So, I guess the result of re-parsing (actually it's re-setup) is
right
and ATMU is not setup
quoted
properly at the first bootup.
Are you seeing the following message - "PCI: I/O resource not set
for host bridge" ?
No.
quoted
Trying to understand why you'd hit the reassignment of io_resource.
- k
I did some investigations and the conclusion is:
io_resource.flags & IORESOURCE_IO are both positive but
io_resource.start is 0 before pcibios_setup_phb_io_space() is done.
The sequence of related process listed below:
fsl_add_bridge() -> setup_pci_atmu()
pcibios_init() -> pcibios_scan_phb() -> pcibios_setup_phb_io_space()
Because fsl_add_bridge() must be finished before pcibios_init() so
ATMU is set when io_resource.start is 0. That means outbound IO regs
are not set.
If system re-setup ATMU the io_resource.start has already updated so
outbound IO regs are set.
My question is:
Is there any problem if outbound IO regs are not set in first bootup?
Yes, it means that IO transactions would not work.
I agree.
quoted
quoted
Please also provide the IO resource address range before and after the
pci scan. Then we can evaluate if the range is needed to be mapped
via
quoted
quoted
ATMU.
Leo
Since potar is set by out_be32(&pci->pow[j].potar, (hose-
io_resource.start >> 12);
I provide the result of hose->io_resource.start >> 12 as follows:
pcie@ffe09000:
before pci scan: io_resource.start >> 12: 0
after pci scan : io_resource.start >> 12: ff7ed
pcie@ffe0a000:
before pci scan: io_resource.start >> 12: 0
after pci scan : io_resource.start >> 12: ff7db
pcie@ffe0b000:
before pci scan: io_resource.start >> 12: 0
after pci scan : io_resource.start >> 12: ff7c9
Note that I tested on P1022DS.
- Hongtao.
1. What's the device tree nodes for PCIe look like?
2. Can you get the pr_debug() in setup_pci_atmu() to print and report
results (as well as full boot log)
Please refer to the attached file.
In the log file I also print the device tree.
- Hongtao.
However, I think the change of the io_resource.start is normal and
correct behavior.
- k
-----Original Message-----
From: Linuxppc-dev [mailto:linuxppc-dev-
bounces+b38951=3Dfreescale.com@lists.ozlabs.org] On Behalf Of Jia Hongtao=
-
B38951
Sent: Monday, September 24, 2012 10:47 AM
To: Kumar Gala
Cc: Wood Scott-B07421; linuxppc-dev@lists.ozlabs.org; Li Yang-R58472
Subject: RE: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM
support
=20
=20
=20
quoted
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Friday, September 21, 2012 9:16 PM
To: Jia Hongtao-B38951
Cc: Li Yang-R58472; linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421
Subject: Re: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM
support
quoted
quoted
quoted
quoted
quoted
quoted
quoted
On Sep 17, 2012, at 9:10 PM, Jia Hongtao wrote:
quoted
Power supply for PCI inbound/outbound window registers is off
when system go to deep-sleep state. We save the values of
registers
before
quoted
quoted
quoted
quoted
suspend and restore to registers after resume.
Signed-off-by: Jiang Yutang <redacted>
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
Changes for V4:
We just rebase the patch upon following patch:
powerpc/fsl-pci: Unify pci/pcie initialization code
arch/powerpc/include/asm/pci-bridge.h | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 121
Did you ever compare this to just re-parsing device tree method=
?
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
- k
I tested the re-parsing way by using setup_pci_atmu() when
resume.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
And I found out that re-parsing will *change* outbound IO
translation address regitster.
It seems that in the first bootup, after setup_atmu()
pcibios_setup_phb_resources() may update hose->io_resource, but
atmu is not updated according to the new hose->io_resource value=
.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
In resume from sleep setup_atmu() will reset atmu according to
the new hose->io_resource value. So the setup_atmu() will cause
different result on outbound IO register between first bootup
and resume from sleep.
So... There's a possibility that in the first bootup atmu is
not setup properly.
[Are you seeing this happen in your testing? If so its a bug we
need
to look at fixing.]
quoted
Yes, I see this in my testing.
Also PCIe ethernet card works well after resuming from sleep in
both
save/restore
quoted
and re-parsing way. (Maybe PCIe ethernet card don't need
outbound IO
resource)
quoted
So, I guess the result of re-parsing (actually it's re-setup) is
right
and ATMU is not setup
quoted
properly at the first bootup.
Are you seeing the following message - "PCI: I/O resource not set
for host bridge" ?
No.
quoted
Trying to understand why you'd hit the reassignment of io_resource=
.
quoted
quoted
quoted
quoted
quoted
- k
I did some investigations and the conclusion is:
io_resource.flags & IORESOURCE_IO are both positive but
io_resource.start is 0 before pcibios_setup_phb_io_space() is done.
The sequence of related process listed below:
fsl_add_bridge() -> setup_pci_atmu()
pcibios_init() -> pcibios_scan_phb() ->
pcibios_setup_phb_io_space()
Because fsl_add_bridge() must be finished before pcibios_init() so
ATMU is set when io_resource.start is 0. That means outbound IO
regs are not set.
If system re-setup ATMU the io_resource.start has already updated
so outbound IO regs are set.
My question is:
Is there any problem if outbound IO regs are not set in first
bootup?
quoted
Yes, it means that IO transactions would not work.
=20
I agree.
=20
quoted
quoted
quoted
Please also provide the IO resource address range before and after
the pci scan. Then we can evaluate if the range is needed to be
mapped
via
quoted
quoted
ATMU.
Leo
Since potar is set by out_be32(&pci->pow[j].potar, (hose-
io_resource.start >> 12); I provide the result of
hose->io_resource.start >> 12 as follows:
pcie@ffe09000:
before pci scan: io_resource.start >> 12: 0 after pci scan :
io_resource.start >> 12: ff7ed
pcie@ffe0a000:
before pci scan: io_resource.start >> 12: 0 after pci scan :
io_resource.start >> 12: ff7db
pcie@ffe0b000:
before pci scan: io_resource.start >> 12: 0 after pci scan :
io_resource.start >> 12: ff7c9
Note that I tested on P1022DS.
- Hongtao.
1. What's the device tree nodes for PCIe look like?
2. Can you get the pr_debug() in setup_pci_atmu() to print and report
results (as well as full boot log)
=20
Please refer to the attached file.
In the log file I also print the device tree.
=20
- Hongtao.
=20
quoted
However, I think the change of the io_resource.start is normal and
correct behavior.
- k
=20
Hi Kumar,
I have already sent the log.
Do you have any comment on it?
Thanks.
- Hongtao.
From: Kumar Gala <hidden> Date: 2012-09-27 12:05:44
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
=20
On Sep 17, 2012, at 9:10 PM, Jia Hongtao wrote:
=20
quoted
Power supply for PCI inbound/outbound window registers is =
off
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
when system go to deep-sleep state. We save the values of
registers
before
quoted
quoted
quoted
quoted
suspend and restore to registers after resume.
=20
Signed-off-by: Jiang Yutang <redacted>
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
Changes for V4:
We just rebase the patch upon following patch:
powerpc/fsl-pci: Unify pci/pcie initialization code
=20
arch/powerpc/include/asm/pci-bridge.h | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 121
=20
Did you ever compare this to just re-parsing device tree =
method?
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
=20
- k
=20
I tested the re-parsing way by using setup_pci_atmu() when
resume.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
And I found out that re-parsing will *change* outbound IO
translation address regitster.
=20
It seems that in the first bootup, after setup_atmu()
pcibios_setup_phb_resources() may update hose->io_resource, =
but
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
atmu is not updated according to the new hose->io_resource =
value.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
In resume from sleep setup_atmu() will reset atmu according to
the new hose->io_resource value. So the setup_atmu() will =
cause
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
different result on outbound IO register between first bootup
and resume from sleep.
=20
So... There's a possibility that in the first bootup atmu is
not setup properly.
=20
[Are you seeing this happen in your testing? If so its a bug =
we
quoted
quoted
quoted
quoted
quoted
quoted
quoted
need
to look at fixing.]
quoted
=20
Yes, I see this in my testing.
Also PCIe ethernet card works well after resuming from sleep in
both
save/restore
quoted
and re-parsing way. (Maybe PCIe ethernet card don't need
outbound IO
resource)
quoted
So, I guess the result of re-parsing (actually it's re-setup) =
is
quoted
quoted
quoted
quoted
quoted
quoted
quoted
right
and ATMU is not setup
quoted
properly at the first bootup.
=20
Are you seeing the following message - "PCI: I/O resource not =
set
quoted
quoted
quoted
quoted
quoted
quoted
for host bridge" ?
=20
No.
=20
quoted
=20
Trying to understand why you'd hit the reassignment of =
io_resource.
quoted
quoted
quoted
quoted
quoted
quoted
=20
- k
=20
=20
I did some investigations and the conclusion is:
=20
io_resource.flags & IORESOURCE_IO are both positive but
io_resource.start is 0 before pcibios_setup_phb_io_space() is =
done.
quoted
quoted
quoted
quoted
quoted
=20
The sequence of related process listed below:
fsl_add_bridge() -> setup_pci_atmu()
pcibios_init() -> pcibios_scan_phb() ->
pcibios_setup_phb_io_space()
=20
Because fsl_add_bridge() must be finished before pcibios_init() =
so
quoted
quoted
quoted
quoted
quoted
ATMU is set when io_resource.start is 0. That means outbound IO
regs are not set.
=20
If system re-setup ATMU the io_resource.start has already updated
so outbound IO regs are set.
=20
My question is:
Is there any problem if outbound IO regs are not set in first
bootup?
quoted
=20
Yes, it means that IO transactions would not work.
=20
I agree.
=20
quoted
=20
quoted
quoted
Please also provide the IO resource address range before and after
the pci scan. Then we can evaluate if the range is needed to be
mapped
via
quoted
quoted
ATMU.
=20
Leo
=20
Since potar is set by out_be32(&pci->pow[j].potar, (hose-
io_resource.start >> 12); I provide the result of
hose->io_resource.start >> 12 as follows:
=20
pcie@ffe09000:
before pci scan: io_resource.start >> 12: 0 after pci scan :
io_resource.start >> 12: ff7ed
=20
pcie@ffe0a000:
before pci scan: io_resource.start >> 12: 0 after pci scan :
io_resource.start >> 12: ff7db
=20
pcie@ffe0b000:
before pci scan: io_resource.start >> 12: 0 after pci scan :
io_resource.start >> 12: ff7c9
=20
Note that I tested on P1022DS.
=20
- Hongtao.
=20
1. What's the device tree nodes for PCIe look like?
2. Can you get the pr_debug() in setup_pci_atmu() to print and =
report
quoted
quoted
results (as well as full boot log)
=20
Please refer to the attached file.
In the log file I also print the device tree.
=20
- Hongtao.
=20
quoted
=20
However, I think the change of the io_resource.start is normal and
correct behavior.
=20
- k
=20
=20
=20
Hi Kumar,
I have already sent the log.
Do you have any comment on it?
=20
Thanks.
- Hongtao.
=20
Hongtao,
You mentioned:
I tested the re-parsing way by using setup_pci_atmu() when resume.
And I found out that re-parsing will *change* outbound IO
translation address regitster.
What do the values look like in both ATMU registers and io_resource if =
you reparse?
- k=
On Thu, Sep 27, 2012 at 8:05 PM, Kumar Gala [off-list ref] wrote:
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
On Sep 17, 2012, at 9:10 PM, Jia Hongtao wrote:
quoted
Power supply for PCI inbound/outbound window registers is off
when system go to deep-sleep state. We save the values of
registers
before
quoted
quoted
quoted
quoted
suspend and restore to registers after resume.
Signed-off-by: Jiang Yutang <redacted>
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
Changes for V4:
We just rebase the patch upon following patch:
powerpc/fsl-pci: Unify pci/pcie initialization code
arch/powerpc/include/asm/pci-bridge.h | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 121
Did you ever compare this to just re-parsing device tree method?
- k
I tested the re-parsing way by using setup_pci_atmu() when
resume.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
And I found out that re-parsing will *change* outbound IO
translation address regitster.
It seems that in the first bootup, after setup_atmu()
pcibios_setup_phb_resources() may update hose->io_resource, but
atmu is not updated according to the new hose->io_resource value.
In resume from sleep setup_atmu() will reset atmu according to
the new hose->io_resource value. So the setup_atmu() will cause
different result on outbound IO register between first bootup
and resume from sleep.
So... There's a possibility that in the first bootup atmu is
not setup properly.
[Are you seeing this happen in your testing? If so its a bug we
need
to look at fixing.]
quoted
Yes, I see this in my testing.
Also PCIe ethernet card works well after resuming from sleep in
both
save/restore
quoted
and re-parsing way. (Maybe PCIe ethernet card don't need
outbound IO
resource)
quoted
So, I guess the result of re-parsing (actually it's re-setup) is
right
and ATMU is not setup
quoted
properly at the first bootup.
Are you seeing the following message - "PCI: I/O resource not set
for host bridge" ?
No.
quoted
Trying to understand why you'd hit the reassignment of io_resource.
- k
I did some investigations and the conclusion is:
io_resource.flags & IORESOURCE_IO are both positive but
io_resource.start is 0 before pcibios_setup_phb_io_space() is done.
The sequence of related process listed below:
fsl_add_bridge() -> setup_pci_atmu()
pcibios_init() -> pcibios_scan_phb() ->
pcibios_setup_phb_io_space()
Because fsl_add_bridge() must be finished before pcibios_init() so
ATMU is set when io_resource.start is 0. That means outbound IO
regs are not set.
If system re-setup ATMU the io_resource.start has already updated
so outbound IO regs are set.
My question is:
Is there any problem if outbound IO regs are not set in first
bootup?
quoted
Yes, it means that IO transactions would not work.
I agree.
quoted
quoted
quoted
Please also provide the IO resource address range before and after
the pci scan. Then we can evaluate if the range is needed to be
mapped
via
quoted
quoted
ATMU.
Leo
Since potar is set by out_be32(&pci->pow[j].potar, (hose-
io_resource.start >> 12); I provide the result of
hose->io_resource.start >> 12 as follows:
pcie@ffe09000:
before pci scan: io_resource.start >> 12: 0 after pci scan :
io_resource.start >> 12: ff7ed
pcie@ffe0a000:
before pci scan: io_resource.start >> 12: 0 after pci scan :
io_resource.start >> 12: ff7db
pcie@ffe0b000:
before pci scan: io_resource.start >> 12: 0 after pci scan :
io_resource.start >> 12: ff7c9
Note that I tested on P1022DS.
- Hongtao.
1. What's the device tree nodes for PCIe look like?
2. Can you get the pr_debug() in setup_pci_atmu() to print and report
results (as well as full boot log)
Please refer to the attached file.
In the log file I also print the device tree.
- Hongtao.
quoted
However, I think the change of the io_resource.start is normal and
correct behavior.
- k
Hi Kumar,
I have already sent the log.
Do you have any comment on it?
Thanks.
- Hongtao.
Hongtao,
You mentioned:
quoted
I tested the re-parsing way by using setup_pci_atmu() when resume.
And I found out that re-parsing will *change* outbound IO
translation address regitster.
What do the values look like in both ATMU registers and io_resource if you reparse?
I think Hongtao mentioned in previous email as follows, the ATMU
registers are inline with the io_resource address.
quoted
Since potar is set by out_be32(&pci->pow[j].potar, (hose-
io_resource.start >> 12);
I provide the result of hose->io_resource.start >> 12 as follows:
pcie@ffe09000:
before pci scan: io_resource.start >> 12: 0
after pci scan : io_resource.start >> 12: ff7ed
pcie@ffe0a000:
before pci scan: io_resource.start >> 12: 0
after pci scan : io_resource.start >> 12: ff7db
pcie@ffe0b000:
before pci scan: io_resource.start >> 12: 0
after pci scan : io_resource.start >> 12: ff7c9
Note that I tested on P1022DS.
From: Kumar Gala <hidden> Date: 2012-09-27 16:04:03
quoted
quoted
Hi Kumar,
I have already sent the log.
Do you have any comment on it?
=20
Thanks.
- Hongtao.
=20
=20
Hongtao,
=20
You mentioned:
=20
quoted
I tested the re-parsing way by using setup_pci_atmu() when resume.
And I found out that re-parsing will *change* outbound IO
translation address regitster.
=20
What do the values look like in both ATMU registers and io_resource =
if you reparse?
=20
I think Hongtao mentioned in previous email as follows, the ATMU
registers are inline with the io_resource address.
I was under that the impression that was the normal boot case, not the =
values from after wakeup.
- k
quoted
quoted
Since potar is set by out_be32(&pci->pow[j].potar, (hose-
io_resource.start >> 12);
I provide the result of hose->io_resource.start >> 12 as follows:
=20
pcie@ffe09000:
before pci scan: io_resource.start >> 12: 0
after pci scan : io_resource.start >> 12: ff7ed
=20
pcie@ffe0a000:
before pci scan: io_resource.start >> 12: 0
after pci scan : io_resource.start >> 12: ff7db
=20
pcie@ffe0b000:
before pci scan: io_resource.start >> 12: 0
after pci scan : io_resource.start >> 12: ff7c9
=20
Note that I tested on P1022DS.
Hi Kumar,
I have already sent the log.
Do you have any comment on it?
=20
Thanks.
- Hongtao.
=20
=20
Hongtao,
=20
You mentioned:
=20
quoted
I tested the re-parsing way by using setup_pci_atmu() when resume.
And I found out that re-parsing will *change* outbound IO
translation address regitster.
=20
What do the values look like in both ATMU registers and io_resource =
if you reparse?
quoted
quoted
=20
I think Hongtao mentioned in previous email as follows, the ATMU
registers are inline with the io_resource address.
=20
I was under that the impression that was the normal boot case, not =
the values from after wakeup.
=20
It is for the normal boot. But re-parse will use the io resource =
after pic scan to initialize atmu. Instead, the original atmu is =
initialized use the io resource before the scan.
=20
Leo
I think I see, so isn't the mem resources also wrong?
Can we dump the following:
1. enable pr_debug() in pcibios_setup_phb_resources so we get "PHB: " =
prints
2. Can we dump hose->io_resource & hose->mem_resources[] right after =
wakeup?
I think I see what direction but would be useful to get a few more =
answers.
- k=
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Friday, September 28, 2012 5:38 AM
To: Li Yang-R58472
Cc: Jia Hongtao-B38951; Wood Scott-B07421; linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM
support
On Sep 27, 2012, at 11:27 AM, Li Yang-R58472 wrote:
Hi Kumar,
I have already sent the log.
Do you have any comment on it?
Thanks.
- Hongtao.
Hongtao,
You mentioned:
quoted
I tested the re-parsing way by using setup_pci_atmu() when resume.
And I found out that re-parsing will *change* outbound IO
translation address regitster.
What do the values look like in both ATMU registers and io_resource
if you reparse?
quoted
quoted
quoted
I think Hongtao mentioned in previous email as follows, the ATMU
registers are inline with the io_resource address.
I was under that the impression that was the normal boot case, not the
values from after wakeup.
quoted
It is for the normal boot. But re-parse will use the io resource after
pic scan to initialize atmu. Instead, the original atmu is initialized
use the io resource before the scan.
quoted
Leo
I think I see, so isn't the mem resources also wrong?
Can we dump the following:
1. enable pr_debug() in pcibios_setup_phb_resources so we get "PHB: "
prints 2. Can we dump hose->io_resource & hose->mem_resources[] right
after wakeup?
I think I see what direction but would be useful to get a few more
answers.
- k
I enable pr_debug() on these three files:
arch/powerpc/sysdev/fsl_pci.c
arch/powerpc/kernel/pci-common.c
arch/powerpc/kernel/pci_32.c
Also I print the io_resource and mem_resources after wakeup.
(actually pr_debug already done this)
You can see that io resource is changed after pci scan in normal boot.
To see the log please refer to the attachment.
- Hongtao.
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Thursday, September 27, 2012 8:06 PM
To: Jia Hongtao-B38951
Cc: Wood Scott-B07421; linuxppc-dev@lists.ozlabs.org; Li Yang-R58472
Subject: Re: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM
support
=20
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
On Sep 17, 2012, at 9:10 PM, Jia Hongtao wrote:
quoted
Power supply for PCI inbound/outbound window registers is
off when system go to deep-sleep state. We save the values
of registers
before
quoted
quoted
quoted
quoted
suspend and restore to registers after resume.
Signed-off-by: Jiang Yutang <redacted>
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
Changes for V4:
We just rebase the patch upon following patch:
powerpc/fsl-pci: Unify pci/pcie initialization code
arch/powerpc/include/asm/pci-bridge.h | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 121
Did you ever compare this to just re-parsing device tree
method?
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
- k
I tested the re-parsing way by using setup_pci_atmu() when
resume.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
And I found out that re-parsing will *change* outbound IO
translation address regitster.
It seems that in the first bootup, after setup_atmu()
pcibios_setup_phb_resources() may update hose->io_resource,
but atmu is not updated according to the new hose->io_resource
value.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
In resume from sleep setup_atmu() will reset atmu according to
the new hose->io_resource value. So the setup_atmu() will
cause different result on outbound IO register between first
bootup and resume from sleep.
So... There's a possibility that in the first bootup atmu is
not setup properly.
[Are you seeing this happen in your testing? If so its a bug
we need
to look at fixing.]
quoted
Yes, I see this in my testing.
Also PCIe ethernet card works well after resuming from sleep in
both
save/restore
quoted
and re-parsing way. (Maybe PCIe ethernet card don't need
outbound IO
resource)
quoted
So, I guess the result of re-parsing (actually it's re-setup)
is right
and ATMU is not setup
quoted
properly at the first bootup.
Are you seeing the following message - "PCI: I/O resource not
set for host bridge" ?
No.
quoted
Trying to understand why you'd hit the reassignment of
io_resource.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
- k
I did some investigations and the conclusion is:
io_resource.flags & IORESOURCE_IO are both positive but
io_resource.start is 0 before pcibios_setup_phb_io_space() is done=
.
quoted
quoted
quoted
quoted
quoted
quoted
The sequence of related process listed below:
fsl_add_bridge() -> setup_pci_atmu()
pcibios_init() -> pcibios_scan_phb() ->
pcibios_setup_phb_io_space()
Because fsl_add_bridge() must be finished before pcibios_init()
so ATMU is set when io_resource.start is 0. That means outbound
IO regs are not set.
If system re-setup ATMU the io_resource.start has already updated
so outbound IO regs are set.
My question is:
Is there any problem if outbound IO regs are not set in first
bootup?
quoted
Yes, it means that IO transactions would not work.
I agree.
quoted
quoted
quoted
Please also provide the IO resource address range before and after
the pci scan. Then we can evaluate if the range is needed to be
mapped
via
quoted
quoted
ATMU.
Leo
Since potar is set by out_be32(&pci->pow[j].potar, (hose-
io_resource.start >> 12); I provide the result of
hose->io_resource.start >> 12 as follows:
pcie@ffe09000:
before pci scan: io_resource.start >> 12: 0 after pci scan :
io_resource.start >> 12: ff7ed
pcie@ffe0a000:
before pci scan: io_resource.start >> 12: 0 after pci scan :
io_resource.start >> 12: ff7db
pcie@ffe0b000:
before pci scan: io_resource.start >> 12: 0 after pci scan :
io_resource.start >> 12: ff7c9
Note that I tested on P1022DS.
- Hongtao.
1. What's the device tree nodes for PCIe look like?
2. Can you get the pr_debug() in setup_pci_atmu() to print and
report results (as well as full boot log)
Please refer to the attached file.
In the log file I also print the device tree.
- Hongtao.
quoted
However, I think the change of the io_resource.start is normal and
correct behavior.
- k
Hi Kumar,
I have already sent the log.
Do you have any comment on it?
Thanks.
- Hongtao.
=20
Hongtao,
=20
You mentioned:
=20
quoted
I tested the re-parsing way by using setup_pci_atmu() when resume.
And I found out that re-parsing will *change* outbound IO translation
address regitster.
=20
What do the values look like in both ATMU registers and io_resource if
you reparse?
=20
- k
Hi Kumar,
About this topic do you have any further comments?
Thanks.
- Hongtao.
Hi Kumar,
This PCI controller PM thing is pending for nearly a month without
further discussion. Maybe it's time now to reach an agreement.
- Hongtao.
-----Original Message-----
From: Jia Hongtao-B38951
Sent: Friday, October 19, 2012 12:15 PM
To: 'Kumar Gala'
Cc: Wood Scott-B07421; linuxppc-dev@lists.ozlabs.org; Li Yang-R58472
Subject: RE: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM
support
=20
quoted
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Thursday, September 27, 2012 8:06 PM
To: Jia Hongtao-B38951
Cc: Wood Scott-B07421; linuxppc-dev@lists.ozlabs.org; Li Yang-R58472
Subject: Re: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM
support
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
On Sep 17, 2012, at 9:10 PM, Jia Hongtao wrote:
quoted
Power supply for PCI inbound/outbound window registers is
off when system go to deep-sleep state. We save the values
of registers
before
quoted
quoted
quoted
quoted
suspend and restore to registers after resume.
Signed-off-by: Jiang Yutang <redacted>
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
Changes for V4:
We just rebase the patch upon following patch:
powerpc/fsl-pci: Unify pci/pcie initialization code
arch/powerpc/include/asm/pci-bridge.h | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 121
Did you ever compare this to just re-parsing device tree
method?
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
- k
I tested the re-parsing way by using setup_pci_atmu() when
resume.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
And I found out that re-parsing will *change* outbound IO
translation address regitster.
It seems that in the first bootup, after setup_atmu()
pcibios_setup_phb_resources() may update hose->io_resource,
but atmu is not updated according to the new
hose->io_resource
value.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
In resume from sleep setup_atmu() will reset atmu according
to the new hose->io_resource value. So the setup_atmu() will
cause different result on outbound IO register between first
bootup and resume from sleep.
So... There's a possibility that in the first bootup atmu is
not setup properly.
[Are you seeing this happen in your testing? If so its a bug
we need
to look at fixing.]
quoted
Yes, I see this in my testing.
Also PCIe ethernet card works well after resuming from sleep
in both
save/restore
quoted
and re-parsing way. (Maybe PCIe ethernet card don't need
outbound IO
resource)
quoted
So, I guess the result of re-parsing (actually it's re-setup)
is right
and ATMU is not setup
quoted
properly at the first bootup.
Are you seeing the following message - "PCI: I/O resource not
set for host bridge" ?
No.
quoted
Trying to understand why you'd hit the reassignment of
io_resource.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
- k
I did some investigations and the conclusion is:
io_resource.flags & IORESOURCE_IO are both positive but
io_resource.start is 0 before pcibios_setup_phb_io_space() is
done.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
The sequence of related process listed below:
fsl_add_bridge() -> setup_pci_atmu()
pcibios_init() -> pcibios_scan_phb() ->
pcibios_setup_phb_io_space()
Because fsl_add_bridge() must be finished before pcibios_init()
so ATMU is set when io_resource.start is 0. That means outbound
IO regs are not set.
If system re-setup ATMU the io_resource.start has already
updated so outbound IO regs are set.
My question is:
Is there any problem if outbound IO regs are not set in first
bootup?
quoted
Yes, it means that IO transactions would not work.
I agree.
quoted
quoted
quoted
Please also provide the IO resource address range before and
after the pci scan. Then we can evaluate if the range is needed
to be mapped
via
quoted
quoted
ATMU.
Leo
Since potar is set by out_be32(&pci->pow[j].potar, (hose-
io_resource.start >> 12); I provide the result of
hose->io_resource.start >> 12 as follows:
pcie@ffe09000:
before pci scan: io_resource.start >> 12: 0 after pci scan :
io_resource.start >> 12: ff7ed
pcie@ffe0a000:
before pci scan: io_resource.start >> 12: 0 after pci scan :
io_resource.start >> 12: ff7db
pcie@ffe0b000:
before pci scan: io_resource.start >> 12: 0 after pci scan :
io_resource.start >> 12: ff7c9
Note that I tested on P1022DS.
- Hongtao.
1. What's the device tree nodes for PCIe look like?
2. Can you get the pr_debug() in setup_pci_atmu() to print and
report results (as well as full boot log)
Please refer to the attached file.
In the log file I also print the device tree.
- Hongtao.
quoted
However, I think the change of the io_resource.start is normal and
correct behavior.
- k
Hi Kumar,
I have already sent the log.
Do you have any comment on it?
Thanks.
- Hongtao.
Hongtao,
You mentioned:
quoted
I tested the re-parsing way by using setup_pci_atmu() when resume.
And I found out that re-parsing will *change* outbound IO
translation address regitster.
What do the values look like in both ATMU registers and io_resource if
you reparse?
- k
=20
=20
Hi Kumar,
=20
About this topic do you have any further comments?
=20
Thanks.
- Hongtao.
Hi Kumar,
Since PCI controller PM support is inactive for a long while I'd
like to submit a new patch using re-setup atmu to restore PCI states.
Maybe the outbound IO issue during first bootup will be discussed
later when you have time.
- Hongtao.
-----Original Message-----
From: Jia Hongtao-B38951
Sent: Wednesday, October 24, 2012 9:59 AM
To: Jia Hongtao-B38951; Kumar Gala
Cc: Wood Scott-B07421; linuxppc-dev@lists.ozlabs.org; Li Yang-R58472
Subject: RE: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM
support
=20
Hi Kumar,
=20
This PCI controller PM thing is pending for nearly a month without
further discussion. Maybe it's time now to reach an agreement.
=20
- Hongtao.
=20
=20
=20
quoted
-----Original Message-----
From: Jia Hongtao-B38951
Sent: Friday, October 19, 2012 12:15 PM
To: 'Kumar Gala'
Cc: Wood Scott-B07421; linuxppc-dev@lists.ozlabs.org; Li Yang-R58472
Subject: RE: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM
support
quoted
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Thursday, September 27, 2012 8:06 PM
To: Jia Hongtao-B38951
Cc: Wood Scott-B07421; linuxppc-dev@lists.ozlabs.org; Li Yang-R58472
Subject: Re: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound
PM support
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
On Sep 17, 2012, at 9:10 PM, Jia Hongtao wrote:
quoted
Power supply for PCI inbound/outbound window registers
is off when system go to deep-sleep state. We save the
values of registers
before
quoted
quoted
quoted
quoted
suspend and restore to registers after resume.
Signed-off-by: Jiang Yutang <redacted>
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
Changes for V4:
We just rebase the patch upon following patch:
powerpc/fsl-pci: Unify pci/pcie initialization code
arch/powerpc/include/asm/pci-bridge.h | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 121
Did you ever compare this to just re-parsing device tree
method?
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
- k
I tested the re-parsing way by using setup_pci_atmu() when
resume.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
And I found out that re-parsing will *change* outbound IO
translation address regitster.
It seems that in the first bootup, after setup_atmu()
pcibios_setup_phb_resources() may update
hose->io_resource, but atmu is not updated according to
the new
hose->io_resource
value.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
In resume from sleep setup_atmu() will reset atmu
according to the new hose->io_resource value. So the
setup_atmu() will cause different result on outbound IO
register between first bootup and resume from sleep.
So... There's a possibility that in the first bootup atmu
is not setup properly.
[Are you seeing this happen in your testing? If so its a
bug we need
to look at fixing.]
quoted
Yes, I see this in my testing.
Also PCIe ethernet card works well after resuming from
sleep in both
save/restore
quoted
and re-parsing way. (Maybe PCIe ethernet card don't need
outbound IO
resource)
quoted
So, I guess the result of re-parsing (actually it's
re-setup) is right
and ATMU is not setup
quoted
properly at the first bootup.
Are you seeing the following message - "PCI: I/O resource
not set for host bridge" ?
No.
quoted
Trying to understand why you'd hit the reassignment of
io_resource.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
- k
I did some investigations and the conclusion is:
io_resource.flags & IORESOURCE_IO are both positive but
io_resource.start is 0 before pcibios_setup_phb_io_space() is
done.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
The sequence of related process listed below:
fsl_add_bridge() -> setup_pci_atmu()
pcibios_init() -> pcibios_scan_phb() ->
pcibios_setup_phb_io_space()
Because fsl_add_bridge() must be finished before
pcibios_init() so ATMU is set when io_resource.start is 0.
That means outbound IO regs are not set.
If system re-setup ATMU the io_resource.start has already
updated so outbound IO regs are set.
My question is:
Is there any problem if outbound IO regs are not set in first
bootup?
quoted
Yes, it means that IO transactions would not work.
I agree.
quoted
quoted
quoted
Please also provide the IO resource address range before and
after the pci scan. Then we can evaluate if the range is
needed to be mapped
via
quoted
quoted
ATMU.
Leo
Since potar is set by out_be32(&pci->pow[j].potar, (hose-
io_resource.start >> 12); I provide the result of
hose->io_resource.start >> 12 as follows:
pcie@ffe09000:
before pci scan: io_resource.start >> 12: 0 after pci scan :
io_resource.start >> 12: ff7ed
pcie@ffe0a000:
before pci scan: io_resource.start >> 12: 0 after pci scan :
io_resource.start >> 12: ff7db
pcie@ffe0b000:
before pci scan: io_resource.start >> 12: 0 after pci scan :
io_resource.start >> 12: ff7c9
Note that I tested on P1022DS.
- Hongtao.
1. What's the device tree nodes for PCIe look like?
2. Can you get the pr_debug() in setup_pci_atmu() to print and
report results (as well as full boot log)
Please refer to the attached file.
In the log file I also print the device tree.
- Hongtao.
quoted
However, I think the change of the io_resource.start is normal
and correct behavior.
- k
Hi Kumar,
I have already sent the log.
Do you have any comment on it?
Thanks.
- Hongtao.
Hongtao,
You mentioned:
quoted
I tested the re-parsing way by using setup_pci_atmu() when resume.
And I found out that re-parsing will *change* outbound IO
translation address regitster.
What do the values look like in both ATMU registers and io_resource
if you reparse?
- k
Hi Kumar,
About this topic do you have any further comments?
Thanks.
- Hongtao.