Skip to content

Commit 3732b68

Browse files
phdmgregungerer
authored andcommitted
m68knommu: fix coldfire tcdrain
Fix tcdrain on coldfire uarts. Currently with coldfire uarts tcdrain returns without waiting for txempty, because (tx)fifosize is 0. Fix that and call uart_update_timeout when setting the baud rate, otherwise tcdrain will wait for an half our :) Also constify mcf_uart_ops. Signed-off-by: Philippe De Muyter <[email protected]> Signed-off-by: Greg Ungerer <[email protected]>
1 parent 6ecaf44 commit 3732b68

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

arch/m68k/include/asm/mcfuart.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,5 +212,10 @@ struct mcf_platform_uart {
212212
#define MCFUART_URF_RXS 0xc0 /* Receiver status */
213213
#endif
214214

215+
#if defined(CONFIG_M5272)
216+
#define MCFUART_TXFIFOSIZE 25
217+
#else
218+
#define MCFUART_TXFIFOSIZE 1
219+
#endif
215220
/****************************************************************************/
216221
#endif /* mcfuart_h */

drivers/serial/mcf.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ static void mcf_set_termios(struct uart_port *port, struct ktermios *termios,
263263
}
264264

265265
spin_lock_irqsave(&port->lock, flags);
266+
uart_update_timeout(port, termios->c_cflag, baud);
266267
writeb(MCFUART_UCR_CMDRESETRX, port->membase + MCFUART_UCR);
267268
writeb(MCFUART_UCR_CMDRESETTX, port->membase + MCFUART_UCR);
268269
writeb(MCFUART_UCR_CMDRESETMRPTR, port->membase + MCFUART_UCR);
@@ -379,6 +380,7 @@ static irqreturn_t mcf_interrupt(int irq, void *data)
379380
static void mcf_config_port(struct uart_port *port, int flags)
380381
{
381382
port->type = PORT_MCF;
383+
port->fifosize = MCFUART_TXFIFOSIZE;
382384

383385
/* Clear mask, so no surprise interrupts. */
384386
writeb(0, port->membase + MCFUART_UIMR);
@@ -424,7 +426,7 @@ static int mcf_verify_port(struct uart_port *port, struct serial_struct *ser)
424426
/*
425427
* Define the basic serial functions we support.
426428
*/
427-
static struct uart_ops mcf_uart_ops = {
429+
static const struct uart_ops mcf_uart_ops = {
428430
.tx_empty = mcf_tx_empty,
429431
.get_mctrl = mcf_get_mctrl,
430432
.set_mctrl = mcf_set_mctrl,

0 commit comments

Comments
 (0)