linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Nishanth Aravamudan <nacc@us.ibm.com>
Cc: Brian King <brking@linux.vnet.ibm.com>,
	Paul Mackerras <paulus@samba.org>,
	linuxppc-dev@lists.ozlabs.org, Milton Miller <miltonm@bga.com>
Subject: Re: [PATCH 09/15] ppc/vio: use dma ops helpers
Date: Wed, 15 Sep 2010 12:33:30 -0600	[thread overview]
Message-ID: <AANLkTim2Sie0Hop7Akn2CsSgEMPOdq5kDRcfcnAFtghS@mail.gmail.com> (raw)
In-Reply-To: <1284573958-8397-10-git-send-email-nacc@us.ibm.com>

On Wed, Sep 15, 2010 at 12:05 PM, Nishanth Aravamudan <nacc@us.ibm.com> wro=
te:
> Use the set_dma_ops helper. Instead of modifying vio_dma_mapping_ops,
> just create a trivial wrapper for dma_supported.
>
> Signed-off-by: Milton Miller <miltonm@bga.com>
> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>

Looks right to me.

> ---
> =A0arch/powerpc/kernel/vio.c | =A0 11 ++++++++---
> =A01 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
> index d692989..3c3083f 100644
> --- a/arch/powerpc/kernel/vio.c
> +++ b/arch/powerpc/kernel/vio.c
> @@ -602,6 +602,11 @@ static void vio_dma_iommu_unmap_sg(struct device *de=
v,
> =A0 =A0 =A0 =A0vio_cmo_dealloc(viodev, alloc_size);
> =A0}
>
> +static int vio_dma_iommu_dma_supported(struct device *dev, u64 mask)
> +{
> + =A0 =A0 =A0 =A0return dma_iommu_ops.dma_supported(dev, mask);
> +}
> +
> =A0struct dma_map_ops vio_dma_mapping_ops =3D {
> =A0 =A0 =A0 =A0.alloc_coherent =3D vio_dma_iommu_alloc_coherent,
> =A0 =A0 =A0 =A0.free_coherent =A0=3D vio_dma_iommu_free_coherent,
> @@ -609,6 +614,7 @@ struct dma_map_ops vio_dma_mapping_ops =3D {
> =A0 =A0 =A0 =A0.unmap_sg =A0 =A0 =A0 =3D vio_dma_iommu_unmap_sg,
> =A0 =A0 =A0 =A0.map_page =A0 =A0 =A0 =3D vio_dma_iommu_map_page,
> =A0 =A0 =A0 =A0.unmap_page =A0 =A0 =3D vio_dma_iommu_unmap_page,
> + =A0 =A0 =A0 .dma_supported =A0=3D vio_dma_iommu_dma_supported,
>
> =A0};
>
> @@ -860,8 +866,7 @@ static void vio_cmo_bus_remove(struct vio_dev *viodev=
)
>
> =A0static void vio_cmo_set_dma_ops(struct vio_dev *viodev)
> =A0{
> - =A0 =A0 =A0 vio_dma_mapping_ops.dma_supported =3D dma_iommu_ops.dma_sup=
ported;
> - =A0 =A0 =A0 viodev->dev.archdata.dma_ops =3D &vio_dma_mapping_ops;
> + =A0 =A0 =A0 set_dma_ops(&viodev->dev, &vio_dma_mapping_ops);
> =A0}
>
> =A0/**
> @@ -1246,7 +1251,7 @@ struct vio_dev *vio_register_device_node(struct dev=
ice_node *of_node)
> =A0 =A0 =A0 =A0if (firmware_has_feature(FW_FEATURE_CMO))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vio_cmo_set_dma_ops(viodev);
> =A0 =A0 =A0 =A0else
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 viodev->dev.archdata.dma_ops =3D &dma_iommu=
_ops;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 set_dma_ops(&viodev->dev, &dma_iommu_ops);
> =A0 =A0 =A0 =A0set_iommu_table_base(&viodev->dev, vio_build_iommu_table(v=
iodev));
> =A0 =A0 =A0 =A0set_dev_node(&viodev->dev, of_node_to_nid(of_node));
>
> --
> 1.7.0.4
>
>



--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

  reply	other threads:[~2010-09-15 18:33 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1284573958-8397-1-git-send-email-nacc@us.ibm.com>
2010-09-15 18:05 ` [PATCH 02/15] ppc64: fix dma_iommu_dma_supported compare Nishanth Aravamudan
2010-09-15 18:05 ` [PATCH 03/15] ppc64 iommu: fix check for direct DMA support Nishanth Aravamudan
2010-09-15 18:05 ` [PATCH 04/15] vio: put device on device_register failure Nishanth Aravamudan
2010-09-15 18:29   ` Grant Likely
2010-09-15 18:05 ` [PATCH 05/15] viobus: free TCE table on device release Nishanth Aravamudan
2010-09-15 18:05 ` [PATCH 06/15] pseries/dlpar: use kmemdup Nishanth Aravamudan
2010-09-15 18:05 ` [PATCH 07/15] ppc: pci-common cleanup Nishanth Aravamudan
2010-09-15 18:30   ` Grant Likely
2010-09-15 18:05 ` [PATCH 09/15] ppc/vio: use dma ops helpers Nishanth Aravamudan
2010-09-15 18:33   ` Grant Likely [this message]
2010-10-13  4:56     ` Benjamin Herrenschmidt
2010-10-13 17:43       ` Nishanth Aravamudan
2010-09-15 18:05 ` [PATCH 10/15] ppc/pasemi: clean up pasemi iommu table initializations Nishanth Aravamudan
2010-09-15 18:29   ` Olof Johansson
2010-09-15 18:05 ` [PATCH 11/15] ppc/cell: beat dma ops cleanup Nishanth Aravamudan
2010-09-16 11:23   ` Arnd Bergmann
2010-09-15 18:05 ` [PATCH 12/15] ppc/dart: iommu table cleanup Nishanth Aravamudan
2010-09-15 18:05 ` [PATCH 13/15] ppc/pseries: iommu cleanup Nishanth Aravamudan
2010-09-15 18:34   ` Grant Likely
2010-09-15 18:05 ` [PATCH 14/15] ppc64 iommu: use coherent_dma_mask for alloc_coherent Nishanth Aravamudan
2010-11-29  0:58   ` Benjamin Herrenschmidt
2010-12-01  0:31     ` Nishanth Aravamudan
2010-09-15 18:05 ` [PATCH 15/15] ppc/vio: ensure dma_coherent_mask is set Nishanth Aravamudan
2010-09-15 18:37   ` Grant Likely
2010-09-15 18:44     ` Nishanth Aravamudan
2010-09-15 18:49       ` Grant Likely
2010-11-29  1:02   ` Benjamin Herrenschmidt
2010-11-29 19:46     ` Nishanth Aravamudan
2010-11-29 20:25       ` Benjamin Herrenschmidt
2010-09-15 18:13 ` [PATCH 01/15] ppc: fix return type of BUID_{HI,LO} macros Nishanth Aravamudan
2010-09-16 22:54   ` Linas Vepstas
2010-09-16 23:04     ` Scott Wood

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=AANLkTim2Sie0Hop7Akn2CsSgEMPOdq5kDRcfcnAFtghS@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=brking@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=miltonm@bga.com \
    --cc=nacc@us.ibm.com \
    --cc=paulus@samba.org \
    /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).