From patchwork Wed Mar 25 05:35:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 454173 X-Patchwork-Delegate: michael@ellerman.id.au Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id CCC1F140119 for ; Wed, 25 Mar 2015 16:50:45 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=axtens.net header.i=@axtens.net header.b=WwtZ+qqW; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 9B09D1A1D8D for ; Wed, 25 Mar 2015 16:50:45 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=axtens.net header.i=@axtens.net header.b=WwtZ+qqW; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pa0-x234.google.com (mail-pa0-x234.google.com [IPv6:2607:f8b0:400e:c03::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 70A131A088D for ; Wed, 25 Mar 2015 16:36:34 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=axtens.net header.i=@axtens.net header.b=WwtZ+qqW; dkim-adsp=pass; dkim-atps=neutral Received: by pacwe9 with SMTP id we9so17273475pac.1 for ; Tue, 24 Mar 2015 22:36:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RSje0QH8DIjwhds6vkDHrsbxPYOlVl7GDLIQoezo7C8=; b=WwtZ+qqWH2mx0mrJ5wUK8PAduYy8YVsK4LVXx0wVXQ3rYtF6D7dLEKeY5kqB5b+fYa JN3aCGwpfxM0HvrB039wYzGcO/1lLmH9l/mgrYG3YukCL0JXAYwq/kefq6XZM6Bw87zg Hx8HPGM51fHVDcW5HLxrVlS442E00lCngzabg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RSje0QH8DIjwhds6vkDHrsbxPYOlVl7GDLIQoezo7C8=; b=bqflKTCms3qjFYdBICSqqP4lEqdyUMMysPrXUPZ04Qmym/rT7m3azseoFyoVZgmHkI ut1QyV2q9c1tXEr6iCXujRShRfi26aRJFV/Ib4V3pOyu05N3GmaxsBwIH5tMBWP76cuy 9dOT89EOYEOubKL+GLQ0STK9X9My6v/XOOpwu5Ni1xGynQIwB3Xy1d/BpIPwZM0OyfPM U1ndzVCyYFX9zqEn+FYIhQ2qgvj1XY59iFKEeSsvhIYaT1VFy+cE4kfEG3JfFX8Eig5/ dvsKLpDs6DViY+F+Rog9TAwaXo7wJ4xib/5ZMEZvGabIvsbJyXaF8qlJwhzzzEv5tAId UzjA== X-Gm-Message-State: ALoCoQnHH0XfcgYEkOrG2iJYdbcPqW70Pc+JkT5MvQBFclZILX9TVFz9PPq+fijdee/FehFI6c2e X-Received: by 10.66.140.39 with SMTP id rd7mr13589693pab.25.1427261792443; Tue, 24 Mar 2015 22:36:32 -0700 (PDT) Received: from omicron.ozlabs.ibm.com ([122.99.82.10]) by mx.google.com with ESMTPSA id ve3sm1054803pbc.22.2015.03.24.22.36.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Mar 2015 22:36:31 -0700 (PDT) From: Daniel Axtens To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 08/27] powerpc: ppc_md.pci_dma_bus_setup -> pci_controller_ops.dma_bus_setup Date: Wed, 25 Mar 2015 16:35:42 +1100 Message-Id: <1427261761-22952-9-git-send-email-dja@axtens.net> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1427261761-22952-1-git-send-email-dja@axtens.net> References: <1427261761-22952-1-git-send-email-dja@axtens.net> Cc: Daniel Axtens X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Signed-off-by: Daniel Axtens --- arch/powerpc/include/asm/pci-bridge.h | 11 +++++++++++ arch/powerpc/kernel/pci-common.c | 3 +-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index 2474f29..680a46d 100644 --- a/arch/powerpc/include/asm/pci-bridge.h +++ b/arch/powerpc/include/asm/pci-bridge.h @@ -19,6 +19,7 @@ struct device_node; */ struct pci_controller_ops { void (*dma_dev_setup)(struct pci_dev *dev); + void (*dma_bus_setup)(struct pci_bus *bus); }; /* @@ -279,5 +280,15 @@ static inline void dma_dev_setup(struct pci_dev *dev) ppc_md.pci_dma_dev_setup(dev); } +static inline void dma_bus_setup(struct pci_bus *bus) +{ + struct pci_controller *hose = pci_bus_to_host(bus); + + if (hose->controller_ops.dma_bus_setup) + hose->controller_ops.dma_bus_setup(bus); + else if (ppc_md.pci_dma_bus_setup) + ppc_md.pci_dma_bus_setup(bus); +} + #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_PCI_BRIDGE_H */ diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 3ce6d0c..f5280ec 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -953,8 +953,7 @@ void pcibios_setup_bus_self(struct pci_bus *bus) ppc_md.pcibios_fixup_bus(bus); /* Setup bus DMA mappings */ - if (ppc_md.pci_dma_bus_setup) - ppc_md.pci_dma_bus_setup(bus); + dma_bus_setup(bus); } static void pcibios_setup_device(struct pci_dev *dev)