On Mon, Jan 3, 2011 at 15:40, Russell King - ARM Linux
[off-list ref] 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;
+ ? ? ? }