lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230609133932.786117-3-u.kleine-koenig@pengutronix.de>
Date:   Fri,  9 Jun 2023 15:39:32 +0200
From:   Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jirislaby@...nel.org>
Cc:     Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
        Johan Hovold <johan@...nel.org>,
        Lino Sanfilippo <l.sanfilippo@...bus.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Kumaravel Thiagarajan <kumaravel.thiagarajan@...rochip.com>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Helge Deller <deller@....de>,
        Randy Dunlap <rdunlap@...radead.org>,
        James Hilliard <james.hilliard1@...il.com>,
        Matthew Gerlach <matthew.gerlach@...ux.intel.com>,
        linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel@...gutronix.de
Subject: [PATCH v4 2/2] serial: 8250: Apply FSL workarounds also without SERIAL_8250_CONSOLE

The need to handle the FSL variant of 8250 in a special way is also
present without console support. So soften the dependency for
SERIAL_8250_FSL from SERIAL_8250_CONSOLE to SERIAL_8250. To handle
SERIAL_8250=m, the FSL code can be modular, too, thus SERIAL_8250_FSL
becomes tristate.

Compiling 8250_fsl as a module requires adding a module license so this
is added, too. While add it also add a appropriate module description.

As then SERIAL_OF_PLATFORM=y + SERIAL_8250_FSL=m is a valid combination
(if COMPILE_TEST is enabled on a platform that is neither PPC, ARM nor
ARM64), the check in 8250_of.c must be weakened a bit.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
---
 drivers/tty/serial/8250/8250_fsl.c | 3 +++
 drivers/tty/serial/8250/8250_of.c  | 2 +-
 drivers/tty/serial/8250/Kconfig    | 6 +++---
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_fsl.c b/drivers/tty/serial/8250/8250_fsl.c
index 00f46b9a8b09..6af4e1c1210a 100644
--- a/drivers/tty/serial/8250/8250_fsl.c
+++ b/drivers/tty/serial/8250/8250_fsl.c
@@ -184,3 +184,6 @@ static struct platform_driver fsl8250_platform_driver = {
 
 module_platform_driver(fsl8250_platform_driver);
 #endif
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Handling of Freescale specific 8250 variants");
diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
index c9f6bd7a7038..51329625c48a 100644
--- a/drivers/tty/serial/8250/8250_of.c
+++ b/drivers/tty/serial/8250/8250_of.c
@@ -177,7 +177,7 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
 		break;
 	}
 
-	if (IS_ENABLED(CONFIG_SERIAL_8250_FSL) &&
+	if (IS_REACHABLE(CONFIG_SERIAL_8250_FSL) &&
 	    (of_device_is_compatible(np, "fsl,ns16550") ||
 	     of_device_is_compatible(np, "fsl,16550-FIFO64"))) {
 		port->handle_irq = fsl8250_handle_irq;
diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
index cf33e858b0be..ee17cf5c44c6 100644
--- a/drivers/tty/serial/8250/Kconfig
+++ b/drivers/tty/serial/8250/Kconfig
@@ -379,9 +379,9 @@ config SERIAL_8250_BCM2835AUX
 	  If unsure, say N.
 
 config SERIAL_8250_FSL
-	bool "Freescale 16550 UART support" if COMPILE_TEST && !(PPC || ARM || ARM64)
-	depends on SERIAL_8250_CONSOLE
-	default PPC || ARM || ARM64
+	tristate "Freescale 16550 UART support" if COMPILE_TEST && !(PPC || ARM || ARM64)
+	depends on SERIAL_8250
+	default SERIAL_8250 if PPC || ARM || ARM64
 	help
 	  Selecting this option enables a workaround for a break-detection
 	  erratum for Freescale 16550 UARTs in the 8250 driver. It also
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ