Commit ddedfd82 authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman

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: default avatarPeter Hurley <peter@hurleysoftware.com>
Reviewed-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ec5a11a9
...@@ -201,6 +201,15 @@ int serial8250_request_dma(struct uart_8250_port *p) ...@@ -201,6 +201,15 @@ int serial8250_request_dma(struct uart_8250_port *p)
goto release_rx; 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); dmaengine_slave_config(dma->txchan, &dma->txconf);
/* RX buffer */ /* RX buffer */
......
Markdown is supported
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