]> git.baikalelectronics.ru Git - kernel.git/commit
serial: core: fix port-lock initialisation
authorJohan Hovold <johan@kernel.org>
Wed, 9 Sep 2020 14:31:00 +0000 (16:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Sep 2020 11:22:10 +0000 (13:22 +0200)
commit1270ad84512e29e8db510e295ad45213e3059c47
tree3a718fd52c2788836eda9320438748bfa1437516
parentbeea5f8bd9170d3d0e6476d33bde88d795ce40b0
serial: core: fix port-lock initialisation

Commit 143453cbd3db ("serial: core: Initialise spin lock before use in
uart_configure_port()") tried to work around a breakage introduced by
commit e4b5942f8567 ("serial: core: Allow detach and attach serial
device for console") by adding a second initialisation of the port lock
when registering the port.

As reported by the build robots [1], this doesn't really solve the
regression introduced by the console-detach changes and also adds a
second redundant initialisation of the lock for normal ports.

Start cleaning up this mess by removing the redundant initialisation and
making sure that the port lock is again initialised once-only for ports
that aren't already in use as a console.

[1] https://lore.kernel.org/r/20200802054852.GR23458@shao2-debian

Fixes: 143453cbd3db ("serial: core: Initialise spin lock before use in uart_configure_port()")
Fixes: e4b5942f8567 ("serial: core: Allow detach and attach serial device for console")
Cc: stable <stable@vger.kernel.org> # 5.7
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200909143101.15389-2-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c