diff options
author | Anatolij Gustschin <agust@denx.de> | 2013-03-09 06:43:54 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-12 11:53:22 -0400 |
commit | 09081e5b47f6842669bb645e015deedf191244f4 (patch) | |
tree | 38b5cf907559057cf090bed29c0581211fbdfa15 /drivers/tty | |
parent | 34dcfb8479ab3c3669561eb9279284cb0eda2572 (diff) |
tty: serial: mpc5xxx: fix PSC clock name bug
mpc512x platform clock code names PSC clocks as "pscX_mclk" but
the driver tries to get "pscX_clk" clock and this results in
errors like:
mpc52xx-psc-uart 80011700.psc: Failed to get PSC clock entry!
The problem appears when opening ttyPSC devices other than the
system's serial console. Since getting and enabling the PSC clock
fails, uart port startup doesn't succeed and tty flag TTY_IO_ERROR
remains set causing further errors in tty ioctls, i.e.
'strace stty -F /dev/ttyPSC1' shows:
open("/dev/ttyPSC1", O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 3
dup2(3, 0) = 0
close(3) = 0
fcntl64(0, F_GETFL) = 0x10800 (flags O_RDONLY|O_NONBLOCK|O_LARGEFILE)
fcntl64(0, F_SETFL, O_RDONLY|O_LARGEFILE) = 0
ioctl(0, TCGETS, 0xbff89038) = -1 EIO (Input/output error)
Only request PSC clock names that the platform actually provides.
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/mpc52xx_uart.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c index c0e1fad51be7..018bad922554 100644 --- a/drivers/tty/serial/mpc52xx_uart.c +++ b/drivers/tty/serial/mpc52xx_uart.c | |||
@@ -550,7 +550,7 @@ static int mpc512x_psc_clock(struct uart_port *port, int enable) | |||
550 | return 0; | 550 | return 0; |
551 | 551 | ||
552 | psc_num = (port->mapbase & 0xf00) >> 8; | 552 | psc_num = (port->mapbase & 0xf00) >> 8; |
553 | snprintf(clk_name, sizeof(clk_name), "psc%d_clk", psc_num); | 553 | snprintf(clk_name, sizeof(clk_name), "psc%d_mclk", psc_num); |
554 | psc_clk = clk_get(port->dev, clk_name); | 554 | psc_clk = clk_get(port->dev, clk_name); |
555 | if (IS_ERR(psc_clk)) { | 555 | if (IS_ERR(psc_clk)) { |
556 | dev_err(port->dev, "Failed to get PSC clock entry!\n"); | 556 | dev_err(port->dev, "Failed to get PSC clock entry!\n"); |