diff options
author | Andrew Jackson <Andrew.Jackson@arm.com> | 2014-11-07 09:14:47 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-07 11:35:56 -0500 |
commit | 2d3b7d6e7dc8785f9a6c0e4d38188dd1a0859d11 (patch) | |
tree | 17f4ea42ff0182799f516227714a32cb1fb0ca5c | |
parent | c64be9231e089350fa55c7e03adc79e341ab8e89 (diff) |
serial: pl011: Don't enable RX DMA if residue processing not supported
If the DMA engine doesn't support residue processing then the RX DMA
handling won't work terribly well if polling is enabled. So, disable
RX DMA if residue handling isn't available.
Signed-off-by: Andrew Jackson <Andrew.Jackson@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/amba-pl011.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 55dc00dd0e5e..d984a97043b3 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c | |||
@@ -322,7 +322,22 @@ static void pl011_dma_probe_initcall(struct device *dev, struct uart_amba_port * | |||
322 | .src_maxburst = uap->fifosize >> 2, | 322 | .src_maxburst = uap->fifosize >> 2, |
323 | .device_fc = false, | 323 | .device_fc = false, |
324 | }; | 324 | }; |
325 | struct dma_slave_caps caps; | ||
325 | 326 | ||
327 | /* | ||
328 | * Some DMA controllers provide information on their capabilities. | ||
329 | * If the controller does, check for suitable residue processing | ||
330 | * otherwise assime all is well. | ||
331 | */ | ||
332 | if (0 == dma_get_slave_caps(chan, &caps)) { | ||
333 | if (caps.residue_granularity == | ||
334 | DMA_RESIDUE_GRANULARITY_DESCRIPTOR) { | ||
335 | dma_release_channel(chan); | ||
336 | dev_info(uap->port.dev, | ||
337 | "RX DMA disabled - no residue processing\n"); | ||
338 | return; | ||
339 | } | ||
340 | } | ||
326 | dmaengine_slave_config(chan, &rx_conf); | 341 | dmaengine_slave_config(chan, &rx_conf); |
327 | uap->dmarx.chan = chan; | 342 | uap->dmarx.chan = chan; |
328 | 343 | ||