aboutsummaryrefslogtreecommitdiffstats
diff options
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-07 13:38:34 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-07 13:38:34 -0700
commit1f24a64d58f6807b118459f70a238a985ed6fb90 (patch)
tree082a354654846a59d6f9083bd9bed483dc52d202
parent3db56ef0113ec08871fe529158604440756e207a (diff)
downloadpatches-1f24a64d58f6807b118459f70a238a985ed6fb90.tar.gz
fix up serial minor patches, add cdc-acm patch, and delete devnode_gid patch
-rw-r--r--cdc-acm.patch115
-rw-r--r--devnode_gid.patch206
-rw-r--r--series2
-rw-r--r--usb-serial-idr.patch501
-rw-r--r--usb-serial-increase-the-number-of-devices-we-support.patch60
-rw-r--r--usb-serial-ports-add-minor-and-port-number.patch25
6 files changed, 604 insertions, 305 deletions
diff --git a/cdc-acm.patch b/cdc-acm.patch
new file mode 100644
index 00000000000000..80573ccb2ea33e
--- /dev/null
+++ b/cdc-acm.patch
@@ -0,0 +1,115 @@
+From foo@baz Fri Jun 7 11:21:41 PDT 2013
+Date: Fri, 07 Jun 2013 11:21:41 -0700
+To: Greg KH <gregkh@linuxfoundation.org>
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Subject: [PATCH] USB: cdc-acm: remove unneeded spinlock call on write path
+
+When writing data we were:
+ lock
+ do some work
+ unlock
+ call function
+ lock
+ do some work
+ unlock
+ return
+ return
+
+It turns out, that "function" was only ever called in the one place, so
+instead of locking/unlocking for no good reason, just inline the
+function and only grab the lock once.
+
+This has sped up the pathological case of sending 1 byte packets to a
+loop-back cdc-acm device from 49600 bytes per second to 50100 bytes a
+second on my workstation. A tiny increase yes, but noticable, and now
+the spinlock isn't the hottest thing on the perf graph anymore. Yes, we
+are still waiting for the hardware for the most part, but getting rid of
+a spinlock_irq_save() call for every packet is still a good thing.
+
+And we end up deleting lines of code, always a win overall.
+
+This was found by using a Teensy 3.0 device and the test program and
+firmware located at:
+ http://www.pjrc.com/teensy/benchmark_usb_serial_receive.html
+
+Reported-by: Paul Stoffregen <paul@pjrc.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/class/cdc-acm.c | 52 ++++++++++++++++----------------------------
+ 1 file changed, 19 insertions(+), 33 deletions(-)
+
+--- a/drivers/usb/class/cdc-acm.c
++++ b/drivers/usb/class/cdc-acm.c
+@@ -216,38 +216,6 @@ static int acm_start_wb(struct acm *acm,
+ return rc;
+ }
+
+-static int acm_write_start(struct acm *acm, int wbn)
+-{
+- unsigned long flags;
+- struct acm_wb *wb = &acm->wb[wbn];
+- int rc;
+-
+- spin_lock_irqsave(&acm->write_lock, flags);
+- if (!acm->dev) {
+- wb->use = 0;
+- spin_unlock_irqrestore(&acm->write_lock, flags);
+- return -ENODEV;
+- }
+-
+- dev_vdbg(&acm->data->dev, "%s - susp_count %d\n", __func__,
+- acm->susp_count);
+- usb_autopm_get_interface_async(acm->control);
+- if (acm->susp_count) {
+- if (!acm->delayed_wb)
+- acm->delayed_wb = wb;
+- else
+- usb_autopm_put_interface_async(acm->control);
+- spin_unlock_irqrestore(&acm->write_lock, flags);
+- return 0; /* A white lie */
+- }
+- usb_mark_last_busy(acm->dev);
+-
+- rc = acm_start_wb(acm, wb);
+- spin_unlock_irqrestore(&acm->write_lock, flags);
+-
+- return rc;
+-
+-}
+ /*
+ * attributes exported through sysfs
+ */
+@@ -653,13 +621,31 @@ static int acm_tty_write(struct tty_stru
+ }
+ wb = &acm->wb[wbn];
+
++ if (!acm->dev) {
++ wb->use = 0;
++ spin_unlock_irqrestore(&acm->write_lock, flags);
++ return -ENODEV;
++ }
++
+ count = (count > acm->writesize) ? acm->writesize : count;
+ dev_vdbg(&acm->data->dev, "%s - write %d\n", __func__, count);
+ memcpy(wb->buf, buf, count);
+ wb->len = count;
++
++ usb_autopm_get_interface_async(acm->control);
++ if (acm->susp_count) {
++ if (!acm->delayed_wb)
++ acm->delayed_wb = wb;
++ else
++ usb_autopm_put_interface_async(acm->control);
++ spin_unlock_irqrestore(&acm->write_lock, flags);
++ return count; /* A white lie */
++ }
++ usb_mark_last_busy(acm->dev);
++
++ stat = acm_start_wb(acm, wb);
+ spin_unlock_irqrestore(&acm->write_lock, flags);
+
+- stat = acm_write_start(acm, wbn);
+ if (stat < 0)
+ return stat;
+ return count;
diff --git a/devnode_gid.patch b/devnode_gid.patch
deleted file mode 100644
index f6ca7f9d7f2e0b..00000000000000
--- a/devnode_gid.patch
+++ /dev/null
@@ -1,206 +0,0 @@
-From 8c41f3b1fb98a30664c73d61745b346d4013ced5 Mon Sep 17 00:00:00 2001
-From: Kay Sievers <kay@vrfy.org>
-Date: Sat, 22 Dec 2012 18:36:55 +0100
-Subject: [PATCH] driver core: add uid and gid to devtmpfs
-
-
----
- block/genhd.c | 3 ++-
- drivers/base/core.c | 17 +++++++++++++----
- drivers/base/devtmpfs.c | 27 +++++++++++++++++----------
- drivers/usb/core/usb.c | 3 ++-
- include/linux/device.h | 7 +++++--
- 5 files changed, 39 insertions(+), 18 deletions(-)
-
---- a/block/genhd.c
-+++ b/block/genhd.c
-@@ -1107,7 +1107,8 @@ struct class block_class = {
- .name = "block",
- };
-
--static char *block_devnode(struct device *dev, umode_t *mode)
-+static char *block_devnode(struct device *dev, umode_t *mode,
-+ uid_t *uid, gid_t *gid)
- {
- struct gendisk *disk = dev_to_disk(dev);
-
---- a/drivers/base/core.c
-+++ b/drivers/base/core.c
-@@ -283,15 +283,21 @@ static int dev_uevent(struct kset *kset,
- const char *tmp;
- const char *name;
- umode_t mode = 0;
-+ uid_t uid = 0;
-+ gid_t gid = 0;
-
- add_uevent_var(env, "MAJOR=%u", MAJOR(dev->devt));
- add_uevent_var(env, "MINOR=%u", MINOR(dev->devt));
-- name = device_get_devnode(dev, &mode, &tmp);
-+ name = device_get_devnode(dev, &mode, &uid, &gid, &tmp);
- if (name) {
- add_uevent_var(env, "DEVNAME=%s", name);
-- kfree(tmp);
- if (mode)
- add_uevent_var(env, "DEVMODE=%#o", mode & 0777);
-+ if (uid)
-+ add_uevent_var(env, "DEVUID=%u", uid);
-+ if (gid)
-+ add_uevent_var(env, "DEVGID=%u", gid);
-+ kfree(tmp);
- }
- }
-
-@@ -1274,6 +1280,8 @@ static struct device *next_device(struct
- * device_get_devnode - path of device node file
- * @dev: device
- * @mode: returned file access mode
-+ * @uid: returned file owner
-+ * @gid: returned file group
- * @tmp: possibly allocated string
- *
- * Return the relative path of a possible device node.
-@@ -1282,7 +1290,8 @@ static struct device *next_device(struct
- * freed by the caller.
- */
- const char *device_get_devnode(struct device *dev,
-- umode_t *mode, const char **tmp)
-+ umode_t *mode, uid_t *uid, gid_t *gid,
-+ const char **tmp)
- {
- char *s;
-
-@@ -1290,7 +1299,7 @@ const char *device_get_devnode(struct de
-
- /* the device type may provide a specific name */
- if (dev->type && dev->type->devnode)
-- *tmp = dev->type->devnode(dev, mode);
-+ *tmp = dev->type->devnode(dev, mode, uid, gid);
- if (*tmp)
- return *tmp;
-
---- a/drivers/base/devtmpfs.c
-+++ b/drivers/base/devtmpfs.c
-@@ -41,6 +41,8 @@ static struct req {
- int err;
- const char *name;
- umode_t mode; /* 0 => delete */
-+ uid_t uid;
-+ gid_t gid;
- struct device *dev;
- } *requests;
-
-@@ -85,7 +87,9 @@ int devtmpfs_create_node(struct device *
- return 0;
-
- req.mode = 0;
-- req.name = device_get_devnode(dev, &req.mode, &tmp);
-+ req.uid = 0;
-+ req.gid = 0;
-+ req.name = device_get_devnode(dev, &req.mode, &req.uid, &req.gid, &tmp);
- if (!req.name)
- return -ENOMEM;
-
-@@ -121,7 +125,7 @@ int devtmpfs_delete_node(struct device *
- if (!thread)
- return 0;
-
-- req.name = device_get_devnode(dev, NULL, &tmp);
-+ req.name = device_get_devnode(dev, NULL, NULL, NULL, &tmp);
- if (!req.name)
- return -ENOMEM;
-
-@@ -187,7 +191,8 @@ static int create_path(const char *nodep
- return err;
- }
-
--static int handle_create(const char *nodename, umode_t mode, struct device *dev)
-+static int handle_create(const char *nodename, umode_t mode, uid_t uid,
-+ gid_t gid, struct device *dev)
- {
- struct dentry *dentry;
- struct path path;
-@@ -201,14 +206,14 @@ static int handle_create(const char *nod
- if (IS_ERR(dentry))
- return PTR_ERR(dentry);
-
-- err = vfs_mknod(path.dentry->d_inode,
-- dentry, mode, dev->devt);
-+ err = vfs_mknod(path.dentry->d_inode, dentry, mode, dev->devt);
- if (!err) {
- struct iattr newattrs;
-
-- /* fixup possibly umasked mode */
- newattrs.ia_mode = mode;
-- newattrs.ia_valid = ATTR_MODE;
-+ newattrs.ia_uid = uid;
-+ newattrs.ia_gid = gid;
-+ newattrs.ia_valid = ATTR_MODE|ATTR_UID|ATTR_GID;
- mutex_lock(&dentry->d_inode->i_mutex);
- notify_change(dentry, &newattrs);
- mutex_unlock(&dentry->d_inode->i_mutex);
-@@ -357,10 +362,11 @@ int devtmpfs_mount(const char *mntdir)
-
- static DECLARE_COMPLETION(setup_done);
-
--static int handle(const char *name, umode_t mode, struct device *dev)
-+static int handle(const char *name, umode_t mode, uid_t uid, gid_t gid,
-+ struct device *dev)
- {
- if (mode)
-- return handle_create(name, mode, dev);
-+ return handle_create(name, mode, uid, gid, dev);
- else
- return handle_remove(name, dev);
- }
-@@ -386,7 +392,8 @@ static int devtmpfsd(void *p)
- spin_unlock(&req_lock);
- while (req) {
- struct req *next = req->next;
-- req->err = handle(req->name, req->mode, req->dev);
-+ req->err = handle(req->name, req->mode,
-+ req->uid, req->gid, req->dev);
- complete(&req->done);
- req = next;
- }
---- a/drivers/usb/core/usb.c
-+++ b/drivers/usb/core/usb.c
-@@ -317,7 +317,8 @@ static const struct dev_pm_ops usb_devic
- #endif /* CONFIG_PM */
-
-
--static char *usb_devnode(struct device *dev, umode_t *mode)
-+static char *usb_devnode(struct device *dev,
-+ umode_t *mode, uid_t *uid, gid_t *gid)
- {
- struct usb_device *usb_dev;
-
---- a/include/linux/device.h
-+++ b/include/linux/device.h
-@@ -24,6 +24,7 @@
- #include <linux/pm.h>
- #include <linux/atomic.h>
- #include <linux/ratelimit.h>
-+#include <linux/uidgid.h>
- #include <asm/device.h>
-
- struct device;
-@@ -470,7 +471,8 @@ struct device_type {
- const char *name;
- const struct attribute_group **groups;
- int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
-- char *(*devnode)(struct device *dev, umode_t *mode);
-+ char *(*devnode)(struct device *dev, umode_t *mode,
-+ uid_t *uid, gid_t *gid);
- void (*release)(struct device *dev);
-
- const struct dev_pm_ops *pm;
-@@ -841,7 +843,8 @@ extern int device_rename(struct device *
- extern int device_move(struct device *dev, struct device *new_parent,
- enum dpm_order dpm_order);
- extern const char *device_get_devnode(struct device *dev,
-- umode_t *mode, const char **tmp);
-+ umode_t *mode, uid_t *uid, gid_t *gid,
-+ const char **tmp);
- extern void *dev_get_drvdata(const struct device *dev);
- extern int dev_set_drvdata(struct device *dev, void *data);
-
diff --git a/series b/series
index 433ac1f1cca7c8..beb1b93d5cd8d3 100644
--- a/series
+++ b/series
@@ -1,9 +1,9 @@
# My specific stuff, at the top to make it easier to work stuff below.
+cdc-acm.patch
usb-serial-ports-add-minor-and-port-number.patch
usb-serial-idr.patch
usb-serial-increase-the-number-of-devices-we-support.patch
0001-Simulate-fake-Fn-key-on-PS-2-keyboards-w-o-one-eg.-C.patch
-devnode_gid.patch
0001-kdbus-interprocess-message-router.patch
dbus.patch
dev_removal.patch
diff --git a/usb-serial-idr.patch b/usb-serial-idr.patch
index 1b5f43e5d737a9..44a3577165161e 100644
--- a/usb-serial-idr.patch
+++ b/usb-serial-idr.patch
@@ -2,13 +2,20 @@ From foo@baz Tue Jun 4 12:06:11 PDT 2013
Date: Tue, 04 Jun 2013 12:06:11 -0700
To: Greg KH <gregkh@linuxfoundation.org>
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Subject: [PATCH 2/3] USB: serial: make minor allocation dynamic
+Subject: [PATCH v3 2/3] USB: serial: make minor allocation dynamic
This moves the allocation of minor device numbers from a static array to
be dynamic, using the idr interface. This means that you could
potentially get "gaps" in a minor number range for a single USB serial
device with multiple ports, but all should still work properly.
+We remove the 'minor' field from the usb_serial structure, as it no
+longer makes any sense for it (use the field in the usb_serial_port
+structure if you really want to know this number), and take the fact
+that we were overloading a number in this field to determine if we had
+initialized the minor numbers or not, and just use a flag variable
+instead.
+
Note, we still have the limitation of 255 USB to serial devices in the
system, as that is all we are registering with the TTY layer at this
point in time.
@@ -16,10 +23,269 @@ point in time.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- drivers/usb/serial/usb-serial.c | 97 ++++++++++++++++++++--------------------
- include/linux/usb/serial.h | 4 -
- 2 files changed, 51 insertions(+), 50 deletions(-)
+Changes v2 - v3:
+ - fixed up comments about usb_serial_get_by_minor()
+ - fixed error case in usb_serial_get_by_minor()
+ - folded get_free_port() into get_free_serial()
+ - renamed get_free_serial() to allocate_minors()
+ - fixed console.c build breakage
+ - properly pass in minor port number to usb_serial_console_init()
+
+
+ drivers/staging/serqt_usb2/serqt_usb2.c | 15 +---
+ drivers/usb/serial/ark3116.c | 2
+ drivers/usb/serial/console.c | 6 -
+ drivers/usb/serial/f81232.c | 2
+ drivers/usb/serial/io_edgeport.c | 2
+ drivers/usb/serial/io_ti.c | 2
+ drivers/usb/serial/mos7720.c | 2
+ drivers/usb/serial/mos7840.c | 7 -
+ drivers/usb/serial/opticon.c | 2
+ drivers/usb/serial/pl2303.c | 2
+ drivers/usb/serial/quatech2.c | 2
+ drivers/usb/serial/ssu100.c | 2
+ drivers/usb/serial/ti_usb_3410_5052.c | 2
+ drivers/usb/serial/usb-serial.c | 119 ++++++++++++++------------------
+ drivers/usb/serial/usb_wwan.c | 2
+ drivers/usb/serial/whiteheat.c | 2
+ include/linux/usb/serial.h | 6 -
+ 17 files changed, 80 insertions(+), 97 deletions(-)
+--- a/drivers/staging/serqt_usb2/serqt_usb2.c
++++ b/drivers/staging/serqt_usb2/serqt_usb2.c
+@@ -906,7 +906,7 @@ static int qt_open(struct tty_struct *tt
+ qt_submit_urb_from_open(serial, port);
+ }
+
+- dev_dbg(&port->dev, "serial number is %d\n", port->serial->minor);
++ dev_dbg(&port->dev, "minor number is %d\n", port->minor);
+ dev_dbg(&port->dev,
+ "Bulkin endpoint is %d\n", port->bulk_in_endpointAddress);
+ dev_dbg(&port->dev,
+@@ -1002,7 +1002,7 @@ static void qt_close(struct usb_serial_p
+ status = 0;
+
+ tty = tty_port_tty_get(&port->port);
+- index = tty->index - serial->minor;
++ index = port->port_number;
+
+ qt_port = qt_get_port_private(port);
+ port0 = qt_get_port_private(serial->port[0]);
+@@ -1129,12 +1129,11 @@ static int qt_ioctl(struct tty_struct *t
+ {
+ struct usb_serial_port *port = tty->driver_data;
+ struct quatech_port *qt_port = qt_get_port_private(port);
+- struct usb_serial *serial = get_usb_serial(port, __func__);
+ unsigned int index;
+
+ dev_dbg(&port->dev, "%s cmd 0x%04x\n", __func__, cmd);
+
+- index = tty->index - serial->minor;
++ index = port->port_number;
+
+ if (cmd == TIOCMIWAIT) {
+ while (qt_port != NULL) {
+@@ -1180,7 +1179,7 @@ static void qt_set_termios(struct tty_st
+ int baud, divisor, remainder;
+ int status;
+
+- index = tty->index - port->serial->minor;
++ index = port->port_number;
+
+ switch (cflag & CSIZE) {
+ case CS5:
+@@ -1296,7 +1295,7 @@ static void qt_break(struct tty_struct *
+ u16 index, onoff;
+ unsigned int result;
+
+- index = tty->index - serial->minor;
++ index = port->port_number;
+
+ qt_port = qt_get_port_private(port);
+
+@@ -1325,7 +1324,7 @@ static inline int qt_real_tiocmget(struc
+ int status;
+ unsigned int index;
+
+- index = tty->index - serial->minor;
++ index = port->port_number;
+ status =
+ BoxGetRegister(port->serial, index, MODEM_CONTROL_REGISTER, &mcr);
+ if (status >= 0) {
+@@ -1364,7 +1363,7 @@ static inline int qt_real_tiocmset(struc
+ int status;
+ unsigned int index;
+
+- index = tty->index - serial->minor;
++ index = port->port_number;
+ status =
+ BoxGetRegister(port->serial, index, MODEM_CONTROL_REGISTER, &mcr);
+ if (status < 0)
+--- a/drivers/usb/serial/ark3116.c
++++ b/drivers/usb/serial/ark3116.c
+@@ -413,7 +413,7 @@ static int ark3116_ioctl(struct tty_stru
+ /* XXX: Some of these values are probably wrong. */
+ memset(&serstruct, 0, sizeof(serstruct));
+ serstruct.type = PORT_16654;
+- serstruct.line = port->serial->minor;
++ serstruct.line = port->minor;
+ serstruct.port = port->port_number;
+ serstruct.custom_divisor = 0;
+ serstruct.baud_base = 460800;
+--- a/drivers/usb/serial/console.c
++++ b/drivers/usb/serial/console.c
+@@ -108,18 +108,18 @@ static int usb_console_setup(struct cons
+ * no need to check the index here: if the index is wrong, console
+ * code won't call us
+ */
+- serial = usb_serial_get_by_index(co->index);
+- if (serial == NULL) {
++ port = usb_serial_port_get_by_minor(co->index);
++ if (port == NULL) {
+ /* no device is connected yet, sorry :( */
+ pr_err("No USB device connected to ttyUSB%i\n", co->index);
+ return -ENODEV;
+ }
++ serial = port->serial;
+
+ retval = usb_autopm_get_interface(serial->interface);
+ if (retval)
+ goto error_get_interface;
+
+- port = serial->port[co->index - serial->minor];
+ tty_port_tty_set(&port->port, NULL);
+
+ info->port = port;
+--- a/drivers/usb/serial/f81232.c
++++ b/drivers/usb/serial/f81232.c
+@@ -294,7 +294,7 @@ static int f81232_ioctl(struct tty_struc
+ case TIOCGSERIAL:
+ memset(&ser, 0, sizeof ser);
+ ser.type = PORT_16654;
+- ser.line = port->serial->minor;
++ ser.line = port->minor;
+ ser.port = port->port_number;
+ ser.baud_base = 460800;
+
+--- a/drivers/usb/serial/io_edgeport.c
++++ b/drivers/usb/serial/io_edgeport.c
+@@ -1569,7 +1569,7 @@ static int get_serial_info(struct edgepo
+ memset(&tmp, 0, sizeof(tmp));
+
+ tmp.type = PORT_16550A;
+- tmp.line = edge_port->port->serial->minor;
++ tmp.line = edge_port->port->minor;
+ tmp.port = edge_port->port->port_number;
+ tmp.irq = 0;
+ tmp.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ;
+--- a/drivers/usb/serial/io_ti.c
++++ b/drivers/usb/serial/io_ti.c
+@@ -2363,7 +2363,7 @@ static int get_serial_info(struct edgepo
+ memset(&tmp, 0, sizeof(tmp));
+
+ tmp.type = PORT_16550A;
+- tmp.line = edge_port->port->serial->minor;
++ tmp.line = edge_port->port->minor;
+ tmp.port = edge_port->port->port_number;
+ tmp.irq = 0;
+ tmp.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ;
+--- a/drivers/usb/serial/mos7720.c
++++ b/drivers/usb/serial/mos7720.c
+@@ -1854,7 +1854,7 @@ static int get_serial_info(struct moschi
+ memset(&tmp, 0, sizeof(tmp));
+
+ tmp.type = PORT_16550A;
+- tmp.line = mos7720_port->port->serial->minor;
++ tmp.line = mos7720_port->port->minor;
+ tmp.port = mos7720_port->port->port_number;
+ tmp.irq = 0;
+ tmp.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ;
+--- a/drivers/usb/serial/mos7840.c
++++ b/drivers/usb/serial/mos7840.c
+@@ -1057,7 +1057,7 @@ static int mos7840_open(struct tty_struc
+ * structures were not set up at that time.) */
+
+ dev_dbg(&port->dev, "port number is %d\n", port->port_number);
+- dev_dbg(&port->dev, "minor number is %d\n", port->serial->minor);
++ dev_dbg(&port->dev, "minor number is %d\n", port->minor);
+ dev_dbg(&port->dev, "Bulkin endpoint is %d\n", port->bulk_in_endpointAddress);
+ dev_dbg(&port->dev, "BulkOut endpoint is %d\n", port->bulk_out_endpointAddress);
+ dev_dbg(&port->dev, "Interrupt endpoint is %d\n", port->interrupt_in_endpointAddress);
+@@ -2068,7 +2068,7 @@ static int mos7840_get_serial_info(struc
+ memset(&tmp, 0, sizeof(tmp));
+
+ tmp.type = PORT_16550A;
+- tmp.line = mos7840_port->port->serial->minor;
++ tmp.line = mos7840_port->port->minor;
+ tmp.port = mos7840_port->port->port_number;
+ tmp.irq = 0;
+ tmp.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ;
+@@ -2246,9 +2246,8 @@ static int mos7840_port_probe(struct usb
+ * usb-serial.c:get_free_serial() and cannot therefore be used
+ * to index device instances */
+ mos7840_port->port_num = pnum + 1;
+- dev_dbg(&port->dev, "port->serial->minor = %d\n", port->serial->minor);
++ dev_dbg(&port->dev, "port->minor = %d\n", port->minor);
+ dev_dbg(&port->dev, "mos7840_port->port_num = %d\n", mos7840_port->port_num);
+- dev_dbg(&port->dev, "serial->minor = %d\n", serial->minor);
+
+ if (mos7840_port->port_num == 1) {
+ mos7840_port->SpRegOffset = 0x0;
+--- a/drivers/usb/serial/opticon.c
++++ b/drivers/usb/serial/opticon.c
+@@ -348,7 +348,7 @@ static int get_serial_info(struct usb_se
+
+ /* fake emulate a 16550 uart to make userspace code happy */
+ tmp.type = PORT_16550A;
+- tmp.line = port->serial->minor;
++ tmp.line = port->minor;
+ tmp.port = 0;
+ tmp.irq = 0;
+ tmp.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ;
+--- a/drivers/usb/serial/pl2303.c
++++ b/drivers/usb/serial/pl2303.c
+@@ -641,7 +641,7 @@ static int pl2303_ioctl(struct tty_struc
+ case TIOCGSERIAL:
+ memset(&ser, 0, sizeof ser);
+ ser.type = PORT_16654;
+- ser.line = port->serial->minor;
++ ser.line = port->minor;
+ ser.port = port->port_number;
+ ser.baud_base = 460800;
+
+--- a/drivers/usb/serial/quatech2.c
++++ b/drivers/usb/serial/quatech2.c
+@@ -465,7 +465,7 @@ static int get_serial_info(struct usb_se
+ return -EFAULT;
+
+ memset(&tmp, 0, sizeof(tmp));
+- tmp.line = port->serial->minor;
++ tmp.line = port->minor;
+ tmp.port = 0;
+ tmp.irq = 0;
+ tmp.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ;
+--- a/drivers/usb/serial/ssu100.c
++++ b/drivers/usb/serial/ssu100.c
+@@ -323,7 +323,7 @@ static int get_serial_info(struct usb_se
+ return -EFAULT;
+
+ memset(&tmp, 0, sizeof(tmp));
+- tmp.line = port->serial->minor;
++ tmp.line = port->minor;
+ tmp.port = 0;
+ tmp.irq = 0;
+ tmp.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ;
+--- a/drivers/usb/serial/ti_usb_3410_5052.c
++++ b/drivers/usb/serial/ti_usb_3410_5052.c
+@@ -1308,7 +1308,7 @@ static int ti_get_serial_info(struct ti_
+ memset(&ret_serial, 0, sizeof(ret_serial));
+
+ ret_serial.type = PORT_16550A;
+- ret_serial.line = port->serial->minor;
++ ret_serial.line = port->minor;
+ ret_serial.port = port->port_number;
+ ret_serial.flags = tport->tp_flags;
+ ret_serial.xmit_fifo_size = TI_WRITE_BUF_SIZE;
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -37,6 +37,7 @@
@@ -30,7 +296,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
#include "pl2303.h"
#define DRIVER_AUTHOR "Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
-@@ -49,7 +50,7 @@
+@@ -49,72 +50,64 @@
drivers depend on it.
*/
@@ -39,9 +305,16 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
static DEFINE_MUTEX(table_lock);
static LIST_HEAD(usb_serial_driver_list);
-@@ -60,61 +61,65 @@ static LIST_HEAD(usb_serial_driver_list)
+ /*
+- * Look up the serial structure. If it is found and it hasn't been
+- * disconnected, return with its disc_mutex held and its refcount
+- * incremented. Otherwise return NULL.
++ * Look up the serial port structure. If it is found and it hasn't been
++ * disconnected, return with the parent usb_serial structure's disc_mutex held
++ * and its refcount incremented. Otherwise return NULL.
*/
- struct usb_serial *usb_serial_get_by_index(unsigned index)
+-struct usb_serial *usb_serial_get_by_index(unsigned index)
++struct usb_serial_port *usb_serial_port_get_by_minor(unsigned minor)
{
- struct usb_serial *serial;
+ struct usb_serial *serial = NULL;
@@ -49,7 +322,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mutex_lock(&table_lock);
- serial = serial_table[index];
-+ port = idr_find(&serial_minors, index);
++ port = idr_find(&serial_minors, minor);
+ if (!port)
+ goto exit;
@@ -65,39 +338,33 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+ mutex_lock(&serial->disc_mutex);
+ if (serial->disconnected) {
+ mutex_unlock(&serial->disc_mutex);
-+ serial = NULL;
++ port = NULL;
+ } else {
+ kref_get(&serial->kref);
}
+exit:
mutex_unlock(&table_lock);
- return serial;
+- return serial;
++ return port;
}
-static struct usb_serial *get_free_serial(struct usb_serial *serial,
- int num_ports, unsigned int *minor)
-+static int get_free_port(struct usb_serial_port *port)
++static int allocate_minors(struct usb_serial *serial, int num_ports)
{
-- unsigned int i, j;
++ struct usb_serial_port *port;
+ unsigned int i, j;
- int good_spot;
--
-- dev_dbg(&serial->interface->dev, "%s %d\n", __func__, num_ports);
-+ int i;
++ int minor;
+
+ dev_dbg(&serial->interface->dev, "%s %d\n", __func__, num_ports);
- *minor = 0;
mutex_lock(&table_lock);
- for (i = 0; i < SERIAL_TTY_MINORS; ++i) {
- if (serial_table[i])
- continue;
-+ i = idr_alloc(&serial_minors, port, 0, 0, GFP_KERNEL);
-+ if (i < 0)
-+ goto exit;
-+ port->minor = i;
-+exit:
-+ mutex_unlock(&table_lock);
-+ return i;
-+}
-
+-
- good_spot = 1;
- for (j = 1; j <= num_ports-1; ++j)
- if ((i+j >= SERIAL_TTY_MINORS) || (serial_table[i+j])) {
@@ -107,13 +374,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
- }
- if (good_spot == 0)
- continue;
-+static int get_free_serial(struct usb_serial *serial, int num_ports,
-+ unsigned int *minor)
-+{
-+ unsigned int i;
-+ unsigned int j;
-+ int x;
-
+-
- *minor = i;
- j = 0;
- dev_dbg(&serial->interface->dev, "%s - minor base = %d\n", __func__, *minor);
@@ -124,47 +385,141 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
- }
- mutex_unlock(&table_lock);
- return serial;
-+ dev_dbg(&serial->interface->dev, "%s %d\n", __func__, num_ports);
-+
-+ *minor = 0xffffffff;
+ for (i = 0; i < num_ports; ++i) {
-+ x = get_free_port(serial->port[i]);
-+ if (x < 0)
++ port = serial->port[i];
++ minor = idr_alloc(&serial_minors, port, 0, 0, GFP_KERNEL);
++ if (minor < 0)
+ goto error;
-+ if (*minor == 0xffffffff)
-+ *minor = x;
-+ serial->port[i]->port_number = i;
++ port->minor = minor;
++ port->port_number = i;
}
-- mutex_unlock(&table_lock);
++ serial->minors_reserved = 1;
+ mutex_unlock(&table_lock);
- return NULL;
+ return 0;
+error:
+ /* unwind the already allocated minors */
+ for (j = 0; j < i; ++j)
+ idr_remove(&serial_minors, serial->port[j]->minor);
-+ return x;
++ mutex_unlock(&table_lock);
++ return minor;
}
static void return_serial(struct usb_serial *serial)
-@@ -123,7 +128,7 @@ static void return_serial(struct usb_ser
+@@ -123,8 +116,9 @@ static void return_serial(struct usb_ser
mutex_lock(&table_lock);
for (i = 0; i < serial->num_ports; ++i)
- serial_table[serial->minor + i] = NULL;
+ idr_remove(&serial_minors, serial->port[i]->minor);
mutex_unlock(&table_lock);
++ serial->minors_reserved = 0;
}
-@@ -1040,7 +1045,7 @@ static int usb_serial_probe(struct usb_i
+ static void destroy_serial(struct kref *kref)
+@@ -136,7 +130,7 @@ static void destroy_serial(struct kref *
+ serial = to_usb_serial(kref);
+
+ /* return the minor range that this device had */
+- if (serial->minor != SERIAL_TTY_NO_MINOR)
++ if (serial->minors_reserved)
+ return_serial(serial);
+
+ if (serial->attached && serial->type->release)
+@@ -186,13 +180,11 @@ static int serial_install(struct tty_dri
+ struct usb_serial_port *port;
+ int retval = -ENODEV;
+
+- serial = usb_serial_get_by_index(idx);
+- if (!serial)
++ port = usb_serial_port_get_by_minor(idx);
++ if (!port)
+ return retval;
+
+- port = serial->port[idx - serial->minor];
+- if (!port)
+- goto error_no_port;
++ serial = port->serial;
+ if (!try_module_get(serial->type->driver.owner))
+ goto error_module_get;
+
+@@ -219,7 +211,6 @@ static int serial_install(struct tty_dri
+ error_get_interface:
+ module_put(serial->type->driver.owner);
+ error_module_get:
+- error_no_port:
+ usb_serial_put(serial);
+ mutex_unlock(&serial->disc_mutex);
+ return retval;
+@@ -453,14 +444,16 @@ static int serial_break(struct tty_struc
+ static int serial_proc_show(struct seq_file *m, void *v)
+ {
+ struct usb_serial *serial;
++ struct usb_serial_port *port;
+ int i;
+ char tmp[40];
+
+ seq_puts(m, "usbserinfo:1.0 driver:2.0\n");
+ for (i = 0; i < SERIAL_TTY_MINORS; ++i) {
+- serial = usb_serial_get_by_index(i);
+- if (serial == NULL)
++ port = usb_serial_port_get_by_minor(i);
++ if (port == NULL)
+ continue;
++ serial = port->serial;
+
+ seq_printf(m, "%d:", i);
+ if (serial->type->driver.owner)
+@@ -472,7 +465,7 @@ static int serial_proc_show(struct seq_f
+ le16_to_cpu(serial->dev->descriptor.idVendor),
+ le16_to_cpu(serial->dev->descriptor.idProduct));
+ seq_printf(m, " num_ports:%d", serial->num_ports);
+- seq_printf(m, " port:%d", i - serial->minor + 1);
++ seq_printf(m, " port:%d", port->port_number);
+ usb_make_path(serial->dev, tmp, sizeof(tmp));
+ seq_printf(m, " path:%s", tmp);
+
+@@ -614,7 +607,7 @@ static struct usb_serial *create_serial(
+ serial->interface = usb_get_intf(interface);
+ kref_init(&serial->kref);
+ mutex_init(&serial->disc_mutex);
+- serial->minor = SERIAL_TTY_NO_MINOR;
++ serial->minors_reserved = 0;
+
+ return serial;
+ }
+@@ -723,7 +716,6 @@ static int usb_serial_probe(struct usb_i
+ struct usb_endpoint_descriptor *bulk_out_endpoint[MAX_NUM_PORTS];
+ struct usb_serial_driver *type = NULL;
+ int retval;
+- unsigned int minor;
+ int buffer_size;
+ int i;
+ int j;
+@@ -1040,11 +1032,10 @@ static int usb_serial_probe(struct usb_i
*/
serial->disconnected = 1;
- if (get_free_serial(serial, num_ports, &minor) == NULL) {
-+ if (get_free_serial(serial, num_ports, &minor)) {
- dev_err(ddev, "No more free serial devices\n");
+- dev_err(ddev, "No more free serial devices\n");
++ if (allocate_minors(serial, num_ports)) {
++ dev_err(ddev, "No more free serial minor numbers\n");
goto probe_error;
}
-@@ -1224,7 +1229,6 @@ static struct usb_driver usb_serial_driv
+- serial->minor = minor;
+
+ /* register all of the individual ports with the driver core */
+ for (i = 0; i < num_ports; ++i) {
+@@ -1060,7 +1051,7 @@ static int usb_serial_probe(struct usb_i
+
+ serial->disconnected = 0;
+
+- usb_serial_console_init(minor);
++ usb_serial_console_init(serial->port[0]->minor);
+ exit:
+ module_put(type->driver.owner);
+ return 0;
+@@ -1224,7 +1215,6 @@ static struct usb_driver usb_serial_driv
static int __init usb_serial_init(void)
{
@@ -172,7 +527,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
int result;
usb_serial_tty_driver = alloc_tty_driver(SERIAL_TTY_MINORS);
-@@ -1232,9 +1236,6 @@ static int __init usb_serial_init(void)
+@@ -1232,9 +1222,6 @@ static int __init usb_serial_init(void)
return -ENOMEM;
/* Initialize our global data */
@@ -182,29 +537,61 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
result = bus_register(&usb_serial_bus_type);
if (result) {
pr_err("%s - registering bus driver failed\n", __func__);
+--- a/drivers/usb/serial/usb_wwan.c
++++ b/drivers/usb/serial/usb_wwan.c
+@@ -124,7 +124,7 @@ static int get_serial_info(struct usb_se
+ return -EFAULT;
+
+ memset(&tmp, 0, sizeof(tmp));
+- tmp.line = port->serial->minor;
++ tmp.line = port->minor;
+ tmp.port = port->port_number;
+ tmp.baud_base = tty_get_baud_rate(port->port.tty);
+ tmp.close_delay = port->port.close_delay / 10;
+--- a/drivers/usb/serial/whiteheat.c
++++ b/drivers/usb/serial/whiteheat.c
+@@ -461,7 +461,7 @@ static int whiteheat_ioctl(struct tty_st
+ case TIOCGSERIAL:
+ memset(&serstruct, 0, sizeof(serstruct));
+ serstruct.type = PORT_16654;
+- serstruct.line = port->serial->minor;
++ serstruct.line = port->minor;
+ serstruct.port = port->port_number;
+ serstruct.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ;
+ serstruct.xmit_fifo_size = kfifo_size(&port->write_fifo);
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
-@@ -21,7 +21,7 @@
+@@ -21,7 +21,6 @@
#define SERIAL_TTY_MAJOR 188 /* Nice legal number now */
#define SERIAL_TTY_MINORS 254 /* loads of devices :) */
-#define SERIAL_TTY_NO_MINOR 255 /* No minor was assigned */
-+#define SERIAL_TTY_NO_MINOR 0xffffffff /* No minor was assigned */
/* The maximum number of ports one device can grab at once */
#define MAX_NUM_PORTS 8
-@@ -161,13 +161,13 @@ struct usb_serial {
+@@ -142,7 +141,6 @@ static inline void usb_set_serial_port_d
+ * @dev: pointer to the struct usb_device for this device
+ * @type: pointer to the struct usb_serial_driver for this device
+ * @interface: pointer to the struct usb_interface for this device
+- * @minor: the starting minor number for this device
+ * @num_ports: the number of ports this device has
+ * @num_interrupt_in: number of interrupt in endpoints we have
+ * @num_interrupt_out: number of interrupt out endpoints we have
+@@ -161,7 +159,7 @@ struct usb_serial {
unsigned char disconnected:1;
unsigned char suspending:1;
unsigned char attached:1;
- unsigned char minor;
++ unsigned char minors_reserved:1;
unsigned char num_ports;
unsigned char num_port_pointers;
char num_interrupt_in;
- char num_interrupt_out;
- char num_bulk_in;
- char num_bulk_out;
-+ u32 minor;
- struct usb_serial_port *port[MAX_NUM_PORTS];
- struct kref kref;
- struct mutex disc_mutex;
+@@ -321,7 +319,7 @@ static inline void usb_serial_console_di
+ #endif
+
+ /* Functions needed by other parts of the usbserial core */
+-extern struct usb_serial *usb_serial_get_by_index(unsigned int minor);
++extern struct usb_serial_port *usb_serial_port_get_by_minor(unsigned int minor);
+ extern void usb_serial_put(struct usb_serial *serial);
+ extern int usb_serial_generic_open(struct tty_struct *tty,
+ struct usb_serial_port *port);
diff --git a/usb-serial-increase-the-number-of-devices-we-support.patch b/usb-serial-increase-the-number-of-devices-we-support.patch
index c8fbf22a128ed7..c41f28993467e1 100644
--- a/usb-serial-increase-the-number-of-devices-we-support.patch
+++ b/usb-serial-increase-the-number-of-devices-we-support.patch
@@ -2,62 +2,74 @@ From foo@baz Wed Jun 5 10:45:16 PDT 2013
Date: Wed, 05 Jun 2013 10:45:16 -0700
To: Greg KH <gregkh@linuxfoundation.org>
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Subject: [PATCH 3/3] USB: serial: increase the number of devices we support
+Subject: [PATCH v2 3/3] USB: serial: increase the number of devices we support
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 500, which should last
-us a few more years.
+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 | 8 ++++++--
- include/linux/usb/serial.h | 4 ----
+ 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,10 @@
+@@ -43,6 +43,9 @@
#define DRIVER_AUTHOR "Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
#define DRIVER_DESC "USB Serial Driver core"
-+#define SERIAL_TTY_MAJOR 188
-+#define SERIAL_TTY_MINORS 500 /* should be enough for a while */
-+#define SERIAL_TTY_NO_MINOR (SERIAL_TTY_MINORS + 1)
++#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
-@@ -105,12 +109,12 @@ static int get_free_serial(struct usb_se
+@@ -449,7 +452,7 @@ static int serial_proc_show(struct seq_f
+ char tmp[40];
- dev_dbg(&serial->interface->dev, "%s %d\n", __func__, num_ports);
+ 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;
+@@ -1217,7 +1220,7 @@ static int __init usb_serial_init(void)
+ {
+ int result;
-- *minor = 0xffffffff;
-+ *minor = SERIAL_TTY_NO_MINOR;
- for (i = 0; i < num_ports; ++i) {
- x = get_free_port(serial->port[i]);
- if (x < 0)
- goto error;
-- if (*minor == 0xffffffff)
-+ if (*minor == SERIAL_TTY_NO_MINOR)
- *minor = x;
- serial->port[i]->port_number = i;
- }
+- 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;
+
+@@ -1230,7 +1233,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,10 +19,6 @@
+@@ -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 :) */
--#define SERIAL_TTY_NO_MINOR 0xffffffff /* No minor was assigned */
-
/* The maximum number of ports one device can grab at once */
#define MAX_NUM_PORTS 8
diff --git a/usb-serial-ports-add-minor-and-port-number.patch b/usb-serial-ports-add-minor-and-port-number.patch
index 6ee79ad1eac4a3..6c01aad0e18d68 100644
--- a/usb-serial-ports-add-minor-and-port-number.patch
+++ b/usb-serial-ports-add-minor-and-port-number.patch
@@ -2,7 +2,7 @@ From foo@baz Tue Jun 4 11:51:13 PDT 2013
Date: Tue, 04 Jun 2013 11:51:13 -0700
To: Greg KH <gregkh@linuxfoundation.org>
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Subject: [PATCH 1/3] USB: serial: ports: add minor and port number
+Subject: [PATCH v2 1/3] USB: serial: ports: add minor and port number
The usb_serial_port structure had the number field, which was the minor
number for the port, which almost no one really cared about. They
@@ -27,12 +27,12 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/digi_acceleport.c | 6 ---
drivers/usb/serial/f81232.c | 5 +-
drivers/usb/serial/garmin_gps.c | 6 +--
- drivers/usb/serial/io_edgeport.c | 60 ++++++++++++--------------------
+ drivers/usb/serial/io_edgeport.c | 58 ++++++++++++--------------------
drivers/usb/serial/io_ti.c | 21 ++++-------
- drivers/usb/serial/keyspan.c | 29 ++++++---------
+ drivers/usb/serial/keyspan.c | 29 +++++++---------
drivers/usb/serial/metro-usb.c | 4 +-
- drivers/usb/serial/mos7720.c | 37 +++++++++----------
- drivers/usb/serial/mos7840.c | 52 +++++++++------------------
+ drivers/usb/serial/mos7720.c | 37 +++++++++-----------
+ drivers/usb/serial/mos7840.c | 52 +++++++++-------------------
drivers/usb/serial/opticon.c | 2 -
drivers/usb/serial/pl2303.c | 2 -
drivers/usb/serial/quatech2.c | 7 +--
@@ -40,9 +40,9 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/ti_usb_3410_5052.c | 10 ++---
drivers/usb/serial/usb-serial.c | 7 ++-
drivers/usb/serial/usb_wwan.c | 2 -
- drivers/usb/serial/whiteheat.c | 20 +++++-----
+ drivers/usb/serial/whiteheat.c | 20 +++++------
include/linux/usb/serial.h | 6 ++-
- 24 files changed, 134 insertions(+), 181 deletions(-)
+ 24 files changed, 133 insertions(+), 180 deletions(-)
--- a/drivers/staging/serqt_usb2/serqt_usb2.c
+++ b/drivers/staging/serqt_usb2/serqt_usb2.c
@@ -386,15 +386,6 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
status = calc_baud_rate_divisor(dev, baudRate, &divisor);
if (status) {
-@@ -2302,7 +2293,7 @@ static int send_cmd_write_baud_rate(stru
-
- /* Restore original value to disable access to divisor latch */
- MAKE_CMD_WRITE_REG(&currCmd, &cmdLen, number, LCR,
-- edge_port->shadowLCR);
-+ edge_port->shadowLCR);
-
- status = write_cmd_usb(edge_port, cmdBuffer, cmdLen);
- if (status) {
@@ -2388,9 +2379,8 @@ static int send_cmd_write_uart_register(
currCmd = cmdBuffer;
@@ -1129,7 +1120,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* @lock: spinlock to grab when updating portions of this structure.
- * @number: the number of the port (the minor number).
+ * @minor: the minor number of the port
-+ * @port_number: the port number of this struct usb_serial_device (starts at 0)
++ * @port_number: the struct usb_serial port number of this port (starts at 0)
* @interrupt_in_buffer: pointer to the interrupt in buffer for this port.
* @interrupt_in_urb: pointer to the interrupt in struct urb for this port.
* @interrupt_in_endpointAddress: endpoint address for the interrupt in pipe