summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-05-25 13:59:52 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-17 16:42:51 +0200
commitacba9bd0d0a9757f148e72f84d38d4cd3b7e390d (patch)
tree0b30b5730918f3aec7fb925407f396844caf6018
parent5acd7d78daa790671e9437414921b867d04504c7 (diff)
downloadlinux-stable-acba9bd0d0a9757f148e72f84d38d4cd3b7e390d.tar.gz
linux-stable-acba9bd0d0a9757f148e72f84d38d4cd3b7e390d.tar.bz2
linux-stable-acba9bd0d0a9757f148e72f84d38d4cd3b7e390d.zip
serial: imx: Initialize lock for non-registered console
commit 8f065acec7573672dd15916e31d1e9b2e785566c upstream. The commit a3cb39d258ef ("serial: core: Allow detach and attach serial device for console") changed a bit logic behind lock initialization since for most of the console driver it's supposed to have lock already initialized even if console is not enabled. However, it's not the case for Freescale IMX console. Initialize lock explicitly in the ->probe(). Note, there is still an open question should or shouldn't not this driver register console properly. Fixes: a3cb39d258ef ("serial: core: Allow detach and attach serial device for console") Reported-by: Guenter Roeck <linux@roeck-us.net> Cc: stable <stable@vger.kernel.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20200525105952.13744-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/imx.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index f4d68109bc8b..d5979a8bdc40 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2398,6 +2398,9 @@ static int imx_uart_probe(struct platform_device *pdev)
}
}
+ /* We need to initialize lock even for non-registered console */
+ spin_lock_init(&sport->port.lock);
+
imx_uart_ports[sport->port.line] = sport;
platform_set_drvdata(pdev, sport);