1. 10 Sep, 2013 24 commits
  2. 02 Aug, 2013 16 commits
    • Ben Hutchings's avatar
      Linux 3.2.50 · 401390fb
      Ben Hutchings authored
      401390fb
    • William Gulland's avatar
      usb: Clear both buffers when clearing a control transfer TT buffer. · 7a444fe1
      William Gulland authored
      commit 2c7b871b upstream.
      
      Control transfers have both IN and OUT (or SETUP) packets, so when
      clearing TT buffers for a control transfer it's necessary to send
      two HUB_CLEAR_TT_BUFFER requests to the hub.
      Signed-off-by: default avatarWilliam Gulland <wgulland@google.com>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      7a444fe1
    • Johan Hovold's avatar
      USB: mos7840: fix memory leak in open · 3c574b06
      Johan Hovold authored
      commit 5f8a2e68 upstream.
      
      Allocated urbs and buffers were never freed on errors in open.
      Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      [bwh: Backported to 3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      3c574b06
    • Enrico Mioso's avatar
      usb: serial: option.c: remove ONDA MT825UP product ID fromdriver · 07d41dce
      Enrico Mioso authored
      commit 878c69aa upstream.
      
      Some (very few) early devices like mine, where not exposting a proper CDC
      descriptor. This was fixed with an immediate firmware update from the vendor,
      and pre-installed on newer devices.
      So actual devices can be driven by cdc_acm.c + cdc_ether.c.
      Signed-off-by: default avatarEnrico Mioso <mrkiko.rs@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      07d41dce
    • Dan Williams's avatar
      usb: serial: option: add Olivetti Olicard 200 · afbdf5cb
      Dan Williams authored
      commit 4cf76df0 upstream.
      
      Speaks AT on interfaces 5 (command & PPP) and 3 (secondary), other
      interface protocols are unknown.
      Signed-off-by: default avatarDan Williams <dcbw@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      afbdf5cb
    • Enrico Mioso's avatar
      usb: serial: option: blacklist ONDA MT689DC QMI interface · fd31a3db
      Enrico Mioso authored
      commit 3d1a69e7 upstream.
      
      Prevent the option driver from binding itself to the QMI/WWAN interface, making
      it unusable by the proper driver.
      Signed-off-by: default avatarenrico Mioso <mrkiko.rs@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      fd31a3db
    • Oleksij Rempel's avatar
      xhci: fix null pointer dereference on ring_doorbell_for_active_rings · 68a127fb
      Oleksij Rempel authored
      commit d66eaf9f upstream.
      
      in some cases where device is attched to xhci port and do not responding,
      for example ath9k_htc with stalled firmware, kernel will
      crash on ring_doorbell_for_active_rings.
      This patch check if pointer exist before it is used.
      
      This patch should be backported to kernels as old as 2.6.35, that
      contain the commit e9df17eb "USB: xhci:
      Correct assumptions about number of rings per endpoint"
      Signed-off-by: default avatarOleksij Rempel <linux@rempel-privat.de>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      68a127fb
    • George Cherian's avatar
      usb: host: xhci: Enable XHCI_SPURIOUS_SUCCESS for all controllers with xhci 1.0 · 5829ddf0
      George Cherian authored
      commit 07f3cb7c upstream.
      
      Xhci controllers with hci_version > 0.96 gives spurious success
      events on short packet completion. During webcam capture the
      "ERROR Transfer event TRB DMA ptr not part of current TD" was observed.
      The same application works fine with synopsis controllers hci_version 0.96.
      The same issue is seen with Intel Pantherpoint xhci controller. So enabling
      this quirk in xhci_gen_setup if controller verion is greater than 0.96.
      For xhci-pci move the quirk to much generic place xhci_gen_setup.
      
      Note from Sarah:
      
      The xHCI 1.0 spec changed how hardware handles short packets.  The HW
      will notify SW of the TRB where the short packet occurred, and it will
      also give a successful status for the last TRB in a TD (the one with the
      IOC flag set).  On the second successful status, that warning will be
      triggered in the driver.
      
      Software is now supposed to not assume the TD is not completed until it
      gets that last successful status.  That means we have a slight race
      condition, although it should have little practical impact.  This patch
      papers over that issue.
      
      It's on my long-term to-do list to fix this race condition, but it is a
      much more involved patch that will probably be too big for stable.  This
      patch is needed for stable to avoid serious log spam.
      
      This patch should be backported to kernels as old as 3.0, that
      contain the commit ad808333 "Intel xhci:
      Ignore spurious successful event."
      
      The patch will have to be modified for kernels older than 3.2, since
      that kernel added the xhci_gen_setup function for xhci platform devices.
      The correct conflict resolution for kernels older than 3.2 is to set
      XHCI_SPURIOUS_SUCCESS in xhci_pci_quirks for all xHCI 1.0 hosts.
      Signed-off-by: default avatarGeorge Cherian <george.cherian@ti.com>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      5829ddf0
    • Sarah Sharp's avatar
      xhci: Avoid NULL pointer deref when host dies. · 6f536ab9
      Sarah Sharp authored
      commit 203a8661 upstream.
      
      When the host controller fails to respond to an Enable Slot command, and
      the host fails to respond to the register write to abort the command
      ring, the xHCI driver will assume the host is dead, and call
      usb_hc_died().
      
      The USB device's slot_id is still set to zero, and the pointer stored at
      xhci->devs[0] will always be NULL.  The call to xhci_check_args in
      xhci_free_dev should have caught the NULL virt_dev pointer.
      
      However, xhci_free_dev is designed to free the xhci_virt_device
      structures, even if the host is dead, so that we don't leak kernel
      memory.  xhci_free_dev checks the return value from the generic
      xhci_check_args function.  If the return value is -ENODEV, it carries on
      trying to free the virtual device.
      
      The issue is that xhci_check_args looks at the host controller state
      before it looks at the xhci_virt_device pointer.  It will return -ENIVAL
      because the host is dead, and xhci_free_dev will ignore the return
      value, and happily dereference the NULL xhci_virt_device pointer.
      
      The fix is to make sure that xhci_check_args checks the xhci_virt_device
      pointer before it checks the host state.
      
      See https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1203453 for
      further details.  This patch doesn't solve the underlying issue, but
      will ensure we don't see any more NULL pointer dereferences because of
      the issue.
      
      This patch should be backported to kernels as old as 3.1, that
      contain the commit 7bd89b40 "xhci: Don't
      submit commands or URBs to halted hosts."
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: default avatarVincent Thiele <vincentthiele@gmail.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      6f536ab9
    • Enrico Mioso's avatar
      usb: serial: option: Add ONYX 3G device support · dcef899c
      Enrico Mioso authored
      commit 63b5df96 upstream.
      
      This patch adds support for the ONYX 3G device (version 1) from ALFA
      NETWORK.
      Signed-off-by: default avatarEnrico Mioso <mrkiko.rs@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      dcef899c
    • Johan Hovold's avatar
      USB: ti_usb_3410_5052: fix dynamic-id matching · 9e91b416
      Johan Hovold authored
      commit 1fad5642 upstream.
      
      The driver failed to take the dynamic ids into account when determining
      the device type and therefore all devices were detected as 2-port
      devices when using the dynamic-id interface.
      
      Match on the usb-serial-driver field instead of doing redundant id-table
      searches.
      Reported-by: default avatarAnders Hammarquist <iko@iko.pp.se>
      Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      9e91b416
    • Anton Blanchard's avatar
      powerpc/modules: Module CRC relocation fix causes perf issues · bbacf542
      Anton Blanchard authored
      commit 0e0ed640 upstream.
      
      Module CRCs are implemented as absolute symbols that get resolved by
      a linker script. We build an intermediate .o that contains an
      unresolved symbol for each CRC. genksysms parses this .o, calculates
      the CRCs and writes a linker script that "resolves" the symbols to
      the calculated CRC.
      
      Unfortunately the ppc64 relocatable kernel sees these CRCs as symbols
      that need relocating and relocates them at boot. Commit d4703aef
      (module: handle ppc64 relocating kcrctabs when CONFIG_RELOCATABLE=y)
      added a hook to reverse the bogus relocations. Part of this patch
      created a symbol at 0x0:
      
      # head -2 /proc/kallsyms
      0000000000000000 T reloc_start
      c000000000000000 T .__start
      
      This reloc_start symbol is causing lots of confusion to perf. It
      thinks reloc_start is a massive function that stretches from 0x0 to
      0xc000000000000000 and we get various cryptic errors out of perf,
      including:
      
      problem incrementing symbol count, skipping event
      
      This patch removes the  reloc_start linker script label and instead
      defines it as PHYSICAL_START. We also need to wrap it with
      CONFIG_PPC64 because the ppc32 kernel can set a non zero
      PHYSICAL_START at compile time and we wouldn't want to subtract
      it from the CRCs in that case.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Acked-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      bbacf542
    • Bjørn Mork's avatar
      usb: option: add TP-LINK MA260 · 9c0abcdc
      Bjørn Mork authored
      commit 94190301 upstream.
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      9c0abcdc
    • Ian Abbott's avatar
      staging: comedi: fix a race between do_cmd_ioctl() and read/write · 1f8adde0
      Ian Abbott authored
      commit 4b18f08b upstream.
      
      `do_cmd_ioctl()` is called with the comedi device's mutex locked to
      process the `COMEDI_CMD` ioctl to set up comedi's asynchronous command
      handling on a comedi subdevice.  `comedi_read()` and `comedi_write()`
      are the `read` and `write` handlers for the comedi device, but do not
      lock the mutex (for performance reasons, as some things can hold the
      mutex for quite a long time).
      
      There is a race condition if `comedi_read()` or `comedi_write()` is
      running at the same time and for the same file object and comedi
      subdevice as `do_cmd_ioctl()`.  `do_cmd_ioctl()` sets the subdevice's
      `busy` pointer to the file object way before it sets the `SRF_RUNNING` flag
      in the subdevice's `runflags` member.  `comedi_read() and
      `comedi_write()` check the subdevice's `busy` pointer is pointing to the
      current file object, then if the `SRF_RUNNING` flag is not set, will call
      `do_become_nonbusy()` to shut down the asyncronous command.  Bad things
      can happen if the asynchronous command is being shutdown and set up at
      the same time.
      
      To prevent the race, don't set the `busy` pointer until
      after the `SRF_RUNNING` flag has been set.  Also, make sure the mutex is
      held in `comedi_read()` and `comedi_write()` while calling
      `do_become_nonbusy()` in order to avoid moving the race condition to a
      point within that function.
      
      Change some error handling `goto cleanup` statements in `do_cmd_ioctl()`
      to simple `return -ERRFOO` statements as a result of changing when the
      `busy` pointer is set.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      [bwh: Backported to 3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      1f8adde0
    • Ian Abbott's avatar
      staging: comedi: COMEDI_CANCEL ioctl should wake up read/write · f6c4c6bd
      Ian Abbott authored
      commit 69acbaac upstream.
      
      Comedi devices can do blocking read() or write() (or poll()) if an
      asynchronous command has been set up, blocking for data (for read()) or
      buffer space (for write()).  Various events associated with the
      asynchronous command will wake up the blocked reader or writer (or
      poller).  It is also possible to force the asynchronous command to
      terminate by issuing a `COMEDI_CANCEL` ioctl.  That shuts down the
      asynchronous command, but does not currently wake up the blocked reader
      or writer (or poller).  If the blocked task could be woken up, it would
      see that the command is no longer active and return.  The caller of the
      `COMEDI_CANCEL` ioctl could attempt to wake up the blocked task by
      sending a signal, but that's a nasty workaround.
      
      Change `do_cancel_ioctl()` to wake up the wait queue after it returns
      from `do_cancel()`.  `do_cancel()` can propagate an error return value
      from the low-level comedi driver's cancel routine, but it always shuts
      the command down regardless, so `do_cancel_ioctl()` can wake up he wait
      queue regardless of the return value from `do_cancel()`.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      f6c4c6bd
    • Alexandr \\\"Sky\\\" Ivanov's avatar
      USB: option: add D-Link DWM-152/C1 and DWM-156/C1 · 281e4f20
      Alexandr \\\"Sky\\\" Ivanov authored
      commit ca247635 upstream.
      
      Adding support for D-Link DWM-152/C1 and DWM-156/C1 devices.
      
      DWM-152/C1:
      T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  6 Spd=480 MxCh= 0
      D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
      P:  Vendor=07d1 ProdID=3e01 Rev= 0.00
      S:  Product=USB Configuration
      S:  SerialNumber=1234567890ABCDEF
      C:* #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=81(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      I:* If#= 4 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
      E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      
      DWM-156/C1:
      T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  8 Spd=480 MxCh= 0
      D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
      P:  Vendor=07d1 ProdID=3e02 Rev= 0.00
      S:  Product=DataCard Device
      S:  SerialNumber=1234567890ABCDEF
      C:* #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=81(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      I:* If#= 4 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
      E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      Signed-off-by: default avatarAlexandr Ivanov <alexandr.sky@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      281e4f20