From: Will Schmidt <will_schmidt@vnet.ibm.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: ppc-dev <linuxppc-dev@ozlabs.org>, paulus@samba.org
Subject: Re: [PATCH 2/6] [POWERPC] create and use get_pci_dma_ops(
Date: Mon, 05 Mar 2007 10:31:11 -0600 [thread overview]
Message-ID: <1173112272.5877.5.camel@localhost> (raw)
In-Reply-To: <20070304170241.816f9802.sfr@canb.auug.org.au>
On Sun, 2007-04-03 at 17:02 +1100, Stephen Rothwell wrote:
> This allows us to hide pci_dma_ops.
>
<snippage>
> -EXPORT_SYMBOL(pci_dma_ops);
> +EXPORT_SYMBOL(get_pci_dma_ops);
should this one be EXPORT_SYMBOL_GPL(get_pci_dma_ops);
or is it grandfathered in because it is replacing and renaming
EXPORT_SYMBOL(pci_dma_ops); ?
-Will
> +
> static void fixup_broken_pcnet32(struct pci_dev* dev)
> {
> if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
> diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
> index d0e02ea..7c953cc 100644
> --- a/arch/powerpc/platforms/cell/iommu.c
> +++ b/arch/powerpc/platforms/cell/iommu.c
> @@ -496,7 +496,7 @@ static void cell_dma_dev_setup(struct device *dev)
> struct dev_archdata *archdata = &dev->archdata;
>
> /* If we run without iommu, no need to do anything */
> - if (pci_dma_ops == &dma_direct_ops)
> + if (get_pci_dma_ops() == &dma_direct_ops)
> return;
>
> /* Current implementation uses the first window available in that
> @@ -530,7 +530,7 @@ static int cell_of_bus_notify(struct notifier_block *nb, unsigned long action,
> return 0;
>
> /* We use the PCI DMA ops */
> - dev->archdata.dma_ops = pci_dma_ops;
> + dev->archdata.dma_ops = get_pci_dma_ops();
>
> cell_dma_dev_setup(dev);
>
> diff --git a/arch/powerpc/platforms/celleb/iommu.c b/arch/powerpc/platforms/celleb/iommu.c
> index fecc4ff..e94de6a 100644
> --- a/arch/powerpc/platforms/celleb/iommu.c
> +++ b/arch/powerpc/platforms/celleb/iommu.c
> @@ -80,7 +80,7 @@ static int celleb_of_bus_notify(struct notifier_block *nb,
> if (action != BUS_NOTIFY_ADD_DEVICE)
> return 0;
>
> - dev->archdata.dma_ops = pci_dma_ops;
> + dev->archdata.dma_ops = get_pci_dma_ops();
>
> return 0;
> }
> diff --git a/include/asm-powerpc/pci.h b/include/asm-powerpc/pci.h
> index ebf31f1..ce0f13e 100644
> --- a/include/asm-powerpc/pci.h
> +++ b/include/asm-powerpc/pci.h
> @@ -71,17 +71,18 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
> #define PCI_DISABLE_MWI
>
> #ifdef CONFIG_PCI
> -extern struct dma_mapping_ops *pci_dma_ops;
> -
> extern void set_pci_dma_ops(struct dma_mapping_ops *dma_ops);
> +extern struct dma_mapping_ops *get_pci_dma_ops(void);
>
> /* For DAC DMA, we currently don't support it by default, but
> * we let 64-bit platforms override this.
> */
> static inline int pci_dac_dma_supported(struct pci_dev *hwdev,u64 mask)
> {
> - if (pci_dma_ops && pci_dma_ops->dac_dma_supported)
> - return pci_dma_ops->dac_dma_supported(&hwdev->dev, mask);
> + struct dma_mapping_ops *d = get_pci_dma_ops();
> +
> + if (d && d->dac_dma_supported)
> + return d->dac_dma_supported(&hwdev->dev, mask);
> return 0;
> }
>
> @@ -103,6 +104,7 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
> }
> #else /* CONFIG_PCI */
> #define set_pci_dma_ops(d)
> +#define get_pci_dma_ops() NULL
> #endif
>
> extern int pci_domain_nr(struct pci_bus *bus);
next prev parent reply other threads:[~2007-03-05 16:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-04 5:58 [PATCH 1/6] [POWERPC] create and use set_pci_dma_ops Stephen Rothwell
2007-03-04 6:02 ` [PATCH 2/6] [POWERPC] create and use get_pci_dma_ops( Stephen Rothwell
2007-03-04 6:03 ` [PATCH 3/6] [POWERPC] make iSeries build without CONFIG_PCI Stephen Rothwell
2007-03-04 6:04 ` [PATCH 4/6] [POWERPC] allow pSeries to " Stephen Rothwell
2007-03-04 6:05 ` [PATCH 5/6] [POWERPC] allow xmon to build without CONFIG_DEBUG_BUGVERBOSE Stephen Rothwell
2007-03-04 6:07 ` [PATCH 6/6] [POWERPC] make find_and_init_pbs() a void function Stephen Rothwell
2007-03-04 14:07 ` [PATCH 4/6] [POWERPC] allow pSeries to build without CONFIG_PCI Arnd Bergmann
2007-03-04 16:37 ` Anton Blanchard
2007-03-04 18:43 ` Benjamin Herrenschmidt
2007-03-04 18:59 ` Arnd Bergmann
2007-03-05 9:02 ` Benjamin Herrenschmidt
2007-03-05 9:06 ` Geert Uytterhoeven
2007-03-06 1:57 ` Stephen Rothwell
2007-03-07 5:47 ` [POWERPC] Clean up deciding when PCI is selectable Stephen Rothwell
2007-03-07 6:53 ` Benjamin Herrenschmidt
2007-03-05 16:31 ` Will Schmidt [this message]
2007-03-05 22:55 ` [PATCH 2/6] [POWERPC] create and use get_pci_dma_ops( Stephen Rothwell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1173112272.5877.5.camel@localhost \
--to=will_schmidt@vnet.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=sfr@canb.auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).