1. 29 Oct, 2014 1 commit
  2. 27 Oct, 2014 1 commit
  3. 25 Oct, 2014 1 commit
    • Greg Kroah-Hartman's avatar
      Merge tag 'fixes-for-v3.18-rc2' of... · 8071e6f8
      Greg Kroah-Hartman authored
      Merge tag 'fixes-for-v3.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus
      
      Felipe writes:
      
      usb: fixes for v3.18-rc2
      
      Here's the first set of fixes for v3.18-rc cycle. It includes
      a whole bunch of bug fixes related to USB20CV and USB30CV when
      running on DWC3 and MUSB. After this series, we have clean chapter 9
      and MSC tests for all gadget drivers.
      
      We also have a new PCI ID for Intel Braswell platform so they can use
      DWC3 out-of-the-box.
      
      A regression on functionfs wrt quirk_ep_out_aligned_size flag has also
      been fixed.
      
      DWC2 got a couple of fixes for the gadget role. The first of which fixes
      rmmod followed by modprobe while the second makes sure to disable PHYs
      before killing the regulators powering them.
      
      These are the most important fixes worth mentioning, there are a few
      other minor fixes as well.
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      8071e6f8
  4. 23 Oct, 2014 19 commits
    • Pavitrakumar Managutte's avatar
      usb: gadget: function: Fixed the return value on error path · 9b176355
      Pavitrakumar Managutte authored
      Fixed the return value on failure. status variable
      is set to 0 at usb_assign_descriptors call and the same is
      returned on error which is incorrect.
      Acked-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarPavitrakumar Managutte <pavitra1729@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      9b176355
    • Marek Szyprowski's avatar
      usb: dwc2: gadget: disable phy before turning off power regulators · 3a8146aa
      Marek Szyprowski authored
      This patch fixes probe function to match the pattern used elsewhere in
      the driver, where power regulators are turned off as the last element in
      the device shutdown procedure.
      Acked-by: default avatarPaul Zimmerman <paulz@synopsys.com>
      Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      3a8146aa
    • Pavitrakumar Managutte's avatar
      usb: gadget: function: Remove redundant usb_free_all_descriptors · d12a8727
      Pavitrakumar Managutte authored
      Removed usb_free_all_descriptors in the bind functions, which
      results in double-free corruption of the descriptors on error path.
      The usb descriptors are allocated by usb_assign_descriptors.
      Signed-off-by: default avatarPavitrakumar Managutte <pavitra1729@gmail.com>
      Reviewed-by: default avatarRobert Baldyga <r.baldyga@samsung.com>
      Reviewed-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      d12a8727
    • Jack Pham's avatar
      usb: dwc3: gadget: Properly initialize LINK TRB · 1200a82a
      Jack Pham authored
      On ISOC endpoints the last trb_pool entry used as a
      LINK TRB is not getting zeroed out correctly due to
      memset being called incorrectly and in the wrong place.
      If pool allocated from DMA was not zero-initialized
      to begin with this will result in the size and ctrl
      values being random garbage. Call memset correctly after
      assignment of the trb_link pointer.
      
      Fixes: f6bafc6a ("usb: dwc3: convert TRBs into bitshifts")
      Cc: <stable@vger.kernel.org> # v3.4+
      Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      1200a82a
    • Marek Szyprowski's avatar
      usb: dwc2: gadget: fix gadget unregistration in udc_stop() function · 32805c35
      Marek Szyprowski authored
      udc_stop() should clear ->driver pointer unconditionally to let the UDC
      framework to work correctly with both registering/unregistering gadgets
      and enabling/disabling gadgets by writing to
      /sys/class/udc/*hsotg/soft_connect interface.
      Acked-by: default avatarPaul Zimmerman <paulz@synopsys.com>
      Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      32805c35
    • Charles Manning's avatar
      usb: dwc2: Bits in bitfield should add up to 32 · fd4850cf
      Charles Manning authored
      The unioned u32 is used for clearing etc. Having the number of
      bitfield bits add up to more than 32 is broken, even if benign.
      Acked-by: default avatarPaul Zimmerman <paulz@synopsys.com>
      Signed-off-by: default avatarCharles Manning <cdhmanning@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      fd4850cf
    • Sudip Mukherjee's avatar
      usb: dwc2: gadget: sparse warning of context imbalance · b585a48b
      Sudip Mukherjee authored
      sparse was giving the following warning:
              warning: context imbalance in 's3c_hsotg_ep_enable'
      	                - different lock contexts for basic block
      
      we were returning ENOMEM while still holding the spinlock.
      The sparse warning was fixed by releasing the spinlock before return.
      
      Cc: <stable@vger.kernel.org> # v3.17
      Acked-by: default avatarPaul Zimmerman <paulz@synopsys.com>
      Signed-off-by: default avatarSudip Mukherjee <sudip@vectorindia.org>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      b585a48b
    • Felipe Balbi's avatar
      usb: gadget: udc: core: fix kernel oops with soft-connect · bfa6b18c
      Felipe Balbi authored
      Currently, there's no guarantee that udc->driver
      will be valid when using soft_connect sysfs
      interface. In fact, we can very easily trigger
      a NULL pointer dereference by trying to disconnect
      when a gadget driver isn't loaded.
      
      Fix this bug:
      
      ~# echo disconnect > soft_connect
      [   33.685743] Unable to handle kernel NULL pointer dereference at virtual address 00000014
      [   33.694221] pgd = ed0cc000
      [   33.697174] [00000014] *pgd=ae351831, *pte=00000000, *ppte=00000000
      [   33.703766] Internal error: Oops: 17 [#1] SMP ARM
      [   33.708697] Modules linked in: xhci_plat_hcd xhci_hcd snd_soc_davinci_mcasp snd_soc_tlv320aic3x snd_soc_edma snd_soc_omap snd_soc_evm snd_soc_core dwc3 snd_compress snd_pcm_dmaengine snd_pcm snd_timer snd lis3lv02d_i2c matrix_keypad lis3lv02d dwc3_omap input_polldev soundcore
      [   33.734372] CPU: 0 PID: 1457 Comm: bash Not tainted 3.17.0-09740-ga93416e-dirty #345
      [   33.742457] task: ee71ce00 ti: ee68a000 task.ti: ee68a000
      [   33.748116] PC is at usb_udc_softconn_store+0xa4/0xec
      [   33.753416] LR is at mark_held_locks+0x78/0x90
      [   33.758057] pc : [<c04df128>]    lr : [<c00896a4>]    psr: 20000013
      [   33.758057] sp : ee68bec8  ip : c0c00008  fp : ee68bee4
      [   33.770050] r10: ee6b394c  r9 : ee68bf80  r8 : ee6062c0
      [   33.775508] r7 : 00000000  r6 : ee6062c0  r5 : 0000000b  r4 : ee739408
      [   33.782346] r3 : 00000000  r2 : 00000000  r1 : ee71d390  r0 : ee664170
      [   33.789168] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      [   33.796636] Control: 10c5387d  Table: ad0cc059  DAC: 00000015
      [   33.802638] Process bash (pid: 1457, stack limit = 0xee68a248)
      [   33.808740] Stack: (0xee68bec8 to 0xee68c000)
      [   33.813299] bec0:                   0000000b c0411284 ee6062c0 00000000 ee68bef4 ee68bee8
      [   33.821862] bee0: c04112ac c04df090 ee68bf14 ee68bef8 c01c2868 c0411290 0000000b ee6b3940
      [   33.830419] bf00: 00000000 00000000 ee68bf4c ee68bf18 c01c1a24 c01c2818 00000000 00000000
      [   33.838990] bf20: ee61b940 ee2f47c0 0000000b 000ce408 ee68bf80 c000f304 ee68a000 00000000
      [   33.847544] bf40: ee68bf7c ee68bf50 c0152dd8 c01c1960 ee68bf7c c0170af8 ee68bf7c ee2f47c0
      [   33.856099] bf60: ee2f47c0 000ce408 0000000b c000f304 ee68bfa4 ee68bf80 c0153330 c0152d34
      [   33.864653] bf80: 00000000 00000000 0000000b 000ce408 b6e7fb50 00000004 00000000 ee68bfa8
      [   33.873204] bfa0: c000f080 c01532e8 0000000b 000ce408 00000001 000ce408 0000000b 00000000
      [   33.881763] bfc0: 0000000b 000ce408 b6e7fb50 00000004 0000000b 00000000 000c5758 00000000
      [   33.890319] bfe0: 00000000 bec2c924 b6de422d b6e1d226 40000030 00000001 75716d2f 00657565
      [   33.898890] [<c04df128>] (usb_udc_softconn_store) from [<c04112ac>] (dev_attr_store+0x28/0x34)
      [   33.907920] [<c04112ac>] (dev_attr_store) from [<c01c2868>] (sysfs_kf_write+0x5c/0x60)
      [   33.916200] [<c01c2868>] (sysfs_kf_write) from [<c01c1a24>] (kernfs_fop_write+0xd0/0x194)
      [   33.924773] [<c01c1a24>] (kernfs_fop_write) from [<c0152dd8>] (vfs_write+0xb0/0x1bc)
      [   33.932874] [<c0152dd8>] (vfs_write) from [<c0153330>] (SyS_write+0x54/0xb0)
      [   33.940247] [<c0153330>] (SyS_write) from [<c000f080>] (ret_fast_syscall+0x0/0x48)
      [   33.948160] Code: e1a01007 e12fff33 e5140004 e5143008 (e5933014)
      [   33.954625] ---[ end trace f849bead94eab7ea ]---
      
      Fixes: 2ccea03a (usb: gadget: introduce UDC Class)
      Cc: <stable@vger.kernel.org> # v3.1+
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      bfa6b18c
    • Sebastian Andrzej Siewior's avatar
      usb: musb: musb_dsps: fix NULL pointer in suspend · f042e9cb
      Sebastian Andrzej Siewior authored
      So testing managed to configure musb in DMA mode but not load the
      matching cppi41 driver for DMA. This results in
      
      |musb-hdrc musb-hdrc.0.auto: Failed to request rx1.
      |musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with status -517
      |platform musb-hdrc.0.auto: Driver musb-hdrc requests probe deferral
      
      which is "okay". Once the driver is loaded we re-try probing and
      everyone is happy. Until then if you try suspend say
          echo mem > /sys/power/state
      then you go boom
      
      |Unable to handle kernel NULL pointer dereference at virtual address 000003a4
      |pgd = cf50c000
      |[000003a4] *pgd=8f6a3831, *pte=00000000, *ppte=00000000
      |Internal error: Oops: 17 [#1] ARM
      |PC is at dsps_suspend+0x18/0x9c [musb_dsps]
      |LR is at dsps_suspend+0x18/0x9c [musb_dsps]
      |pc : [<bf08e268>] lr : [<bf08e268>] psr: a0000013
      |sp : cbd97e00 ip : c0af4394 fp : 00000000
      |r10: c0831d90 r9 : 00000002 r8 : cf6da410
      |r7 : c03ba4dc r6 : bf08f224 r5 : 00000000 r4 : cbc5fcd0
      |r3 : bf08e250 r2 : bf08f264 r1 : cf6da410 r0 : 00000000
      |[<bf08e268>] (dsps_suspend [musb_dsps]) from [<c03ba508>] (platform_pm_suspend+0x2c/0x54)
      |Code: e1a04000 e9900041 e2800010 eb4caa8e (e59053a4)
      
      because platform_get_drvdata(glue->musb) returns a NULL pointer as long as the
      device is not fully probed.
      Tested-by: default avatarGeorge Cherian <george.cherian@ti.com>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      f042e9cb
    • Sebastian Andrzej Siewior's avatar
      usb: musb: dsps: start OTG timer on resume again · 53185b3a
      Sebastian Andrzej Siewior authored
      Commit 468bcc2a ("usb: musb: dsps: kill OTG timer on suspend") stopped
      the timer in suspend path but forgot the re-enable it in the resume
      path. This patch fixes the behaviour.
      
      Cc: <stable@vger.kernel.org> # v3.14+
      Fixes 468bcc2a "usb: musb: dsps: kill OTG timer on suspend"
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      53185b3a
    • Felipe Balbi's avatar
      usb: gadget: loopback: don't queue requests to bogus endpoints · e0857ce5
      Felipe Balbi authored
      A request allocated from e.g. ep1out cannot
      be queued to any other endpoint. This bug has
      been in f_loopback at least since mid-2011 and
      since nobody has really screamed about it, we're
      not backporting to any stable kernels.
      
      Debugged with MUSB since that's the only controller
      which complains about this case.
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      e0857ce5
    • David Cohen's avatar
      usb: ffs: fix regression when quirk_ep_out_aligned_size flag is set · c0d31b3c
      David Cohen authored
      The commit '2e4c7553 usb: gadget: f_fs: add aio support' broke the
      quirk implemented to align buffer size to maxpacketsize on out endpoint.
      As result, functionfs does not work on Intel platforms using dwc3 driver
      (i.e. Bay Trail and Merrifield). This patch fixes the issue.
      
      This code is based on a previous Qiuxu's patch.
      
      Fixes: 2e4c7553 (usb: gadget: f_fs: add aio support)
      Cc: <stable@vger.kernel.org> # v3.16+
      Signed-off-by: default avatarDavid Cohen <david.a.cohen@linux.intel.com>
      Signed-off-by: default avatarQiuxu Zhuo <qiuxu.zhuo@intel.com>
      Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      c0d31b3c
    • Robert Baldyga's avatar
      usb: gadget: f_fs: remove redundant ffs_data_get() · a3058a5d
      Robert Baldyga authored
      During FunctionFS bind, ffs_data_get() function was called twice
      (in functionfs_bind() and in ffs_do_functionfs_bind()), while on unbind
      ffs_data_put() was called once (in functionfs_unbind() function).
      In result refcount never reached value 0, and ffs memory resources has
      been never released.
      
      Since ffs_data_get() call in ffs_do_functionfs_bind() is redundant
      and not neccessary, we remove it to have equal number of gets ans puts,
      and free allocated memory after refcount reach 0.
      
      Fixes: 5920cda6 (usb: gadget: FunctionFS: convert to new function
      	interface with backward compatibility)
      Cc: <stable@vger.kernel.org> # v3.14+
      Signed-off-by: default avatarRobert Baldyga <r.baldyga@samsung.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      a3058a5d
    • Geert Uytterhoeven's avatar
      usb: gadget: udc: USB_GADGET_XILINX should depend on HAS_DMA · f1113be1
      Geert Uytterhoeven authored
      If NO_DMA=y:
      
      drivers/built-in.o: In function `xudc_done':
      udc-xilinx.c:(.text+0x54f4d2): undefined reference to `usb_gadget_unmap_request'
      drivers/built-in.o: In function `xudc_dma_send':
      udc-xilinx.c:(.text+0x54f9f8): undefined reference to `dma_sync_single_for_cpu'
      drivers/built-in.o: In function `xudc_read_fifo':
      udc-xilinx.c:(.text+0x54ff4a): undefined reference to `dma_sync_single_for_cpu'
      drivers/built-in.o: In function `xudc_ep_queue':
      udc-xilinx.c:(.text+0x550e7c): undefined reference to `usb_gadget_map_request'
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      f1113be1
    • Roger Quadros's avatar
      Revert "usb: dwc3: dwc3-omap: Disable/Enable only wrapper interrupts in prepare/complete" · b01ff5cb
      Roger Quadros authored
      This reverts commit 02dae36a.
      
      That commit is bogus in two ways:
      
      1) There's no way dwc3-omap's ->suspend() can cause any effect
      	on xhci's ->suspend(). Linux device driver model guarantees
      	that a parent's ->suspend() will only be called after all
      	children are suspended. dwc3-omap is the parent of the
      	parent of xhci.
      
      2) When implementing Deep Sleep states where context is lost,
      	USBOTGSS_IRQ0 register, well, looses context so we
      	_must_ rewrite it otherwise core IRQs will never be
      	reenabled and USB will appear to be dead.
      
      Fixes: 02dae36a (usb: dwc3: dwc3-omap: Disable/Enable only
      	wrapper interrupts in prepare/complete)
      Cc: <stable@vger.kernel.org> # v3.17
      Cc: George Cherian <george.cherian@ti.com>
      Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      b01ff5cb
    • Felipe Balbi's avatar
      usb: gadget: composite: enable BESL support · a6615937
      Felipe Balbi authored
      According to USB 2.0 ECN Errata for Link Power
      Management (USB2-LPM-Errata-final.pdf), BESL
      must be enabled if LPM is enabled.
      
      This helps with USB30CV TD 9.21 LPM L1
      Suspend Resume Test.
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      a6615937
    • Thomas Gleixner's avatar
      usb: musb: cppi41: restart hrtimer only if not yet done · d2e6d62c
      Thomas Gleixner authored
      commit c58d80f5 ("usb: musb: Ensure that cppi41 timer gets armed on
      premature DMA TX irq") fixed hrtimer scheduling bug. There is one left
      which does not trigger that often.
      The following scenario is still possible:
      
          lock(&x->lock);
          hrtimer_start(&x->t);
          unlock(&x->lock);
      
      expires:
          t->function();
                                      lock(&x->lock);
          lock(&x->lock);             if (!hrtimer_queued(&x->t))
                                              hrtimer_start(&x->t);
                                      unlock(&x->lock);
      
          if (!list_empty(x->early_tx_list))
                 ret = HRTIMER_RESTART;
      ->         hrtimer_forward_now(...)
          } else
                 ret = HRTIMER_NORESTART;
      
          unlock(&x->lock);
      
      and the timer callback returns HRTIMER_RESTART for an armed timer. This
      is wrong and we run into the BUG_ON() in __run_hrtimer().
      This can happens on SMP or PREEMPT-RT.
      The patch fixes the problem by only starting the timer if the timer is
      not yet queued.
      
      Cc: stable@vger.kernel.org
      Reported-by: default avatarTorben Hohn <torbenh@linutronix.de>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      [bigeasy: collected information and created a patch + description based
                on it]
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      d2e6d62c
    • Felipe Balbi's avatar
      usb: dwc3: ep0: fix Data Phase for transfer sizes aligned to wMaxPacketSize · 36f84ffb
      Felipe Balbi authored
      According to Section 8.5.3.2 of the USB 2.0 specification,
      a USB device must terminate a Data Phase with either a
      short packet or a ZLP (if the previous transfer was
      a multiple of wMaxPacketSize).
      
      For reference, here's what the USB 2.0 specification, section
      8.5.3.2 says:
      
      "
      8.5.3.2 Variable-length Data Stage
      
      A control pipe may have a variable-length data phase
      in which the host requests more data than is contained
      in the specified data structure. When all of the data
      structure is returned to the host, the function should
      indicate that the Data stage is ended by returning a
      packet that is shorter than the MaxPacketSize for the
      pipe. If the data structure is an exact multiple of
      wMaxPacketSize for the pipe, the function will return
      a zero-length packet to indicate the end of the Data
      stage.
      "
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      36f84ffb
    • Perry Hung's avatar
      usb: serial: ftdi_sio: add "bricked" FTDI device PID · 7f2719f0
      Perry Hung authored
      An official recent Windows driver from FTDI detects counterfeit devices
      and reprograms the internal EEPROM containing the USB PID to 0, effectively
      bricking the device.
      
      Add support for this VID/PID pair to correctly bind the driver on these
      devices.
      
      See:
      http://hackaday.com/2014/10/22/watch-that-windows-update-ftdi-drivers-are-killing-fake-chips/Signed-off-by: default avatarPerry Hung <iperry@gmail.com>
      Cc: stable <stable@vger.kernel.org>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      7f2719f0
  5. 22 Oct, 2014 5 commits
  6. 20 Oct, 2014 13 commits
    • Felipe Balbi's avatar
      usb: dwc3: ep0: return early on NULL requests · 6856d30c
      Felipe Balbi authored
      if our list of requests is empty, return early.
      
      There's really nothing to be done in case our
      request list is empty anyway because the only
      situation where we our list is empty, is when
      we're transferring ZLPs.
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      6856d30c
    • Alan Cox's avatar
      usb: dwc3: pci: Add PCI ID for Intel Braswell · 7d643664
      Alan Cox authored
      The device controller is the same but it has different PCI ID. Add this new
      ID to the driver's list of supported IDs.
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      7d643664
    • Felipe Balbi's avatar
      usb: gadget: function: f_obex: fix Interface Descriptor Test · 3985f3ab
      Felipe Balbi authored
      On USB20CV's Interface Descriptor Test, a series
      of SetInterface/GetInterface requests are issued
      and gadget driver is required to always return
      correct alternate setting.
      
      In one step of the test, g_serial with f_obex
      was returning the wrong value (1 instead of 0).
      
      In order to fix this, we will now hold currently
      selected alternate setting inside our struct f_obex
      and just return that from our ->get_alt()
      implementation.
      
      Note that his also simplifies the code a bit.
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      3985f3ab
    • Felipe Balbi's avatar
      usb: gadget: function: uac2: add a release method · de1e6e79
      Felipe Balbi authored
      devices are required to provide a release method. This
      patch fixes the following WARN():
      
      [   42.611159] ------------[ cut here ]------------
      [   42.616025] WARNING: CPU: 0 PID: 1453 at drivers/base/core.c:250 device_release+0x94/0xa0()
      [   42.624820] Device 'snd_uac2.0' does not have a release() function, it is broken and must be fixed.
      [   42.634328] Modules linked in: usb_f_uac2 g_audio(-) libcomposite configfs xhci_hcd snd_soc_davinci_mcasp snd_soc_edma snd_soc_tlv320aic3x snd_soc_omap snd_soc_evm snd_soc_core dwc3 snd_compress omapdrm snd_pcm_dmaengine snd_pcm snd_timer snd fb_sys_fops lis3lv02d_i2c matrix_keypad dwc3_omap lis3lv02d panel_dpi input_polldev soundcore
      [   42.665687] CPU: 0 PID: 1453 Comm: modprobe Tainted: G      D        3.17.0-rc6-00448-g9f3d0ec-dirty #188
      [   42.675756] [<c0017338>] (unwind_backtrace) from [<c0012fdc>] (show_stack+0x20/0x24)
      [   42.683911] [<c0012fdc>] (show_stack) from [<c0647fbc>] (dump_stack+0x8c/0xa4)
      [   42.691526] [<c0647fbc>] (dump_stack) from [<c0049950>] (warn_slowpath_common+0x7c/0xa0)
      [   42.700004] [<c0049950>] (warn_slowpath_common) from [<c00499b4>] (warn_slowpath_fmt+0x40/0x48)
      [   42.709194] [<c00499b4>] (warn_slowpath_fmt) from [<c0405f7c>] (device_release+0x94/0xa0)
      [   42.717794] [<c0405f7c>] (device_release) from [<c032e8e8>] (kobject_cleanup+0x4c/0x7c)
      [   42.726189] [<c032e8e8>] (kobject_cleanup) from [<c032e7c8>] (kobject_put+0x60/0x90)
      [   42.734316] [<c032e7c8>] (kobject_put) from [<c0406320>] (put_device+0x24/0x28)
      [   42.741995] [<c0406320>] (put_device) from [<c040c008>] (platform_device_unregister+0x2c/0x30)
      [   42.751061] [<c040c008>] (platform_device_unregister) from [<bf2b6b70>] (afunc_unbind+0x2c/0x68 [usb_f_uac2])
      [   42.761523] [<bf2b6b70>] (afunc_unbind [usb_f_uac2]) from [<bf29dbec>] (remove_config.isra.8+0xe8/0x100 [libcomposite])
      [   42.772868] [<bf29dbec>] (remove_config.isra.8 [libcomposite]) from [<bf29f9a4>] (__composite_unbind+0x48/0xb0 [libcomposite])
      [   42.784855] [<bf29f9a4>] (__composite_unbind [libcomposite]) from [<bf29fa28>] (composite_unbind+0x1c/0x20 [libcomposite])
      [   42.796446] [<bf29fa28>] (composite_unbind [libcomposite]) from [<c04d229c>] (usb_gadget_remove_driver+0x78/0xb0)
      [   42.807224] [<c04d229c>] (usb_gadget_remove_driver) from [<c04d2348>] (usb_gadget_unregister_driver+0x74/0xb8)
      [   42.817742] [<c04d2348>] (usb_gadget_unregister_driver) from [<bf29db00>] (usb_composite_unregister+0x1c/0x20 [libcomposite])
      [   42.829632] [<bf29db00>] (usb_composite_unregister [libcomposite]) from [<bf2b1084>] (audio_driver_exit+0x14/0x1c [g_audio])
      [   42.841430] [<bf2b1084>] (audio_driver_exit [g_audio]) from [<c00c0fe0>] (SyS_delete_module+0x120/0x1b0)
      [   42.851415] [<c00c0fe0>] (SyS_delete_module) from [<c000ed40>] (ret_fast_syscall+0x0/0x48)
      [   42.860075] ---[ end trace bb22e678d8d6db7b ]---
      root@saruman:~#
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      de1e6e79
    • Felipe Balbi's avatar
      usb: gadget: function: uac2: prevent double ep disable · f3bb7b29
      Felipe Balbi authored
      without this check, f_uac2 would try to disable
      the same endpoint twice. Fix that.
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      f3bb7b29
    • Felipe Balbi's avatar
      usb: gadget: function: uac2: add wMaxPacketSize to ep desc · 703a303c
      Felipe Balbi authored
      Endpoint descriptors should pass wMaxPacketSize. Note
      that this also fixes USB20CV Other Speed Endpoint
      Descriptor Tests.
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      703a303c
    • Felipe Balbi's avatar
      usb: gadget: function: uvc: disable endpoints on ->disable() · e3122f5f
      Felipe Balbi authored
      when our ->disable() method is called, we must
      make sure to teardown all our resources, including
      endpoints.
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      e3122f5f
    • Felipe Balbi's avatar
      usb: gadget: function: uvc: manage our video control endpoint · 62e37078
      Felipe Balbi authored
      just like any other endpoint, we must enable/disable
      our video control endpoint based on calls to our
      ->set_alt() method.
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      62e37078
    • Felipe Balbi's avatar
      usb: gadget: function: acm: make f_acm pass USB20CV Chapter9 · 52ec49a5
      Felipe Balbi authored
      During Halt Endpoint Test, our interrupt endpoint
      will be disabled, which will clear out ep->desc
      to NULL. Unless we call config_ep_by_speed() again,
      we will not be able to enable this endpoint which
      will make us fail that test.
      
      Fixes: f9c56cdd (usb: gadget: Clear usb_endpoint_descriptor
      	inside the struct usb_ep on disable)
      Cc: <stable@vger.kernel.org> # v3.4+
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      52ec49a5
    • Felipe Balbi's avatar
      usb: gadget: function: uvc: return correct alt-setting · e975be28
      Felipe Balbi authored
      If our alternate setting has been selected, we must
      return that on a subsequent Get Interface request
      even if we're not streaming.
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      e975be28
    • Felipe Balbi's avatar
      usb: gadget: function: uvc: make sure to balance ep enable/disable · c92bae75
      Felipe Balbi authored
      If a set_alt() to the same alternate setting that's
      already selected is received, functions are required
      to reset the interface state, this means we must disable
      all endpoints and reenable them again.
      
      This is also documented on our kdoc for struct usb_function
      
      * @set_alt: (REQUIRED) Reconfigures altsettings; function drivers may
      *	initialize usb_ep.driver data at this time (when it is used).
      *	Note that setting an interface to its current altsetting resets
      *	interface state, and that all interfaces have a disabled state.
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      c92bae75
    • Felipe Balbi's avatar
      usb: gadget: function: uvc: conditionally dequeue · d7577b38
      Felipe Balbi authored
      We shouldn't try to dequeue a NULL pointer.
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      d7577b38
    • Felipe Balbi's avatar
      usb: dwc3: gadget: fix set_halt() bug with pending transfers · 7a608559
      Felipe Balbi authored
      According to our Gadget Framework API documentation,
      ->set_halt() *must* return -EAGAIN if we have pending
      transfers (on either direction) or FIFO isn't empty (on
      TX endpoints).
      
      Fix this bug so that the mass storage gadget can be used
      without stall=0 parameter.
      
      This patch should be backported to all kernels since v3.2.
      
      Cc: <stable@vger.kernel.org> # v3.2+
      Suggested-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      7a608559