The first patch fixed a kernel panic when scanning PCI bus if it is working
in agent mode.
In later two patches we unified PCI initialization code by changing fsl_pci
to a platform drvier. The approach will affect swiotlb init and this issue
is addressed in the second patch.
We now just convet IBM 44x, MPC85xxDS and QEMU to this new mechanism. All
other boards will be coverted if this patch set is accepted.
We change fsl_add_bridge to return -ENODEV if the controller is working in
agent mode. Then check the return value of fsl_add_bridge to guarantee
that only successfully added host bus will be scanned.
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
arch/powerpc/sysdev/fsl_pci.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
Remove the dependency on PCI initialization for SWIOTLB initialization.
So that PCI can be initialized at proper time.
SWIOTLB is partly determined by PCI inbound/outbound map which is assigned
in PCI initialization. But swiotlb_init() should be done at the stage of
mem_init() which is much earlier than PCI initialization. So we reserve the
memory for SWIOTLB first and free it if not necessary.
All boards are converted to fit this change.
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
arch/powerpc/include/asm/swiotlb.h | 6 ++++++
arch/powerpc/kernel/dma-swiotlb.c | 20 ++++++++++++++++++++
arch/powerpc/mm/mem.c | 3 +--
arch/powerpc/platforms/44x/currituck.c | 10 ++--------
arch/powerpc/platforms/85xx/mpc85xx_ds.c | 1 +
arch/powerpc/platforms/85xx/qemu_e500.c | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 5 +----
7 files changed, 32 insertions(+), 15 deletions(-)
@@ -159,13 +158,8 @@ static void __init ppc47x_setup_arch(void)/* No need to check the DMA config as we /know/ our windows are all of*RAM.Letshopethatdoesn'tchange*/-#ifdef CONFIG_SWIOTLB-if((memblock_end_of_DRAM()-1)>0xffffffff){-ppc_swiotlb_enable=1;-set_pci_dma_ops(&swiotlb_dma_ops);-ppc_md.pci_dma_dev_setup=pci_dma_dev_setup_swiotlb;-}-#endif+swiotlb_detect_4g();+ppc47x_smp_init();}
We unified the Freescale pci/pcie initialization by changing the fsl_pci
to a platform driver. In previous PCI code architecture the initialization
routine is called at board_setup_arch stage. Now the initialization is done
in probe function which is architectural better. Also It's convenient for
adding PM support for PCI controller in later patch.
Now we registered pci controllers as platform devices. So we combine two
initialization code as one platform driver.
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
Signed-off-by: Chunhe Lan <redacted>
---
arch/powerpc/platforms/85xx/mpc85xx_ds.c | 32 ++--------
arch/powerpc/sysdev/fsl_pci.c | 102 ++++++++++++++++++-----------
arch/powerpc/sysdev/fsl_pci.h | 6 +-
drivers/edac/mpc85xx_edac.c | 43 ++++---------
4 files changed, 83 insertions(+), 100 deletions(-)
@@ -117,40 +116,16 @@ void __init mpc85xx_ds_pic_init(void)externintuli_exclude_device(structpci_controller*hose,u_charbus,u_chardevfn);-staticstructdevice_node*pci_with_uli;-staticintmpc85xx_exclude_device(structpci_controller*hose,u_charbus,u_chardevfn){-if(hose->dn==pci_with_uli)+if(hose->dn==fsl_pci_primary)returnuli_exclude_device(hose,bus,devfn);returnPCIBIOS_SUCCESSFUL;}#endif /* CONFIG_PCI */-staticvoid__initmpc85xx_ds_pci_init(void)-{-#ifdef CONFIG_PCI-structdevice_node*node;--fsl_pci_init();--/* See if we have a ULI under the primary */--node=of_find_node_by_name(NULL,"uli1575");-while((pci_with_uli=of_get_parent(node))){-of_node_put(node);-node=pci_with_uli;--if(pci_with_uli==fsl_pci_primary){-ppc_md.pci_exclude_device=mpc85xx_exclude_device;-break;-}-}-#endif-}-/**Setupthearchitecture*/
@@ -826,54 +826,78 @@ static const struct of_device_id pci_ids[] = {structdevice_node*fsl_pci_primary;-void__devinitfsl_pci_init(void)+/* Checkout if PCI contains ISA node */+staticintof_pci_has_isa(structdevice_node*pci_node)+{+structdevice_node*np;+intret=0;++if(!pci_node)+return0;++read_lock(&devtree_lock);+np=pci_node->allnext;++/* Only scan the children of PCI node */+for(;np!=pci_node->sibling;np=np->allnext){+if(np->type&&(of_node_cmp(np->type,"isa")==0)+&&of_node_get(np)){+ret=1;+break;+}+}++of_node_put(pci_node);+read_unlock(&devtree_lock);++returnret;+}++staticint__devinitfsl_pci_probe(structplatform_device*pdev){intret;-structdevice_node*node;structpci_controller*hose;-dma_addr_tmax=0xffffffff;+intis_primary=0;-/* Callers can specify the primary bus using other means. */if(!fsl_pci_primary){-/* If a PCI host bridge contains an ISA node, it's primary. */-node=of_find_node_by_type(NULL,"isa");-while((fsl_pci_primary=of_get_parent(node))){-of_node_put(node);-node=fsl_pci_primary;--if(of_match_node(pci_ids,node))-break;-}+is_primary=of_pci_has_isa(pdev->dev.of_node);+if(is_primary)+fsl_pci_primary=pdev->dev.of_node;}-node=NULL;-for_each_node_by_type(node,"pci"){-if(of_match_node(pci_ids,node)){-/*-*Ifthere'snoPCIhostbridgewithISA,arbitrarily-*designateoneasprimary.Thiscangoawayonce-*variousbugswithprimary-lesssystemsarefixed.-*/-if(!fsl_pci_primary)-fsl_pci_primary=node;--ret=fsl_add_bridge(node,fsl_pci_primary==node);-if(ret==0){-hose=pci_find_hose_for_OF_device(node);-max=min(max,hose->dma_window_base_cur+-hose->dma_window_size);-}-}-}+ret=fsl_add_bridge(pdev->dev.of_node,is_primary);#ifdef CONFIG_SWIOTLB-/*-*ifwecouldn'tmapallofDRAMviathedmawindows-*weneedSWIOTLBtohandlebufferslocatedoutsideof-*dmacapablememoryregion-*/-if(memblock_end_of_DRAM()-1>max)-ppc_swiotlb_enable=1;+if(ret==0){+hose=pci_find_hose_for_OF_device(pdev->dev.of_node);++/*+*ifwecouldn'tmapallofDRAMviathedmawindows+*weneedSWIOTLBtohandlebufferslocatedoutsideof+*dmacapablememoryregion+*/+if(memblock_end_of_DRAM()-1>hose->dma_window_base_cur++hose->dma_window_size)+ppc_swiotlb_enable=1;+}#endif++mpc85xx_pci_err_probe(pdev);++return0;+}++staticstructplatform_driverfsl_pci_driver={+.driver={+.name="fsl-pci",+.of_match_table=pci_ids,+},+.probe=fsl_pci_probe,+};++staticint__initfsl_pci_init(void)+{+returnplatform_driver_register(&fsl_pci_driver);}+arch_initcall(fsl_pci_init);#endif
From: Kumar Gala <hidden> Date: 2012-08-02 12:54:42
On Aug 2, 2012, at 6:42 AM, Jia Hongtao wrote:
Remove the dependency on PCI initialization for SWIOTLB =
initialization.
So that PCI can be initialized at proper time.
=20
SWIOTLB is partly determined by PCI inbound/outbound map which is =
assigned
in PCI initialization. But swiotlb_init() should be done at the stage =
of
mem_init() which is much earlier than PCI initialization. So we =
reserve the
memory for SWIOTLB first and free it if not necessary.
=20
All boards are converted to fit this change.
=20
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
This doesn't seem like it addresses our issue w/regards to not being =
able to map all of memory from PCI.
From: Scott Wood <hidden> Date: 2012-08-02 20:18:52
On 08/02/2012 06:42 AM, Jia Hongtao wrote:
quoted hunk
We unified the Freescale pci/pcie initialization by changing the fsl_pci
to a platform driver. In previous PCI code architecture the initialization
routine is called at board_setup_arch stage. Now the initialization is done
in probe function which is architectural better. Also It's convenient for
adding PM support for PCI controller in later patch.
Now we registered pci controllers as platform devices. So we combine two
initialization code as one platform driver.
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
Signed-off-by: Chunhe Lan <redacted>
---
arch/powerpc/platforms/85xx/mpc85xx_ds.c | 32 ++--------
arch/powerpc/sysdev/fsl_pci.c | 102 ++++++++++++++++++-----------
arch/powerpc/sysdev/fsl_pci.h | 6 +-
drivers/edac/mpc85xx_edac.c | 43 ++++---------
4 files changed, 83 insertions(+), 100 deletions(-)
@@ -117,40 +116,16 @@ void __init mpc85xx_ds_pic_init(void)externintuli_exclude_device(structpci_controller*hose,u_charbus,u_chardevfn);-staticstructdevice_node*pci_with_uli;-staticintmpc85xx_exclude_device(structpci_controller*hose,u_charbus,u_chardevfn){-if(hose->dn==pci_with_uli)+if(hose->dn==fsl_pci_primary)returnuli_exclude_device(hose,bus,devfn);returnPCIBIOS_SUCCESSFUL;}#endif /* CONFIG_PCI */-staticvoid__initmpc85xx_ds_pci_init(void)-{-#ifdef CONFIG_PCI-structdevice_node*node;--fsl_pci_init();--/* See if we have a ULI under the primary */--node=of_find_node_by_name(NULL,"uli1575");-while((pci_with_uli=of_get_parent(node))){-of_node_put(node);-node=pci_with_uli;--if(pci_with_uli==fsl_pci_primary){-ppc_md.pci_exclude_device=mpc85xx_exclude_device;-break;-}-}-#endif-}-/**Setupthearchitecture*/
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Thursday, August 02, 2012 8:55 PM
To: Jia Hongtao-B38951
Cc: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; Li Yang-R58472
Subject: Re: [PATCH V4 2/3] powerpc/swiotlb: Enable at early stage and
disable if not necessary
=20
=20
On Aug 2, 2012, at 6:42 AM, Jia Hongtao wrote:
=20
quoted
Remove the dependency on PCI initialization for SWIOTLB initialization.
So that PCI can be initialized at proper time.
SWIOTLB is partly determined by PCI inbound/outbound map which is
assigned
quoted
in PCI initialization. But swiotlb_init() should be done at the stage
of
quoted
mem_init() which is much earlier than PCI initialization. So we reserve
the
quoted
memory for SWIOTLB first and free it if not necessary.
All boards are converted to fit this change.
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
=20
This doesn't seem like it addresses our issue w/regards to not being able
to map all of memory from PCI.
PCI init will determine ppc_swiotlb_enable due to PCI map. swiotlb_late_ini=
t
will handle all swiotlb things depend on the result of pci init.
=20
You need to convert all boards to use fsl_pci_init before this patch.
Otherwise we'll end up with PCI getting initialized twice on boards.
=20
- k
If we covert all boards with platform driver in this patch PCI will
be initialized only once without converting all boards to use
fsl_pci_init first.=20
If we convert all boards to use fsl_pci_init before this patch and
convert them to use platform driver again after this patch. Then
between this patch and next pci will be initialized twice too.
So I think convert all boards in this patch is the key not convert
all boards to use fsl_pci_init first before this patch.
-Hongtao.
From: Kumar Gala <hidden> Date: 2012-08-03 12:38:39
On Aug 2, 2012, at 9:21 PM, Jia Hongtao-B38951 wrote:
quoted
=20
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Thursday, August 02, 2012 8:55 PM
To: Jia Hongtao-B38951
Cc: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; Li Yang-R58472
Subject: Re: [PATCH V4 2/3] powerpc/swiotlb: Enable at early stage =
and
quoted
disable if not necessary
=20
=20
On Aug 2, 2012, at 6:42 AM, Jia Hongtao wrote:
=20
quoted
Remove the dependency on PCI initialization for SWIOTLB =
initialization.
quoted
quoted
So that PCI can be initialized at proper time.
=20
SWIOTLB is partly determined by PCI inbound/outbound map which is
assigned
quoted
in PCI initialization. But swiotlb_init() should be done at the =
stage
quoted
of
quoted
mem_init() which is much earlier than PCI initialization. So we =
reserve
quoted
the
quoted
memory for SWIOTLB first and free it if not necessary.
=20
All boards are converted to fit this change.
=20
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
=20
This doesn't seem like it addresses our issue w/regards to not being =
able
quoted
to map all of memory from PCI.
=20
PCI init will determine ppc_swiotlb_enable due to PCI map. =
swiotlb_late_init
will handle all swiotlb things depend on the result of pci init.
Think about the case that we have 4095M of memory & 1G of PCI memory =
mapped space. The old code would enable swiotlb for this case since we =
would NOT be able to DMA to all 4095M of memory. The patch does not =
handle this case correctly.
- k
On Fri, Aug 3, 2012 at 8:38 PM, Kumar Gala [off-list ref] wrote:
On Aug 2, 2012, at 9:21 PM, Jia Hongtao-B38951 wrote:
quoted
quoted
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Thursday, August 02, 2012 8:55 PM
To: Jia Hongtao-B38951
Cc: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; Li Yang-R58472
Subject: Re: [PATCH V4 2/3] powerpc/swiotlb: Enable at early stage and
disable if not necessary
On Aug 2, 2012, at 6:42 AM, Jia Hongtao wrote:
quoted
Remove the dependency on PCI initialization for SWIOTLB initialization.
So that PCI can be initialized at proper time.
SWIOTLB is partly determined by PCI inbound/outbound map which is
assigned
quoted
in PCI initialization. But swiotlb_init() should be done at the stage
of
quoted
mem_init() which is much earlier than PCI initialization. So we reserve
the
quoted
memory for SWIOTLB first and free it if not necessary.
All boards are converted to fit this change.
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
This doesn't seem like it addresses our issue w/regards to not being able
to map all of memory from PCI.
PCI init will determine ppc_swiotlb_enable due to PCI map. swiotlb_late_init
will handle all swiotlb things depend on the result of pci init.
Think about the case that we have 4095M of memory & 1G of PCI memory mapped space. The old code would enable swiotlb for this case since we would NOT be able to DMA to all 4095M of memory. The patch does not handle this case correctly.
The patch can handle it. The ppc_swiotlb_enable is still being set in
fsl_pci_init() if there is 1G of PCI memory mapped space. It is
after next patch that the ppc_swiotlb_enable is being set in the PCI
probe() routine.
Leo
From: Scott Wood <hidden> Date: 2012-08-03 16:04:09
On 08/02/2012 10:39 PM, Jia Hongtao-B38951 wrote:
quoted
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Thursday, August 02, 2012 8:24 PM
To: Jia Hongtao-B38951
Cc: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; Li Yang-R58472
Subject: Re: [PATCH V4 3/3] powerpc/fsl-pci: Unify pci/pcie
initialization code
You need to convert all boards to use fsl_pci_init before this patch.
Otherwise we'll end up with PCI getting initialized twice on boards.
- k
If we covert all boards with platform driver in this patch PCI will
be initialized only once without converting all boards to use
fsl_pci_init first.
Then we'd have to pick apart core changes from board changes when reviewing.
If we convert all boards to use fsl_pci_init before this patch and
convert them to use platform driver again after this patch. Then
between this patch and next pci will be initialized twice too.
Why? That one patch should both create the platform driver and remove
the init from fsl_pci_init() -- except things like primary bus detection
which has to happen globally.
-Scott
From: Scott Wood <hidden> Date: 2012-08-03 16:09:38
On 08/02/2012 09:20 PM, Jia Hongtao-B38951 wrote:
quoted
-----Original Message-----
From: Wood Scott-B07421
Sent: Friday, August 03, 2012 4:19 AM
To: Jia Hongtao-B38951
Cc: linuxppc-dev@lists.ozlabs.org; galak@kernel.crashing.org; Wood Scott-
B07421; Li Yang-R58472
Subject: Re: [PATCH V4 3/3] powerpc/fsl-pci: Unify pci/pcie
initialization code
Why are you eliminating the uli lookup? We don't want to call
uli_exclude_device on boards that don't have a uli.
-Scott
I found out that all 85xx_ds boards (mpc8572ds, mpc8544ds, p2020ds) have
ULI.
Perhaps all boards currently handled by this file do, but it's not true
for all mpc85xx_ds boards. I think we could handle mpc8536ds here if we
didn't hardcode the uli assumption. Not critical, but would be nice to
make this more device tree driven.
p1022ds OTOH is weird enough that it deserves its own board file.
Also in platform driver fsl_pci_primary is determined at arch_initcall
which means at the stage of board_setup_arch fsl_pci_primary is not ready.
You could export the primary detection function so that boards can call
it early if they want.
-Scott
From: Kumar Gala <hidden> Date: 2012-08-03 16:15:47
On Aug 3, 2012, at 9:42 AM, Li Yang wrote:
On Fri, Aug 3, 2012 at 8:38 PM, Kumar Gala [off-list ref] =
wrote:
quoted
=20
On Aug 2, 2012, at 9:21 PM, Jia Hongtao-B38951 wrote:
=20
quoted
quoted
=20
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Thursday, August 02, 2012 8:55 PM
To: Jia Hongtao-B38951
Cc: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; Li =
Yang-R58472
quoted
quoted
quoted
Subject: Re: [PATCH V4 2/3] powerpc/swiotlb: Enable at early stage =
and
quoted
quoted
quoted
disable if not necessary
=20
=20
On Aug 2, 2012, at 6:42 AM, Jia Hongtao wrote:
=20
quoted
Remove the dependency on PCI initialization for SWIOTLB =
initialization.
quoted
quoted
quoted
quoted
So that PCI can be initialized at proper time.
=20
SWIOTLB is partly determined by PCI inbound/outbound map which is
assigned
quoted
in PCI initialization. But swiotlb_init() should be done at the =
stage
quoted
quoted
quoted
of
quoted
mem_init() which is much earlier than PCI initialization. So we =
reserve
quoted
quoted
quoted
the
quoted
memory for SWIOTLB first and free it if not necessary.
=20
All boards are converted to fit this change.
=20
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
=20
This doesn't seem like it addresses our issue w/regards to not =
being able
quoted
quoted
quoted
to map all of memory from PCI.
=20
PCI init will determine ppc_swiotlb_enable due to PCI map. =
swiotlb_late_init
quoted
quoted
will handle all swiotlb things depend on the result of pci init.
=20
Think about the case that we have 4095M of memory & 1G of PCI memory =
mapped space. The old code would enable swiotlb for this case since we =
would NOT be able to DMA to all 4095M of memory. The patch does not =
handle this case correctly.
=20
The patch can handle it. The ppc_swiotlb_enable is still being set in
fsl_pci_init() if there is 1G of PCI memory mapped space. It is
after next patch that the ppc_swiotlb_enable is being set in the PCI
probe() routine.
=20
Leo
Gotcha. I was thinking the swiotlb_init(0) was:
if (ppc_swiotlb_enable)
swiotlb_init(0)
Now I see, we call it unconditionally, than fixup in swiotlb_late_init
- k=
From: Tabi Timur-B04825 <hidden> Date: 2012-08-06 04:11:54
On Fri, Aug 3, 2012 at 11:09 AM, Scott Wood [off-list ref] wrote=
:
p1022ds OTOH is weird enough that it deserves its own board file.
What's so weird about the P1022DS?
Also, why do we need a default PCI bus if one isn't specified in the
device tree?
--=20
Timur Tabi
Linux kernel developer at Freescale=
From: Scott Wood <hidden> Date: 2012-08-06 15:15:47
On 08/05/2012 09:39 PM, Jia Hongtao-B38951 wrote:
quoted
-----Original Message-----
From: Wood Scott-B07421
Sent: Saturday, August 04, 2012 12:04 AM
To: Jia Hongtao-B38951
Cc: Kumar Gala; linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; Li
Yang-R58472
Subject: Re: [PATCH V4 3/3] powerpc/fsl-pci: Unify pci/pcie
initialization code
On 08/02/2012 10:39 PM, Jia Hongtao-B38951 wrote:
quoted
quoted
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Thursday, August 02, 2012 8:24 PM
To: Jia Hongtao-B38951
Cc: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; Li Yang-R58472
Subject: Re: [PATCH V4 3/3] powerpc/fsl-pci: Unify pci/pcie
initialization code
You need to convert all boards to use fsl_pci_init before this patch.
Otherwise we'll end up with PCI getting initialized twice on boards.
- k
If we covert all boards with platform driver in this patch PCI will
be initialized only once without converting all boards to use
fsl_pci_init first.
Then we'd have to pick apart core changes from board changes when
reviewing.
quoted
If we convert all boards to use fsl_pci_init before this patch and
convert them to use platform driver again after this patch. Then
between this patch and next pci will be initialized twice too.
Why? That one patch should both create the platform driver and remove
the init from fsl_pci_init() -- except things like primary bus detection
which has to happen globally.
-Scott
"One patch both create the platform driver and remove the init from
fsl_pci_init()" means we should create platform driver and applied to
all boards. If so why not just directly convert all boards using platform
driver?
Because it's harder to review when you have a bunch of board code in the
patch in addition to core changes.
Because you might want people to actually test on the boards in question
when converting, especially given the change in how primary buses are
determined, and that some boards may need to provide their own alternative.
-Scott
From: Scott Wood <hidden> Date: 2012-08-07 15:19:44
On 08/07/2012 01:23 AM, Jia Hongtao-B38951 wrote:
quoted
-----Original Message-----
From: Wood Scott-B07421
Sent: Monday, August 06, 2012 11:16 PM
To: Jia Hongtao-B38951
Cc: Wood Scott-B07421; Kumar Gala; linuxppc-dev@lists.ozlabs.org; Li
Yang-R58472
Subject: Re: [PATCH V4 3/3] powerpc/fsl-pci: Unify pci/pcie
initialization code
On 08/05/2012 09:39 PM, Jia Hongtao-B38951 wrote:
quoted
quoted
-----Original Message-----
From: Wood Scott-B07421
Sent: Saturday, August 04, 2012 12:04 AM
To: Jia Hongtao-B38951
Cc: Kumar Gala; linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; Li
Yang-R58472
Subject: Re: [PATCH V4 3/3] powerpc/fsl-pci: Unify pci/pcie
initialization code
On 08/02/2012 10:39 PM, Jia Hongtao-B38951 wrote:
quoted
quoted
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Thursday, August 02, 2012 8:24 PM
To: Jia Hongtao-B38951
Cc: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; Li
Yang-R58472
Subject: Re: [PATCH V4 3/3] powerpc/fsl-pci: Unify pci/pcie
initialization code
You need to convert all boards to use fsl_pci_init before this patch.
Otherwise we'll end up with PCI getting initialized twice on boards.
- k
If we covert all boards with platform driver in this patch PCI will
be initialized only once without converting all boards to use
fsl_pci_init first.
Then we'd have to pick apart core changes from board changes when
reviewing.
quoted
If we convert all boards to use fsl_pci_init before this patch and
convert them to use platform driver again after this patch. Then
between this patch and next pci will be initialized twice too.
Why? That one patch should both create the platform driver and
remove the init from fsl_pci_init() -- except things like primary bus
detection which has to happen globally.
-Scott
"One patch both create the platform driver and remove the init from
fsl_pci_init()" means we should create platform driver and applied to
all boards. If so why not just directly convert all boards using
platform driver?
Because it's harder to review when you have a bunch of board code in the
patch in addition to core changes.
Because you might want people to actually test on the boards in question
when converting, especially given the change in how primary buses are
determined, and that some boards may need to provide their own
alternative.
-Scott
But if we separate the core changes and the boards update, between this two
patches PCI will be initialized twice.
As I said earlier, you can remove the initcall and require boards to
manually call fsl_pci_init() until all boards are converted.
-Scott
From: Scott Wood <hidden> Date: 2012-08-08 15:53:58
On 08/07/2012 10:57 PM, Jia Hongtao-B38951 wrote:
quoted
-----Original Message-----
From: Wood Scott-B07421
Sent: Tuesday, August 07, 2012 11:20 PM
To: Jia Hongtao-B38951
Cc: Wood Scott-B07421; Kumar Gala; linuxppc-dev@lists.ozlabs.org; Li
Yang-R58472
Subject: Re: [PATCH V4 3/3] powerpc/fsl-pci: Unify pci/pcie
initialization code
On 08/07/2012 01:23 AM, Jia Hongtao-B38951 wrote:
quoted
quoted
-----Original Message-----
From: Wood Scott-B07421
Sent: Monday, August 06, 2012 11:16 PM
To: Jia Hongtao-B38951
Cc: Wood Scott-B07421; Kumar Gala; linuxppc-dev@lists.ozlabs.org; Li
Yang-R58472
Subject: Re: [PATCH V4 3/3] powerpc/fsl-pci: Unify pci/pcie
initialization code
On 08/05/2012 09:39 PM, Jia Hongtao-B38951 wrote:
quoted
quoted
-----Original Message-----
From: Wood Scott-B07421
Sent: Saturday, August 04, 2012 12:04 AM
To: Jia Hongtao-B38951
Cc: Kumar Gala; linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; Li
Yang-R58472
Subject: Re: [PATCH V4 3/3] powerpc/fsl-pci: Unify pci/pcie
initialization code
On 08/02/2012 10:39 PM, Jia Hongtao-B38951 wrote:
quoted
quoted
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Thursday, August 02, 2012 8:24 PM
To: Jia Hongtao-B38951
Cc: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; Li
Yang-R58472
Subject: Re: [PATCH V4 3/3] powerpc/fsl-pci: Unify pci/pcie
initialization code
You need to convert all boards to use fsl_pci_init before this
patch.
quoted
quoted
quoted
quoted
quoted
quoted
Otherwise we'll end up with PCI getting initialized twice on
boards.
quoted
quoted
quoted
quoted
quoted
quoted
- k
If we covert all boards with platform driver in this patch PCI will
be initialized only once without converting all boards to use
fsl_pci_init first.
Then we'd have to pick apart core changes from board changes when
reviewing.
quoted
If we convert all boards to use fsl_pci_init before this patch and
convert them to use platform driver again after this patch. Then
between this patch and next pci will be initialized twice too.
Why? That one patch should both create the platform driver and
remove the init from fsl_pci_init() -- except things like primary
bus
quoted
quoted
quoted
quoted
detection which has to happen globally.
-Scott
"One patch both create the platform driver and remove the init from
fsl_pci_init()" means we should create platform driver and applied to
all boards. If so why not just directly convert all boards using
platform driver?
Because it's harder to review when you have a bunch of board code in
the
quoted
quoted
patch in addition to core changes.
Because you might want people to actually test on the boards in
question
quoted
quoted
when converting, especially given the change in how primary buses are
determined, and that some boards may need to provide their own
alternative.
-Scott
But if we separate the core changes and the boards update, between this
two
quoted
patches PCI will be initialized twice.
As I said earlier, you can remove the initcall and require boards to
manually call fsl_pci_init() until all boards are converted.
-Scott
As I said earlier, I can do this but it does not solve the twice-init problem.
I must have missed it. Why does it not solve the problem? If a board
doesn't call fsl_pci_init(), the platform driver doesn't get registered.
If I do this first and then add platform driver we also have to convert all
boards using platform driver in the same patch.
We finally using the platform driver so Why do you keep insisting on converting
all boards using fsl_pci_init() first even it does no improvement.
What we're asking for is bisectability (don't have any intermediate
stages where PCI gets initialized twice), and the ability to have a
smooth transition where boards can be converted as people are able to
test them and look into their individual needs regarding primary bus.
-Scott
From: Scott Wood <hidden> Date: 2012-08-10 22:59:12
On 08/08/2012 10:52 PM, Jia Hongtao-B38951 wrote:
quoted
-----Original Message-----
From: Wood Scott-B07421
Sent: Wednesday, August 08, 2012 11:54 PM
To: Jia Hongtao-B38951
Cc: Wood Scott-B07421; Kumar Gala; linuxppc-dev@lists.ozlabs.org; Li
Yang-R58472
Subject: Re: [PATCH V4 3/3] powerpc/fsl-pci: Unify pci/pcie
initialization code
On 08/07/2012 10:57 PM, Jia Hongtao-B38951 wrote:
quoted
quoted
-----Original Message-----
From: Wood Scott-B07421
Sent: Tuesday, August 07, 2012 11:20 PM
To: Jia Hongtao-B38951
Cc: Wood Scott-B07421; Kumar Gala; linuxppc-dev@lists.ozlabs.org; Li
Yang-R58472
Subject: Re: [PATCH V4 3/3] powerpc/fsl-pci: Unify pci/pcie
initialization code
On 08/07/2012 01:23 AM, Jia Hongtao-B38951 wrote:
quoted
quoted
-----Original Message-----
From: Wood Scott-B07421
Sent: Monday, August 06, 2012 11:16 PM
To: Jia Hongtao-B38951
Cc: Wood Scott-B07421; Kumar Gala; linuxppc-dev@lists.ozlabs.org;
Li
Yang-R58472
Subject: Re: [PATCH V4 3/3] powerpc/fsl-pci: Unify pci/pcie
initialization code
On 08/05/2012 09:39 PM, Jia Hongtao-B38951 wrote:
quoted
quoted
-----Original Message-----
From: Wood Scott-B07421
Sent: Saturday, August 04, 2012 12:04 AM
To: Jia Hongtao-B38951
Cc: Kumar Gala; linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421;
Li
Yang-R58472
Subject: Re: [PATCH V4 3/3] powerpc/fsl-pci: Unify pci/pcie
initialization code
On 08/02/2012 10:39 PM, Jia Hongtao-B38951 wrote:
quoted
quoted
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Thursday, August 02, 2012 8:24 PM
To: Jia Hongtao-B38951
Cc: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; Li
Yang-R58472
Subject: Re: [PATCH V4 3/3] powerpc/fsl-pci: Unify pci/pcie
initialization code
You need to convert all boards to use fsl_pci_init before this
patch.
quoted
quoted
quoted
quoted
quoted
quoted
Otherwise we'll end up with PCI getting initialized twice on
boards.
quoted
quoted
quoted
quoted
quoted
quoted
- k
If we covert all boards with platform driver in this patch PCI
will be initialized only once without converting all boards to
use fsl_pci_init first.
Then we'd have to pick apart core changes from board changes when
reviewing.
quoted
If we convert all boards to use fsl_pci_init before this patch
and convert them to use platform driver again after this patch.
Then between this patch and next pci will be initialized twice
too.
quoted
quoted
quoted
quoted
quoted
quoted
Why? That one patch should both create the platform driver and
remove the init from fsl_pci_init() -- except things like primary
bus
quoted
quoted
quoted
quoted
detection which has to happen globally.
-Scott
"One patch both create the platform driver and remove the init
from fsl_pci_init()" means we should create platform driver and
applied to all boards. If so why not just directly convert all
boards using platform driver?
Because it's harder to review when you have a bunch of board code
in
the
quoted
quoted
patch in addition to core changes.
Because you might want people to actually test on the boards in
question
quoted
quoted
when converting, especially given the change in how primary buses
are determined, and that some boards may need to provide their own
alternative.
-Scott
But if we separate the core changes and the boards update, between
this
two
quoted
patches PCI will be initialized twice.
As I said earlier, you can remove the initcall and require boards to
manually call fsl_pci_init() until all boards are converted.
-Scott
As I said earlier, I can do this but it does not solve the twice-init
problem.
I must have missed it. Why does it not solve the problem? If a board
doesn't call fsl_pci_init(), the platform driver doesn't get registered.
quoted
If I do this first and then add platform driver we also have to
convert all boards using platform driver in the same patch.
We finally using the platform driver so Why do you keep insisting on
converting all boards using fsl_pci_init() first even it does no
improvement.
What we're asking for is bisectability (don't have any intermediate
stages where PCI gets initialized twice), and the ability to have a
smooth transition where boards can be converted as people are able to
test them and look into their individual needs regarding primary bus.
-Scott
In my patch there is no bisectability problem. If you don't think so could
you please give more details?
You are registering the PCI platform device with an initcall, but you
haven't updated the unconverted boards to not do the init themselves --
and your proposal to fix that breaks the "smooth transition" request.
-Scott