Skip to content

Commit 1bfcbe5

Browse files
ij-intelgregkh
authored andcommitted
serial: 8250_lpss: Configure DMA also w/o DMA filter
If the platform doesn't use DMA device filter (as is the case with Elkhart Lake), whole lpss8250_dma_setup() setup is skipped. This results in skipping also *_maxburst setup which is undesirable. Refactor lpss8250_dma_setup() to configure DMA even if filter is not setup. Cc: stable <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a931237 commit 1bfcbe5

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

drivers/tty/serial/8250/8250_lpss.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,13 @@ static int lpss8250_dma_setup(struct lpss8250 *lpss, struct uart_8250_port *port
277277
struct dw_dma_slave *rx_param, *tx_param;
278278
struct device *dev = port->port.dev;
279279

280-
if (!lpss->dma_param.dma_dev)
280+
if (!lpss->dma_param.dma_dev) {
281+
dma = port->dma;
282+
if (dma)
283+
goto out_configuration_only;
284+
281285
return 0;
286+
}
282287

283288
rx_param = devm_kzalloc(dev, sizeof(*rx_param), GFP_KERNEL);
284289
if (!rx_param)
@@ -289,16 +294,18 @@ static int lpss8250_dma_setup(struct lpss8250 *lpss, struct uart_8250_port *port
289294
return -ENOMEM;
290295

291296
*rx_param = lpss->dma_param;
292-
dma->rxconf.src_maxburst = lpss->dma_maxburst;
293-
294297
*tx_param = lpss->dma_param;
295-
dma->txconf.dst_maxburst = lpss->dma_maxburst;
296298

297299
dma->fn = lpss8250_dma_filter;
298300
dma->rx_param = rx_param;
299301
dma->tx_param = tx_param;
300302

301303
port->dma = dma;
304+
305+
out_configuration_only:
306+
dma->rxconf.src_maxburst = lpss->dma_maxburst;
307+
dma->txconf.dst_maxburst = lpss->dma_maxburst;
308+
302309
return 0;
303310
}
304311

0 commit comments

Comments
 (0)