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: <20140217155451.34b2c749@alan.etchedpixels.co.uk>
Date:	Mon, 17 Feb 2014 15:54:51 +0000
From:	One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>
To:	One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>
Cc:	Russell King - ARM Linux <linux@....linux.org.uk>,
	Greg KH <gregkh@...uxfoundation.org>,
	Tushar Behera <tushar.behera@...aro.org>,
	linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
	linux-samsung-soc@...r.kernel.org, jslaby@...e.cz,
	ben.dooks@...ethink.co.uk, broonie@...nel.org
Subject: Re: [PATCH 2/2] serial: pl011: Move uart_register_driver call to
 device probe

And an even simpler broad brush approach will also work I think (untested)

The "zero crap" approach....

commit c5cd0be0576ba9059799ef5383402ff6ffc212a3
Author: Alan <gnomes@...rguk.ukuu.org.uk>
Date:   Mon Feb 17 15:52:21 2014 +0000

    tty: Allow serial port allocations to be fully dynamic
    
    This switch allows platforms to make their serial port allocations entirely
    dynamic as is needed on some non-x86 platforms which have overlapping static
    minor numbers between some of their devices.
    
    Default to the old static allocations for maximum compatibility with ancient
    userspace.
    
    Signed-off-by: Alan Cox <alan@...ux.intel.com>

diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
index 65cd80b..670c076 100644
--- a/drivers/tty/Kconfig
+++ b/drivers/tty/Kconfig
@@ -166,6 +166,16 @@ config LEGACY_PTY_COUNT
 	  When not in use, each legacy PTY occupies 12 bytes on 32-bit
 	  architectures and 24 bytes on 64-bit architectures.
 
+config TTY_SERIAL_LEGACY
+	bool "Allocate legacy fixed minor numbers for serial ports"
+	default y
+	---help---
+	  Modern linux dynamically allocates device numbers. Some very old
+	  Linux distributions only support static device numbering.
+	  Selecting this option will enable support for very old
+	  userspace but on some non PC architectures may prevent you building
+	  a single kernel for multiple machines.
+
 config BFIN_JTAG_COMM
 	tristate "Blackfin JTAG Communication"
 	depends on BLACKFIN
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index ece2049..b78afc1 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2315,8 +2315,10 @@ int uart_register_driver(struct uart_driver *drv)
 
 	normal->driver_name	= drv->driver_name;
 	normal->name		= drv->dev_name;
+#ifdef CONFIG_TTY_SERIAL_LEGACY
 	normal->major		= drv->major;
 	normal->minor_start	= drv->minor;
+#endif	
 	normal->type		= TTY_DRIVER_TYPE_SERIAL;
 	normal->subtype		= SERIAL_TYPE_NORMAL;
 	normal->init_termios	= tty_std_termios;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ