]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
serial: sh-sci: Do not probe the serial port if its slot in sci_ports[] is in use
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Thu, 16 Jan 2025 18:22:47 +0000 (20:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 12:49:44 +0000 (13:49 +0100)
commit77c97ed7c86380e12164c0741ff52a10d9ab0934
tree5bb143c16c3c4240295d9da4bd18cf3a1842ea30
parentcf174b3c1bd3378a802ab2041733a579193a6f89
serial: sh-sci: Do not probe the serial port if its slot in sci_ports[] is in use

commit 9f7dea875cc7f9c1a56a5c688290634a59cd1420 upstream.

In the sh-sci driver, sci_ports[0] is used by earlycon. If the earlycon is
still active when sci_probe() is called and the new serial port is supposed
to map to sci_ports[0], return -EBUSY to prevent breaking the earlycon.

This situation should occurs in debug scenarios, and users should be
aware of the potential conflict.

Fixes: 0b0cced19ab1 ("serial: sh-sci: Add CONFIG_SERIAL_EARLYCON support")
Cc: stable@vger.kernel.org
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://lore.kernel.org/r/20250116182249.3828577-4-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sh-sci.c