diff options
| author | Peter Hurley <[email protected]> | 2016-04-09 22:14:33 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2016-04-30 09:26:55 -0700 |
| commit | ddedfd82bc61c8d8d4d0eb754a9bcebb2e84de75 (patch) | |
| tree | 149e9e339cb29f788e657384670eaca0da0648ed | |
| parent | ec5a11a91eecd81ef19b8044a243b4ea56c809e6 (diff) | |
serial: 8250: Validate dmaengine tx chan meets requirements
8250 dma support requires the dmaegine driver support terminate.
Query slave caps to determine if necessary commands/properties are
supported; disable dma if not.
Note this means dmaengine driver must support slave caps reporting
as well.
Signed-off-by: Peter Hurley <[email protected]>
Reviewed-by: Heikki Krogerus <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
| -rw-r--r-- | drivers/tty/serial/8250/8250_dma.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/tty/serial/8250/8250_dma.c b/drivers/tty/serial/8250/8250_dma.c index cf7a2e3288a6..7a26c4d13b18 100644 --- a/drivers/tty/serial/8250/8250_dma.c +++ b/drivers/tty/serial/8250/8250_dma.c @@ -201,6 +201,15 @@ int serial8250_request_dma(struct uart_8250_port *p) goto release_rx; } + /* 8250 tx dma requires dmaengine driver to support terminate */ + ret = dma_get_slave_caps(dma->txchan, &caps); + if (ret) + goto err; + if (!caps.cmd_terminate) { + ret = -EINVAL; + goto err; + } + dmaengine_slave_config(dma->txchan, &dma->txconf); /* RX buffer */ |