[PATCH 6/7] ARM: PL011: Add support for transmit DMA

Rabin Vincent rabin at rab.in
Mon Jan 3 06:12:18 EST 2011


On Mon, Jan 3, 2011 at 15:40, Russell King - ARM Linux
<linux at arm.linux.org.uk> wrote:
> +       if (dma_map_sg(dma_dev->dev, &dmatx->sg, 1, DMA_TO_DEVICE) != 1) {
> +               uap->dmatx.queued = false;
> +               dev_dbg(uap->port.dev, "unable to map TX DMA\n");
> +               return -EBUSY;
> +       }
> +
> +       desc = dma_dev->device_prep_slave_sg(chan, &dmatx->sg, 1, DMA_TO_DEVICE,
> +                                            DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
> +       if (!desc) {
> +               uap->dmatx.queued = false;

Doesn't dma_unmap_sg need to be called here?

> +               /*
> +                * If DMA cannot be used right now, we complete this
> +                * transaction via IRQ and let the TTY layer retry.
> +                */
> +               dev_dbg(uap->port.dev, "TX DMA busy\n");
> +               return -EBUSY;
> +       }



More information about the linux-arm-kernel mailing list