From: Benjamin Herrenschmidt <benh@kernel•crashing.org>
To: Geoff Levand <geoffrey.levand@am•sony.com>
Cc: linuxppc-dev@ozlabs•org, Paul Mackerras <paulus@samba•org>
Subject: Re: [PATCH 3/4] PS3: Fix DMA scatter-gather
Date: Wed, 07 Feb 2007 11:42:56 +1100 [thread overview]
Message-ID: <1170808976.2620.268.camel@localhost.localdomain> (raw)
In-Reply-To: <45BFD2C2.70000@am.sony.com>
On Tue, 2007-01-30 at 15:20 -0800, Geoff Levand wrote:
> Add the missing pieces to support DMA scatter-gather on the PS3 system bus.
>
> Signed-off-by: Geoff Levand <geoffrey.levand@am•sony.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel•crashing.org>
---
I'll help with the dynamic DMA stuff as soon as I find a minute free..
Ben.
>
> ---
>
> USB mass storage works properly now.
>
> arch/powerpc/platforms/ps3/system-bus.c | 23 +++++++++++++++++++++--
> 1 files changed, 21 insertions(+), 2 deletions(-)
>
> --- ps3-linux-dev.orig/arch/powerpc/platforms/ps3/system-bus.c
> +++ ps3-linux-dev/arch/powerpc/platforms/ps3/system-bus.c
> @@ -272,10 +272,29 @@ static void ps3_unmap_single(struct devi
> static int ps3_map_sg(struct device *_dev, struct scatterlist *sg, int nents,
> enum dma_data_direction direction)
> {
> + struct ps3_system_bus_device *dev = to_ps3_system_bus_device(_dev);
> + int i;
> +
> #if defined(CONFIG_PS3_DYNAMIC_DMA)
> BUG_ON("do");
> + return -EPERM;
> +#else
> + for (i = 0; i < nents; i++, sg++) {
> + int result = ps3_dma_map(dev->d_region,
> + page_to_phys(sg->page) + sg->offset, sg->length,
> + &sg->dma_address);
> +
> + if (result) {
> + pr_debug("%s:%d: ps3_dma_map failed (%d)\n",
> + __func__, __LINE__, result);
> + return -EINVAL;
> + }
> +
> + sg->dma_length = sg->length;
> + }
> +
> + return nents;
> #endif
> - return 0;
> }
>
> static void ps3_unmap_sg(struct device *_dev, struct scatterlist *sg,
> @@ -288,7 +307,7 @@ static void ps3_unmap_sg(struct device *
>
> static int ps3_dma_supported(struct device *_dev, u64 mask)
> {
> - return 1;
> + return mask >= DMA_32BIT_MASK;
> }
>
> static struct dma_mapping_ops ps3_dma_ops = {
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs•org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
next prev parent reply other threads:[~2007-02-07 0:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-30 23:20 [PATCH 3/4] PS3: Fix DMA scatter-gather Geoff Levand
2007-02-06 13:22 ` Arnd Bergmann
2007-02-06 16:43 ` Geoff Levand
2007-02-07 0:42 ` Benjamin Herrenschmidt [this message]
2007-02-07 7:43 ` Arnd Bergmann
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=1170808976.2620.268.camel@localhost.localdomain \
--to=benh@kernel$(echo .)crashing.org \
--cc=geoffrey.levand@am$(echo .)sony.com \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=paulus@samba$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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