aboutsummaryrefslogtreecommitdiffstats
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2010-09-04 21:09:25 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2010-09-04 21:09:25 -0700
commit23499f657ac91bddbdfcbd7c7371b9708dce5382 (patch)
tree27ec4bb066e55063332c4d6b6941edaf25feebb1
parent26c7e2f47241d049ca0c963cda1c987bbdd2687e (diff)
downloadpatches-23499f657ac91bddbdfcbd7c7371b9708dce5382.tar.gz
more patches
-rw-r--r--series5
-rw-r--r--tty.current/serial-amba-pl010-fix-set_ldisc.patch41
-rw-r--r--tty/char-mxser-call-pci_disable_device-from-probe-remove.patch150
-rw-r--r--usb/usb-g_file_storage-don-t-generate-automatic-serial-string.patch172
4 files changed, 368 insertions, 0 deletions
diff --git a/series b/series
index 5d965033c96beb..7ccb24e5f962bc 100644
--- a/series
+++ b/series
@@ -18,6 +18,9 @@ tty.current/maintainers-orphan-isicom.patch
tty.current/serial-fix-port-type-conflict-between-ns16550a-u6_16550a.patch
tty.current/serial-bfin_sport_uart-restore-transmit-frame-sync-fix.patch
+# after patches sent to linus
+tty.current/serial-amba-pl010-fix-set_ldisc.patch
+
#################################
# USB patches for 2.6.36
@@ -93,6 +96,7 @@ tty/ioctl-use-asm-generic-ioctls-h-on-s390
tty/serial-core-skip-call-set_termios-console_start-when-no_console_suspend.patch
tty/serial-core-restore-termios-settings-when-resume-console-ports.patch
tty/add-ttyprintk-driver.patch
+tty/char-mxser-call-pci_disable_device-from-probe-remove.patch
###################################
@@ -123,6 +127,7 @@ usb/usb-gadget-don-t-save-bind-callback-in-struct-usb_configuration.patch
usb/init.h-add-some-more-documentation-to-__ref-tags.patch
usb/usb-gadget-amd5536udc.c-remove-double-test.patch
usb/usb-output-an-error-message-when-the-pipe-type-doesn-t-match-the-endpoint-type.patch
+usb/usb-g_file_storage-don-t-generate-automatic-serial-string.patch
# staging stuff for next is now in the staging-next tree on git.kernel.org
diff --git a/tty.current/serial-amba-pl010-fix-set_ldisc.patch b/tty.current/serial-amba-pl010-fix-set_ldisc.patch
new file mode 100644
index 00000000000000..927dfd1f78c361
--- /dev/null
+++ b/tty.current/serial-amba-pl010-fix-set_ldisc.patch
@@ -0,0 +1,41 @@
+From mika.westerberg@iki.fi Sat Sep 4 21:04:11 2010
+From: Mika Westerberg <mika.westerberg@iki.fi>
+Date: Sat, 4 Sep 2010 10:23:23 +0300
+Subject: serial: amba-pl010: fix set_ldisc
+To: linux-kernel@vger.kernel.org
+Cc: Alan Cox <alan@linux.intel.com>, Russell King <rmk+kernel@arm.linux.org.uk>, gregkh@suse.de
+Message-ID: <20100904072323.GR25559@gw.healthdatacare.com>
+
+
+Commit d87d9b7d1 ("tty: serial - fix tty referencing in set_ldisc") changed
+set_ldisc to take ldisc number as parameter. This patch fixes AMBA PL010 driver
+according the new prototype.
+
+Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
+Cc: Alan Cox <alan@linux.intel.com>
+Cc: Russell King <rmk+kernel@arm.linux.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/serial/amba-pl010.c | 9 ++-------
+ 1 file changed, 2 insertions(+), 7 deletions(-)
+
+--- a/drivers/serial/amba-pl010.c
++++ b/drivers/serial/amba-pl010.c
+@@ -472,14 +472,9 @@ pl010_set_termios(struct uart_port *port
+ spin_unlock_irqrestore(&uap->port.lock, flags);
+ }
+
+-static void pl010_set_ldisc(struct uart_port *port)
++static void pl010_set_ldisc(struct uart_port *port, int new)
+ {
+- int line = port->line;
+-
+- if (line >= port->state->port.tty->driver->num)
+- return;
+-
+- if (port->state->port.tty->ldisc->ops->num == N_PPS) {
++ if (new == N_PPS) {
+ port->flags |= UPF_HARDPPS_CD;
+ pl010_enable_ms(port);
+ } else
diff --git a/tty/char-mxser-call-pci_disable_device-from-probe-remove.patch b/tty/char-mxser-call-pci_disable_device-from-probe-remove.patch
new file mode 100644
index 00000000000000..aa14600c7f3b45
--- /dev/null
+++ b/tty/char-mxser-call-pci_disable_device-from-probe-remove.patch
@@ -0,0 +1,150 @@
+From jslaby@suse.cz Sat Sep 4 21:06:38 2010
+From: Jiri Slaby <jslaby@suse.cz>
+Date: Fri, 3 Sep 2010 10:31:37 +0200
+Subject: Char: mxser, call pci_disable_device from probe/remove
+To: gregkh@suse.de
+Cc: linux-kernel@vger.kernel.org, jirislaby@gmail.com, Kulikov Vasiliy <segooon@gmail.com>
+Message-ID: <1283502697-16068-1-git-send-email-jslaby@suse.cz>
+
+
+Vasiliy found that pci_disable_device is not called on fail paths in
+mxser_probe. Actually, it is called from nowhere in the driver.
+
+There are three changes needed:
+1) don't use pseudo-generic mxser_release_res. Let's use it only from
+ ISA paths from now on. All the pci stuff is moved to probe and
+ remove PCI-related functions.
+2) reorder fail-paths in the probe function so that it makes sense and
+ we can call them from the sequential code naturally (the further we
+ are the earlier label we go to).
+3) add pci_disable_device both to mxser_probe and mxser_remove.
+
+There is a nit of adding CONFIG_PCI ifdef to mxser_remove. it is
+because this driver supports ISA-only compilations and it would choke
+up on the newly added calls now.
+
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+Cc: Kulikov Vasiliy <segooon@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/char/mxser.c | 47 ++++++++++++++++++++++-------------------------
+ 1 file changed, 22 insertions(+), 25 deletions(-)
+
+--- a/drivers/char/mxser.c
++++ b/drivers/char/mxser.c
+@@ -2339,20 +2339,11 @@ struct tty_port_operations mxser_port_op
+ * The MOXA Smartio/Industio serial driver boot-time initialization code!
+ */
+
+-static void mxser_release_res(struct mxser_board *brd, struct pci_dev *pdev,
+- unsigned int irq)
++static void mxser_release_ISA_res(struct mxser_board *brd)
+ {
+- if (irq)
+- free_irq(brd->irq, brd);
+- if (pdev != NULL) { /* PCI */
+-#ifdef CONFIG_PCI
+- pci_release_region(pdev, 2);
+- pci_release_region(pdev, 3);
+-#endif
+- } else {
+- release_region(brd->ports[0].ioaddr, 8 * brd->info->nports);
+- release_region(brd->vector, 1);
+- }
++ free_irq(brd->irq, brd);
++ release_region(brd->ports[0].ioaddr, 8 * brd->info->nports);
++ release_region(brd->vector, 1);
+ }
+
+ static int __devinit mxser_initbrd(struct mxser_board *brd,
+@@ -2397,13 +2388,11 @@ static int __devinit mxser_initbrd(struc
+
+ retval = request_irq(brd->irq, mxser_interrupt, IRQF_SHARED, "mxser",
+ brd);
+- if (retval) {
++ if (retval)
+ printk(KERN_ERR "Board %s: Request irq failed, IRQ (%d) may "
+ "conflict with another device.\n",
+ brd->info->name, brd->irq);
+- /* We hold resources, we need to release them. */
+- mxser_release_res(brd, pdev, 0);
+- }
++
+ return retval;
+ }
+
+@@ -2555,7 +2544,7 @@ static int __devinit mxser_probe(struct
+ ioaddress = pci_resource_start(pdev, 2);
+ retval = pci_request_region(pdev, 2, "mxser(IO)");
+ if (retval)
+- goto err;
++ goto err_dis;
+
+ brd->info = &mxser_cards[ent->driver_data];
+ for (i = 0; i < brd->info->nports; i++)
+@@ -2565,7 +2554,7 @@ static int __devinit mxser_probe(struct
+ ioaddress = pci_resource_start(pdev, 3);
+ retval = pci_request_region(pdev, 3, "mxser(vector)");
+ if (retval)
+- goto err_relio;
++ goto err_zero;
+ brd->vector = ioaddress;
+
+ /* irq */
+@@ -2608,7 +2597,7 @@ static int __devinit mxser_probe(struct
+ /* mxser_initbrd will hook ISR. */
+ retval = mxser_initbrd(brd, pdev);
+ if (retval)
+- goto err_null;
++ goto err_rel3;
+
+ for (i = 0; i < brd->info->nports; i++)
+ tty_register_device(mxvar_sdriver, brd->idx + i, &pdev->dev);
+@@ -2616,10 +2605,13 @@ static int __devinit mxser_probe(struct
+ pci_set_drvdata(pdev, brd);
+
+ return 0;
+-err_relio:
+- pci_release_region(pdev, 2);
+-err_null:
++err_rel3:
++ pci_release_region(pdev, 3);
++err_zero:
+ brd->info = NULL;
++ pci_release_region(pdev, 2);
++err_dis:
++ pci_disable_device(pdev);
+ err:
+ return retval;
+ #else
+@@ -2629,14 +2621,19 @@ err:
+
+ static void __devexit mxser_remove(struct pci_dev *pdev)
+ {
++#ifdef CONFIG_PCI
+ struct mxser_board *brd = pci_get_drvdata(pdev);
+ unsigned int i;
+
+ for (i = 0; i < brd->info->nports; i++)
+ tty_unregister_device(mxvar_sdriver, brd->idx + i);
+
+- mxser_release_res(brd, pdev, 1);
++ free_irq(pdev->irq, brd);
++ pci_release_region(pdev, 2);
++ pci_release_region(pdev, 3);
++ pci_disable_device(pdev);
+ brd->info = NULL;
++#endif
+ }
+
+ static struct pci_driver mxser_driver = {
+@@ -2741,7 +2738,7 @@ static void __exit mxser_module_exit(voi
+
+ for (i = 0; i < MXSER_BOARDS; i++)
+ if (mxser_boards[i].info != NULL)
+- mxser_release_res(&mxser_boards[i], NULL, 1);
++ mxser_release_ISA_res(&mxser_boards[i]);
+ }
+
+ module_init(mxser_module_init);
diff --git a/usb/usb-g_file_storage-don-t-generate-automatic-serial-string.patch b/usb/usb-g_file_storage-don-t-generate-automatic-serial-string.patch
new file mode 100644
index 00000000000000..ab75dede050724
--- /dev/null
+++ b/usb/usb-g_file_storage-don-t-generate-automatic-serial-string.patch
@@ -0,0 +1,172 @@
+From stern@rowland.harvard.edu Sat Sep 4 21:05:49 2010
+From: Alan Stern <stern@rowland.harvard.edu>
+Date: Fri, 3 Sep 2010 11:15:41 -0400 (EDT)
+Subject: USB: g_file_storage: don't generate automatic serial string
+To: Greg KH <greg@kroah.com>
+Cc: David Brownell <david-b@pacbell.net>, Michal Nazarewicz <m.nazarewicz@samsung.com>
+Message-ID: <Pine.LNX.4.44L0.1009031113540.1548-100000@iolanthe.rowland.org>
+
+
+This patch (as1413) changes g_file_storage to avoid generating a bogus
+automatic serial-number string descriptor. If the user doesn't provide
+a valid serial number via a module parameter then a warning is logged
+and the gadget won't have any serial string descriptor at all.
+
+Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
+Acked-by: David Brownell <david-b@pacbell.net>
+CC: Michal Nazarewicz <m.nazarewicz@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/gadget/file_storage.c | 48 ++++++++++--------------------------
+ drivers/usb/gadget/storage_common.c | 3 --
+ 2 files changed, 15 insertions(+), 36 deletions(-)
+
+--- a/drivers/usb/gadget/file_storage.c
++++ b/drivers/usb/gadget/file_storage.c
+@@ -89,6 +89,7 @@
+ * Required if "removable" is not set, names of
+ * the files or block devices used for
+ * backing storage
++ * serial=HHHH... Required serial number (string of hex chars)
+ * ro=b[,b...] Default false, booleans for read-only access
+ * removable Default false, boolean for removable media
+ * luns=N Default N = number of filenames, number of
+@@ -108,12 +109,11 @@
+ * vendor=0xVVVV Default 0x0525 (NetChip), USB Vendor ID
+ * product=0xPPPP Default 0xa4a5 (FSG), USB Product ID
+ * release=0xRRRR Override the USB release number (bcdDevice)
+- * serial=HHHH... Override serial number (string of hex chars)
+ * buflen=N Default N=16384, buffer size used (will be
+ * rounded down to a multiple of
+ * PAGE_CACHE_SIZE)
+ *
+- * If CONFIG_USB_FILE_STORAGE_TEST is not set, only the "file", "ro",
++ * If CONFIG_USB_FILE_STORAGE_TEST is not set, only the "file", "serial", "ro",
+ * "removable", "luns", "nofua", "stall", and "cdrom" options are available;
+ * default values are used for everything else.
+ *
+@@ -273,13 +273,10 @@
+
+ #define DRIVER_DESC "File-backed Storage Gadget"
+ #define DRIVER_NAME "g_file_storage"
+-/* DRIVER_VERSION must be at least 6 characters long, as it is used
+- * to generate a fallback serial number. */
+-#define DRIVER_VERSION "20 November 2008"
++#define DRIVER_VERSION "1 September 2010"
+
+ static char fsg_string_manufacturer[64];
+ static const char fsg_string_product[] = DRIVER_DESC;
+-static char fsg_string_serial[13];
+ static const char fsg_string_config[] = "Self-powered";
+ static const char fsg_string_interface[] = "Mass Storage";
+
+@@ -305,6 +302,7 @@ MODULE_LICENSE("Dual BSD/GPL");
+
+ static struct {
+ char *file[FSG_MAX_LUNS];
++ char *serial;
+ int ro[FSG_MAX_LUNS];
+ int nofua[FSG_MAX_LUNS];
+ unsigned int num_filenames;
+@@ -321,7 +319,6 @@ static struct {
+ unsigned short vendor;
+ unsigned short product;
+ unsigned short release;
+- char *serial;
+ unsigned int buflen;
+
+ int transport_type;
+@@ -346,6 +343,9 @@ module_param_array_named(file, mod_data.
+ S_IRUGO);
+ MODULE_PARM_DESC(file, "names of backing files or devices");
+
++module_param_named(serial, mod_data.serial, charp, S_IRUGO);
++MODULE_PARM_DESC(serial, "USB serial number");
++
+ module_param_array_named(ro, mod_data.ro, bool, &mod_data.num_ros, S_IRUGO);
+ MODULE_PARM_DESC(ro, "true to force read-only");
+
+@@ -365,9 +365,6 @@ MODULE_PARM_DESC(stall, "false to preven
+ module_param_named(cdrom, mod_data.cdrom, bool, S_IRUGO);
+ MODULE_PARM_DESC(cdrom, "true to emulate cdrom instead of disk");
+
+-module_param_named(serial, mod_data.serial, charp, S_IRUGO);
+-MODULE_PARM_DESC(serial, "USB serial number");
+-
+ /* In the non-TEST version, only the module parameters listed above
+ * are available. */
+ #ifdef CONFIG_USB_FILE_STORAGE_TEST
+@@ -3214,7 +3211,6 @@ static int __init check_parameters(struc
+ {
+ int prot;
+ int gcnum;
+- int i;
+
+ /* Store the default values */
+ mod_data.transport_type = USB_PR_BULK;
+@@ -3310,38 +3306,22 @@ static int __init check_parameters(struc
+ if ((*ch < '0' || *ch > '9') &&
+ (*ch < 'A' || *ch > 'F')) { /* not uppercase hex */
+ WARNING(fsg,
+- "Invalid serial string character: %c; "
+- "Failing back to default\n",
++ "Invalid serial string character: %c\n",
+ *ch);
+- goto fill_serial;
++ goto no_serial;
+ }
+ }
+ if (len > 126 ||
+ (mod_data.transport_type == USB_PR_BULK && len < 12) ||
+ (mod_data.transport_type != USB_PR_BULK && len > 12)) {
+- WARNING(fsg,
+- "Invalid serial string length; "
+- "Failing back to default\n");
+- goto fill_serial;
++ WARNING(fsg, "Invalid serial string length!\n");
++ goto no_serial;
+ }
+ fsg_strings[FSG_STRING_SERIAL - 1].s = mod_data.serial;
+ } else {
+- WARNING(fsg,
+- "Userspace failed to provide serial number; "
+- "Failing back to default\n");
+-fill_serial:
+- /* Serial number not specified or invalid, make our own.
+- * We just encode it from the driver version string,
+- * 12 characters to comply with both CB[I] and BBB spec.
+- * Warning : Two devices running the same kernel will have
+- * the same fallback serial number. */
+- for (i = 0; i < 12; i += 2) {
+- unsigned char c = DRIVER_VERSION[i / 2];
+-
+- if (!c)
+- break;
+- sprintf(&fsg_string_serial[i], "%02X", c);
+- }
++ WARNING(fsg, "No serial-number string provided!\n");
++ no_serial:
++ device_desc.iSerialNumber = 0;
+ }
+
+ return 0;
+--- a/drivers/usb/gadget/storage_common.c
++++ b/drivers/usb/gadget/storage_common.c
+@@ -26,7 +26,6 @@
+ * be defined (each of type pointer to char):
+ * - fsg_string_manufacturer -- name of the manufacturer
+ * - fsg_string_product -- name of the product
+- * - fsg_string_serial -- product's serial
+ * - fsg_string_config -- name of the configuration
+ * - fsg_string_interface -- name of the interface
+ * The first four are only needed when FSG_DESCRIPTORS_DEVICE_STRINGS
+@@ -552,7 +551,7 @@ static struct usb_string fsg_strings[]
+ #ifndef FSG_NO_DEVICE_STRINGS
+ {FSG_STRING_MANUFACTURER, fsg_string_manufacturer},
+ {FSG_STRING_PRODUCT, fsg_string_product},
+- {FSG_STRING_SERIAL, fsg_string_serial},
++ {FSG_STRING_SERIAL, ""},
+ {FSG_STRING_CONFIG, fsg_string_config},
+ #endif
+ {FSG_STRING_INTERFACE, fsg_string_interface},