950-0249-serial-8250-bcm2835aux-defer-if-clock-is-zero.patch 967 B

12345678910111213141516171819202122232425262728
  1. From 34fb077ceed5166f4426daf21287d2ff4c0d65ca Mon Sep 17 00:00:00 2001
  2. From: Phil Elwell <[email protected]>
  3. Date: Thu, 2 Jul 2020 13:53:20 +0100
  4. Subject: [PATCH] serial: 8250: bcm2835aux - defer if clock is zero
  5. See: https://github.com/raspberrypi/linux/issues/3700
  6. Signed-off-by: Phil Elwell <[email protected]>
  7. ---
  8. drivers/tty/serial/8250/8250_bcm2835aux.c | 7 +++++++
  9. 1 file changed, 7 insertions(+)
  10. --- a/drivers/tty/serial/8250/8250_bcm2835aux.c
  11. +++ b/drivers/tty/serial/8250/8250_bcm2835aux.c
  12. @@ -182,6 +182,13 @@ static int bcm2835aux_serial_probe(struc
  13. */
  14. up.port.uartclk = uartclk * 2;
  15. + /* The clock is only queried at probe time, which means we get one shot
  16. + * at this. A zero clock is never going to work and is almost certainly
  17. + * due to a parent not being ready, so prefer to defer.
  18. + */
  19. + if (!up.port.uartclk)
  20. + return -EPROBE_DEFER;
  21. +
  22. /* register the port */
  23. ret = serial8250_register_8250_port(&up);
  24. if (ret < 0) {