From: Greg KH <gregkh@linuxfoundation.org>
To: "Tobias Winter" <tobias@linuxdingsda.de>,
"Bjørn Mork" <bjorn@mork.no>, "Rob Landley" <rob@landley.net>,
"Johan Hovold" <jhovold@gmail.com>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 3/3] USB: serial: increase the number of devices we support
Date: Thu, 6 Jun 2013 10:31:35 -0700 [thread overview]
Message-ID: <20130606173135.GB1866@kroah.com> (raw)
In-Reply-To: <20130606173103.GA1812@kroah.com>
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
We had the limit of 255 USB to serial devices on one system for almost
15 years, with no complaints. But now it's time to move on from these
tiny "baby" systems, and bump the number up to 512, which should last
us a few more years:
"512 is a nice number" -- Tobias Winter
Note, this is still a static value, and uses up tty core memory with
this many tty devices allocated. Converting the driver to use
TTY_DRIVER_DYNAMIC_DEV is the next thing to do in order to remove this
limitation.
Reported-by: Tobias Winter <tobias@linuxdingsda.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/usb-serial.c | 9 ++++++---
include/linux/usb/serial.h | 3 ---
2 files changed, 6 insertions(+), 6 deletions(-)
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -43,6 +43,9 @@
#define DRIVER_AUTHOR "Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
#define DRIVER_DESC "USB Serial Driver core"
+#define USB_SERIAL_TTY_MAJOR 188
+#define USB_SERIAL_TTY_MINORS 512 /* should be enough for a while */
+
/* There is no MODULE_DEVICE_TABLE for usbserial.c. Instead
the MODULE_DEVICE_TABLE declarations in each serial driver
cause the "hotplug" program to pull in whatever module is necessary
@@ -460,7 +463,7 @@ static int serial_proc_show(struct seq_f
char tmp[40];
seq_puts(m, "usbserinfo:1.0 driver:2.0\n");
- for (i = 0; i < SERIAL_TTY_MINORS; ++i) {
+ for (i = 0; i < USB_SERIAL_TTY_MINORS; ++i) {
port = usb_serial_port_get_by_minor(i);
if (port == NULL)
continue;
@@ -1229,7 +1232,7 @@ static int __init usb_serial_init(void)
{
int result;
- usb_serial_tty_driver = alloc_tty_driver(SERIAL_TTY_MINORS);
+ usb_serial_tty_driver = alloc_tty_driver(USB_SERIAL_TTY_MINORS);
if (!usb_serial_tty_driver)
return -ENOMEM;
@@ -1242,7 +1245,7 @@ static int __init usb_serial_init(void)
usb_serial_tty_driver->driver_name = "usbserial";
usb_serial_tty_driver->name = "ttyUSB";
- usb_serial_tty_driver->major = SERIAL_TTY_MAJOR;
+ usb_serial_tty_driver->major = USB_SERIAL_TTY_MAJOR;
usb_serial_tty_driver->minor_start = 0;
usb_serial_tty_driver->type = TTY_DRIVER_TYPE_SERIAL;
usb_serial_tty_driver->subtype = SERIAL_TYPE_NORMAL;
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -19,9 +19,6 @@
#include <linux/sysrq.h>
#include <linux/kfifo.h>
-#define SERIAL_TTY_MAJOR 188 /* Nice legal number now */
-#define SERIAL_TTY_MINORS 254 /* loads of devices :) */
-
/* The maximum number of ports one device can grab at once */
#define MAX_NUM_PORTS 8
next prev parent reply other threads:[~2013-06-06 17:31 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-06 17:31 [PATCH v2 0/3] Increase the number of USB to serial devices we can support at once Greg KH
2013-06-06 17:31 ` [PATCH v2 2/3] USB: serial: make minor allocation dynamic Greg KH
2013-06-07 9:40 ` Johan Hovold
2013-06-07 9:50 ` Johan Hovold
2013-06-07 17:58 ` Greg KH
2013-06-07 10:00 ` Johan Hovold
2013-06-07 17:24 ` Greg KH
2013-06-07 18:04 ` [PATCH v3 " Greg KH
2013-06-08 10:03 ` Johan Hovold
2013-06-17 20:16 ` Greg KH
2013-06-18 10:23 ` Johan Hovold
2013-06-06 17:31 ` Greg KH [this message]
2013-06-06 17:32 ` [PATCH v2 1/3] USB: serial: ports: add minor and port number Greg KH
2013-06-07 6:00 ` [PATCH v2 0/3] Increase the number of USB to serial devices we can support at once Tobias Winter
2013-06-07 9:55 ` Tobias Winter
2013-06-07 17:25 ` Greg KH
2013-06-08 9:14 ` Tobias Winter
2013-06-08 14:26 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130606173135.GB1866@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=bjorn@mork.no \
--cc=jhovold@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=rob@landley.net \
--cc=tobias@linuxdingsda.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®