diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-06-21 15:14:47 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-06-21 15:14:47 -0700 |
| commit | 988883492e6fc483249e9d7d8fe3a59b2ed3a5ae (patch) | |
| tree | 15f38b163fb0ba82923132a1e10241d38ae8f80b /usb.current | |
| parent | 77933b0a3605d49ac52fd8c04d2f03c80185a432 (diff) | |
| download | patches-988883492e6fc483249e9d7d8fe3a59b2ed3a5ae.tar.gz | |
more patches
Diffstat (limited to 'usb.current')
5 files changed, 356 insertions, 0 deletions
diff --git a/usb.current/usb-gadget-eth-fix-calculate-crc32-in-eem.patch b/usb.current/usb-gadget-eth-fix-calculate-crc32-in-eem.patch new file mode 100644 index 00000000000000..9534a591bd705e --- /dev/null +++ b/usb.current/usb-gadget-eth-fix-calculate-crc32-in-eem.patch @@ -0,0 +1,31 @@ +From Jiri.Pinkava@vscht.cz Mon Jun 21 14:40:59 2010 +From: Jiri Pinkava <jiri.pinkava@vscht.cz> +Date: Sun, 20 Jun 2010 20:05:52 +0200 +Subject: USB: gadget eth: Fix calculate CRC32 in EEM +To: linux-usb@vger.kernel.org, dbrownell@users.sourceforge.net +Cc: gregkh@suse.de, bniebuhr@efjohnson.com, tj@kernel.org, stevel@netspectrum.com +Message-ID: <4C1E5880.4050007@vscht.cz> + + +CRC should be calculated for Ethernet frame, not for whole recievede EEM data. +This bug shows rarely, because in many times len == skb->len. + +Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/f_eem.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/usb/gadget/f_eem.c ++++ b/drivers/usb/gadget/f_eem.c +@@ -469,8 +469,7 @@ static int eem_unwrap(struct gether *por + crc = get_unaligned_le32(skb->data + len + - ETH_FCS_LEN); + crc2 = ~crc32_le(~0, +- skb->data, +- skb->len - ETH_FCS_LEN); ++ skb->data, len - ETH_FCS_LEN); + } else { + crc = get_unaligned_be32(skb->data + len + - ETH_FCS_LEN); diff --git a/usb.current/usb-gadget-printer-fix-sleep-inside-atomic.patch b/usb.current/usb-gadget-printer-fix-sleep-inside-atomic.patch new file mode 100644 index 00000000000000..67fc5e5596ec9f --- /dev/null +++ b/usb.current/usb-gadget-printer-fix-sleep-inside-atomic.patch @@ -0,0 +1,163 @@ +From jslaby@suse.cz Mon Jun 21 14:19:25 2010 +From: Jiri Slaby <jslaby@suse.cz> +Date: Mon, 21 Jun 2010 17:02:40 +0200 +Subject: USB: gadget/printer, fix sleep inside atomic +To: gregkh@suse.de +Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, jirislaby@gmail.com, "Craig W. Nadler" <craig@nadler.us>, David Brownell <dbrownell@users.sourceforge.net> +Message-ID: <1277132560-14284-1-git-send-email-jslaby@suse.cz> + + +Stanse found that sleep is called inside atomic context created by +lock_printer_io spinlock in several functions. It's used in process +context only and some functions sleep inside its critical section. As +this is not allowed for spinlocks, switch it to mutex. + +Signed-off-by: Jiri Slaby <jslaby@suse.cz> +Cc: Craig W. Nadler <craig@nadler.us> +Cc: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/printer.c | 32 ++++++++++++++++---------------- + 1 file changed, 16 insertions(+), 16 deletions(-) + +--- a/drivers/usb/gadget/printer.c ++++ b/drivers/usb/gadget/printer.c +@@ -82,7 +82,7 @@ static struct class *usb_gadget_class; + struct printer_dev { + spinlock_t lock; /* lock this structure */ + /* lock buffer lists during read/write calls */ +- spinlock_t lock_printer_io; ++ struct mutex lock_printer_io; + struct usb_gadget *gadget; + struct usb_request *req; /* for control responses */ + u8 config; +@@ -567,7 +567,7 @@ printer_read(struct file *fd, char __use + + DBG(dev, "printer_read trying to read %d bytes\n", (int)len); + +- spin_lock(&dev->lock_printer_io); ++ mutex_lock(&dev->lock_printer_io); + spin_lock_irqsave(&dev->lock, flags); + + /* We will use this flag later to check if a printer reset happened +@@ -601,7 +601,7 @@ printer_read(struct file *fd, char __use + * call or not. + */ + if (fd->f_flags & (O_NONBLOCK|O_NDELAY)) { +- spin_unlock(&dev->lock_printer_io); ++ mutex_unlock(&dev->lock_printer_io); + return -EAGAIN; + } + +@@ -648,7 +648,7 @@ printer_read(struct file *fd, char __use + if (dev->reset_printer) { + list_add(¤t_rx_req->list, &dev->rx_reqs); + spin_unlock_irqrestore(&dev->lock, flags); +- spin_unlock(&dev->lock_printer_io); ++ mutex_unlock(&dev->lock_printer_io); + return -EAGAIN; + } + +@@ -673,7 +673,7 @@ printer_read(struct file *fd, char __use + dev->current_rx_buf = current_rx_buf; + + spin_unlock_irqrestore(&dev->lock, flags); +- spin_unlock(&dev->lock_printer_io); ++ mutex_unlock(&dev->lock_printer_io); + + DBG(dev, "printer_read returned %d bytes\n", (int)bytes_copied); + +@@ -697,7 +697,7 @@ printer_write(struct file *fd, const cha + if (len == 0) + return -EINVAL; + +- spin_lock(&dev->lock_printer_io); ++ mutex_lock(&dev->lock_printer_io); + spin_lock_irqsave(&dev->lock, flags); + + /* Check if a printer reset happens while we have interrupts on */ +@@ -713,7 +713,7 @@ printer_write(struct file *fd, const cha + * a NON-Blocking call or not. + */ + if (fd->f_flags & (O_NONBLOCK|O_NDELAY)) { +- spin_unlock(&dev->lock_printer_io); ++ mutex_unlock(&dev->lock_printer_io); + return -EAGAIN; + } + +@@ -752,7 +752,7 @@ printer_write(struct file *fd, const cha + + if (copy_from_user(req->buf, buf, size)) { + list_add(&req->list, &dev->tx_reqs); +- spin_unlock(&dev->lock_printer_io); ++ mutex_unlock(&dev->lock_printer_io); + return bytes_copied; + } + +@@ -766,14 +766,14 @@ printer_write(struct file *fd, const cha + if (dev->reset_printer) { + list_add(&req->list, &dev->tx_reqs); + spin_unlock_irqrestore(&dev->lock, flags); +- spin_unlock(&dev->lock_printer_io); ++ mutex_unlock(&dev->lock_printer_io); + return -EAGAIN; + } + + if (usb_ep_queue(dev->in_ep, req, GFP_ATOMIC)) { + list_add(&req->list, &dev->tx_reqs); + spin_unlock_irqrestore(&dev->lock, flags); +- spin_unlock(&dev->lock_printer_io); ++ mutex_unlock(&dev->lock_printer_io); + return -EAGAIN; + } + +@@ -782,7 +782,7 @@ printer_write(struct file *fd, const cha + } + + spin_unlock_irqrestore(&dev->lock, flags); +- spin_unlock(&dev->lock_printer_io); ++ mutex_unlock(&dev->lock_printer_io); + + DBG(dev, "printer_write sent %d bytes\n", (int)bytes_copied); + +@@ -820,11 +820,11 @@ printer_poll(struct file *fd, poll_table + unsigned long flags; + int status = 0; + +- spin_lock(&dev->lock_printer_io); ++ mutex_lock(&dev->lock_printer_io); + spin_lock_irqsave(&dev->lock, flags); + setup_rx_reqs(dev); + spin_unlock_irqrestore(&dev->lock, flags); +- spin_unlock(&dev->lock_printer_io); ++ mutex_unlock(&dev->lock_printer_io); + + poll_wait(fd, &dev->rx_wait, wait); + poll_wait(fd, &dev->tx_wait, wait); +@@ -1461,7 +1461,7 @@ autoconf_fail: + } + + spin_lock_init(&dev->lock); +- spin_lock_init(&dev->lock_printer_io); ++ mutex_init(&dev->lock_printer_io); + INIT_LIST_HEAD(&dev->tx_reqs); + INIT_LIST_HEAD(&dev->tx_reqs_active); + INIT_LIST_HEAD(&dev->rx_reqs); +@@ -1594,7 +1594,7 @@ cleanup(void) + { + int status; + +- spin_lock(&usb_printer_gadget.lock_printer_io); ++ mutex_lock(&usb_printer_gadget.lock_printer_io); + class_destroy(usb_gadget_class); + unregister_chrdev_region(g_printer_devno, 2); + +@@ -1602,6 +1602,6 @@ cleanup(void) + if (status) + ERROR(dev, "usb_gadget_unregister_driver %x\n", status); + +- spin_unlock(&usb_printer_gadget.lock_printer_io); ++ mutex_unlock(&usb_printer_gadget.lock_printer_io); + } + module_exit(cleanup); diff --git a/usb.current/usb-isp1362-hcd-fix-double-lock.patch b/usb.current/usb-isp1362-hcd-fix-double-lock.patch new file mode 100644 index 00000000000000..d8e8f0950af3c8 --- /dev/null +++ b/usb.current/usb-isp1362-hcd-fix-double-lock.patch @@ -0,0 +1,66 @@ +From jslaby@suse.cz Mon Jun 21 14:19:09 2010 +From: Jiri Slaby <jslaby@suse.cz> +Date: Mon, 21 Jun 2010 17:02:51 +0200 +Subject: USB: isp1362-hcd, fix double lock +To: gregkh@suse.de +Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, jirislaby@gmail.com, Lothar Wassmann <LW@KARO-electronics.de>, Michael Hennerich <michael.hennerich@analog.com>, Bryan Wu <cooloney@kernel.org>, Mike Frysinger <vapier@gentoo.org> +Message-ID: <1277132571-14320-1-git-send-email-jslaby@suse.cz> + + +Stanse found that isp1362_sw_reset tries to take a isp1362_hcd->lock, +but it is already held in isp1362_hc_stop. Avoid that by introducing +__isp1362_sw_reset which doesn't take the lock and call it from +isp1362_hc_stop. isp1362_sw_reset is then as simple as lock -- +__isp1362_sw_reset -- unlock. + +Signed-off-by: Jiri Slaby <jslaby@suse.cz> +Cc: Lothar Wassmann <LW@KARO-electronics.de> +Cc: Michael Hennerich <michael.hennerich@analog.com> +Cc: Bryan Wu <cooloney@kernel.org> +Cc: Mike Frysinger <vapier@gentoo.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/isp1362-hcd.c | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +--- a/drivers/usb/host/isp1362-hcd.c ++++ b/drivers/usb/host/isp1362-hcd.c +@@ -2224,12 +2224,9 @@ static void remove_debug_file(struct isp + + /*-------------------------------------------------------------------------*/ + +-static void isp1362_sw_reset(struct isp1362_hcd *isp1362_hcd) ++static void __isp1362_sw_reset(struct isp1362_hcd *isp1362_hcd) + { + int tmp = 20; +- unsigned long flags; +- +- spin_lock_irqsave(&isp1362_hcd->lock, flags); + + isp1362_write_reg16(isp1362_hcd, HCSWRES, HCSWRES_MAGIC); + isp1362_write_reg32(isp1362_hcd, HCCMDSTAT, OHCI_HCR); +@@ -2240,6 +2237,14 @@ static void isp1362_sw_reset(struct isp1 + } + if (!tmp) + pr_err("Software reset timeout\n"); ++} ++ ++static void isp1362_sw_reset(struct isp1362_hcd *isp1362_hcd) ++{ ++ unsigned long flags; ++ ++ spin_lock_irqsave(&isp1362_hcd->lock, flags); ++ __isp1362_sw_reset(isp1362_hcd); + spin_unlock_irqrestore(&isp1362_hcd->lock, flags); + } + +@@ -2418,7 +2423,7 @@ static void isp1362_hc_stop(struct usb_h + if (isp1362_hcd->board && isp1362_hcd->board->reset) + isp1362_hcd->board->reset(hcd->self.controller, 1); + else +- isp1362_sw_reset(isp1362_hcd); ++ __isp1362_sw_reset(isp1362_hcd); + + if (isp1362_hcd->board && isp1362_hcd->board->clock) + isp1362_hcd->board->clock(hcd->self.controller, 0); diff --git a/usb.current/usb-qcserial-fix-a-memory-leak-in-qcprobe-error-path.patch b/usb.current/usb-qcserial-fix-a-memory-leak-in-qcprobe-error-path.patch new file mode 100644 index 00000000000000..3332c336e757d5 --- /dev/null +++ b/usb.current/usb-qcserial-fix-a-memory-leak-in-qcprobe-error-path.patch @@ -0,0 +1,43 @@ +From axel.lin@gmail.com Mon Jun 21 14:40:38 2010 +From: Axel Lin <axel.lin@gmail.com> +Date: Mon, 21 Jun 2010 08:44:17 +0800 +Subject: USB: qcserial: fix a memory leak in qcprobe error path +Cc: Greg Kroah-Hartman <gregkh@suse.de>, Matthew Garrett <mjg@redhat.com>, Anssi Hannula <anssi.hannula@gmail.com>, Bernhard Rosenkraenzer <bero@arklinux.org>, linux-usb@vger.kernel.org +Message-ID: <1277081057.15579.3.camel@mola> + + +This patch adds missing kfree(data) before return -ENODEV. + +Signed-off-by: Axel Lin <axel.lin@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/qcserial.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/usb/serial/qcserial.c ++++ b/drivers/usb/serial/qcserial.c +@@ -139,6 +139,7 @@ static int qcprobe(struct usb_serial *se + "Could not set interface, error %d\n", + retval); + retval = -ENODEV; ++ kfree(data); + } + return retval; + } +@@ -155,6 +156,7 @@ static int qcprobe(struct usb_serial *se + "Could not set interface, error %d\n", + retval); + retval = -ENODEV; ++ kfree(data); + } + return retval; + } +@@ -163,6 +165,7 @@ static int qcprobe(struct usb_serial *se + default: + dev_err(&serial->dev->dev, + "unknown number of interfaces: %d\n", nintf); ++ kfree(data); + return -ENODEV; + } + diff --git a/usb.current/usb-serial-ftdi-correct-merge-conflict-with-contec-id.patch b/usb.current/usb-serial-ftdi-correct-merge-conflict-with-contec-id.patch new file mode 100644 index 00000000000000..86db9d73a0652c --- /dev/null +++ b/usb.current/usb-serial-ftdi-correct-merge-conflict-with-contec-id.patch @@ -0,0 +1,53 @@ +From daniel.sangorrin@gmail.com Mon Jun 21 14:18:14 2010 +From: Daniel Sangorrin <daniel.sangorrin@gmail.com> +Date: Fri, 18 Jun 2010 15:30:02 +0900 +Subject: USB: serial: ftdi: correct merge conflict with CONTEC id +To: Andreas Mohr <andi@lisas.de> +Cc: Greg Kroah-Hartman <gregkh@suse.de>, Radek Liboska <liboska@uochb.cas.cz>, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org +Message-ID: <AANLkTimx1HWYzG0qQqP12ObWQI1eiH5SoFpRic06uN3f@mail.gmail.com> + + +This patch corrects a problem with the merge of a previous +patch to add the CONTEC identifier. + +I believe the merge problem occurred with the commit: +dee5658b482e9e2ac7d6205dc876fc11d4008138 + +Originally I submitted a patch and then they asked me to order the IDs +and resubmit, so did I. But unfortunately in the end somehow both +patches were merged. + +Signed-off-by: Daniel Sangorrin <daniel.sangorrin@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/ftdi_sio.c | 1 - + drivers/usb/serial/ftdi_sio_ids.h | 7 ------- + 2 files changed, 8 deletions(-) + +--- a/drivers/usb/serial/ftdi_sio.c ++++ b/drivers/usb/serial/ftdi_sio.c +@@ -653,7 +653,6 @@ static struct usb_device_id id_table_com + { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, + { USB_DEVICE(EVOLUTION_VID, EVO_HYBRID_PID) }, + { USB_DEVICE(EVOLUTION_VID, EVO_RCM4_PID) }, +- { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16C_PID) }, +--- a/drivers/usb/serial/ftdi_sio_ids.h ++++ b/drivers/usb/serial/ftdi_sio_ids.h +@@ -501,13 +501,6 @@ + #define CONTEC_COM1USBH_PID 0x8311 /* COM-1(USB)H */ + + /* +- * Contec products (http://www.contec.com) +- * Submitted by Daniel Sangorrin +- */ +-#define CONTEC_VID 0x06CE /* Vendor ID */ +-#define CONTEC_COM1USBH_PID 0x8311 /* COM-1(USB)H */ +- +-/* + * Definitions for B&B Electronics products. + */ + #define BANDB_VID 0x0856 /* B&B Electronics Vendor ID */ |
