Commit 35063bb2 authored by Geoff Levand's avatar Geoff Levand Committed by Paul Mackerras
Browse files

[POWERPC] PS3: Fix DMA scatter-gather

Add the missing pieces to support DMA scatter-gather on the PS3 system bus.

Signed-off-by: default avatarGeoff Levand <>
Acked-by: default avatarBenjamin Herrenschmidt <>
Signed-off-by: default avatarPaul Mackerras <>
parent 97ec1675
......@@ -272,10 +272,29 @@ static void ps3_unmap_single(struct device *_dev, dma_addr_t dma_addr,
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;
return -EPERM;
for (i = 0; i < nents; i++, sg++) {
int result = ps3_dma_map(dev->d_region,
page_to_phys(sg->page) + sg->offset, sg->length,
if (result) {
pr_debug("%s:%d: ps3_dma_map failed (%d)\n",
__func__, __LINE__, result);
return -EINVAL;
sg->dma_length = sg->length;
return nents;
return 0;
static void ps3_unmap_sg(struct device *_dev, struct scatterlist *sg,
......@@ -288,7 +307,7 @@ static void ps3_unmap_sg(struct device *_dev, struct scatterlist *sg,
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 = {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment