Re: [PATCH V4 2/3] powerpc/swiotlb: Enable at early stage and disable if not necessary
flat view
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: =20quoted
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: =20quoted
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 isassignedquoted
in PCI initialization. But swiotlb_init() should be done at the =
stage
quoted
quoted
quoted
ofquoted
mem_init() which is much earlier than PCI initialization. So we =
reserve
quoted
quoted
quoted
thequoted
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=