diff mbox

[04/27] powerpc/fsl_pci: Don't change ppc_swiotlb_enable after swiotlb_subsys_init

Message ID 1427261761-22952-5-git-send-email-dja@axtens.net (mailing list archive)
State Changes Requested
Delegated to: Michael Ellerman
Headers show

Commit Message

Daniel Axtens March 25, 2015, 5:35 a.m. UTC
The only function that checks ppc_swiotlb_enable is swiotlb_subsys_init.
The code in fsl_pci.c is called well after that, so don't bother
changing it.

(ppc_swiotlb is usually set in swiotlb_detect_4g, which is called by
a number of arch initcalls.)

Signed-off-by: Daniel Axtens <dja@axtens.net>
---
 arch/powerpc/sysdev/fsl_pci.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Michael Ellerman March 30, 2015, 12:32 p.m. UTC | #1
On Wed, 2015-25-03 at 05:35:38 UTC, Daniel Axtens wrote:
> The only function that checks ppc_swiotlb_enable is swiotlb_subsys_init.

.. which is a subsys initcall.

> The code in fsl_pci.c is called well after that, so don't bother
> changing it.

Hmm, I think we got this wrong. I don't remember exactly but it was probably me
who told you it could be removed, but I probably hadn't had a coffee yet :}

I see setup_pci_atmu() called by fsl_pci_syscore_do_resume(), ie. at runtime ==
late. So ignore that.

But also fsl_add_bridge(), called from fsl_pci_probe(), which is a platform
driver, registered at arch initcall via fsl_pci_init().

arch initcall happens *before* subsys, so in that case this will be effective.

So I think we need to leave it alone.

cheers
Daniel Axtens March 30, 2015, 11:57 p.m. UTC | #2
> Hmm, I think we got this wrong. I don't remember exactly but it was probably me
> who told you it could be removed, but I probably hadn't had a coffee yet :}
> 
> I see setup_pci_atmu() called by fsl_pci_syscore_do_resume(), ie. at runtime ==
> late. So ignore that.
> 
> But also fsl_add_bridge(), called from fsl_pci_probe(), which is a platform
> driver, registered at arch initcall via fsl_pci_init().
> 
> arch initcall happens *before* subsys, so in that case this will be effective.
> 
> So I think we need to leave it alone.
> 
OK, yeah you're right. Darn.

It looks like we can keep the general approach here, but drop this patch
and the rename patch. Then if we move the swiotlb hooks to the end of
fsl_add_bridge, everything should happen in the right order.

I'll get that into v2.

Thanks for the detailed checking!

-- d

> cheers
diff mbox

Patch

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 4b74c27..7071feb 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -376,9 +376,7 @@  static void setup_pci_atmu(struct pci_controller *hose)
 	}
 
 	if (hose->dma_window_size < mem) {
-#ifdef CONFIG_SWIOTLB
-		ppc_swiotlb_enable = 1;
-#else
+#ifndef CONFIG_SWIOTLB
 		pr_err("%s: ERROR: Memory size exceeds PCI ATMU ability to "
 			"map - enable CONFIG_SWIOTLB to avoid dma errors.\n",
 			 name);