1. 22 Sep, 2015 9 commits
    • Mathias Nyman's avatar
      xhci: change xhci 1.0 only restrictions to support xhci 1.1 · dca77945
      Mathias Nyman authored
      Some changes between xhci 0.96 and xhci 1.0 specifications forced us to
      check the hci version in code, some of these checks were implemented as
      hci_version == 1.0, which will not work with new xhci 1.1 controllers.
      
      xhci 1.1 behaves similar to xhci 1.0 in these cases, so change these
      checks to hci_version >= 1.0
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dca77945
    • Roger Quadros's avatar
      usb: xhci: exit early in xhci_setup_device() if we're halted or dying · 448116bf
      Roger Quadros authored
      During quick plug/removal of OTG adapter during dual-role testing
      it can happen that xhci_alloc_device() is called for the newly
      detected device after the DRD library has called xhci_stop to
      remove the HCD.
      
      If that is the case, just fail early to prevent the following warning.
      
      [  154.732649] hub 4-0:1.0: USB hub found
      [  154.742204] hub 4-0:1.0: 1 port detected
      [  154.824458] hub 3-0:1.0: state 7 ports 1 chg 0002 evt 0000
      [  154.854609] hub 4-0:1.0: state 7 ports 1 chg 0000 evt 0000
      [  154.944430] usb 3-1: new high-speed USB device number 2 using xhci-hcd
      [  154.951009] xhci-hcd xhci-hcd.0.auto: xhci_setup_device
      [  155.038191] xhci-hcd xhci-hcd.0.auto: remove, state 4
      [  155.043315] usb usb4: USB disconnect, device number 1
      [  155.055270] xhci-hcd xhci-hcd.0.auto: xhci_stop
      [  155.060094] xhci-hcd xhci-hcd.0.auto: USB bus 4 deregistered
      [  155.066576] xhci-hcd xhci-hcd.0.auto: remove, state 1
      [  155.071710] usb usb3: USB disconnect, device number 1
      [  155.077124] xhci-hcd xhci-hcd.0.auto: xhci_setup_device
      [  155.082389] ------------[ cut here ]------------
      [  155.087690] WARNING: CPU: 0 PID: 72 at drivers/usb/host/xhci.c:3800 xhci_setup_device+0x410/0x484 [xhci_hcd]()
      [  155.097861] Modules linked in: sd_mod usb_storage scsi_mod usb_f_ss_lb g_zero libcomposite ipv6 xhci_plat_hcd xhci_hcd usbcore dwc3 udc_core evdev ti_am335x_adc joydev kfifo_buf industrialio snd_soc_simple_cc
      [  155.146734] CPU: 0 PID: 72 Comm: kworker/0:3 Tainted: G        W       4.1.4-00834-gcd9380b-dirty #50
      [  155.156073] Hardware name: Generic AM43 (Flattened Device Tree)
      [  155.162117] Workqueue: usb_hub_wq hub_event [usbcore]
      [  155.167249] Backtrace:
      [  155.169751] [<c0012af0>] (dump_backtrace) from [<c0012c8c>] (show_stack+0x18/0x1c)
      [  155.177390]  r6:c089d4a4 r5:ffffffff r4:00000000 r3:ee46c000
      [  155.183137] [<c0012c74>] (show_stack) from [<c05f7c14>] (dump_stack+0x84/0xd0)
      [  155.190446] [<c05f7b90>] (dump_stack) from [<c00439ac>] (warn_slowpath_common+0x80/0xbc)
      [  155.198605]  r7:00000009 r6:00000ed8 r5:bf27eb70 r4:00000000
      [  155.204348] [<c004392c>] (warn_slowpath_common) from [<c0043a0c>] (warn_slowpath_null+0x24/0x2c)
      [  155.213202]  r8:ee49f000 r7:ee7c0004 r6:00000000 r5:ee7c0158 r4:ee7c0000
      [  155.220051] [<c00439e8>] (warn_slowpath_null) from [<bf27eb70>] (xhci_setup_device+0x410/0x484 [xhci_hcd])
      [  155.229816] [<bf27e760>] (xhci_setup_device [xhci_hcd]) from [<bf27ec10>] (xhci_address_device+0x14/0x18 [xhci_hcd])
      [  155.240415]  r10:ee598200 r9:00000001 r8:00000002 r7:00000001 r6:00000003 r5:00000002
      [  155.248363]  r4:ee49f000
      [  155.250978] [<bf27ebfc>] (xhci_address_device [xhci_hcd]) from [<bf20cb94>] (hub_port_init+0x1b8/0xa9c [usbcore])
      [  155.261403] [<bf20c9dc>] (hub_port_init [usbcore]) from [<bf2101e0>] (hub_event+0x738/0x1020 [usbcore])
      [  155.270874]  r10:ee598200 r9:ee7c0000 r8:ee7c0038 r7:ee518800 r6:ee49f000 r5:00000001
      [  155.278822]  r4:00000000
      [  155.281426] [<bf20faa8>] (hub_event [usbcore]) from [<c005754c>] (process_one_work+0x128/0x340)
      [  155.290196]  r10:00000000 r9:00000003 r8:00000000 r7:fedfa000 r6:eeec5400 r5:ee598314
      [  155.298151]  r4:ee434380
      [  155.300718] [<c0057424>] (process_one_work) from [<c00578f8>] (worker_thread+0x158/0x49c)
      [  155.308963]  r10:ee434380 r9:00000003 r8:eeec5400 r7:00000008 r6:ee434398 r5:eeec5400
      [  155.316913]  r4:eeec5414
      [  155.319482] [<c00577a0>] (worker_thread) from [<c005cc40>] (kthread+0xdc/0xf8)
      [  155.326765]  r10:00000000 r9:00000000 r8:00000000 r7:c00577a0 r6:ee434380 r5:ee4441c0
      [  155.334713]  r4:00000000 r3:00000000
      [  155.338341] [<c005cb64>] (kthread) from [<c000fc08>] (ret_from_fork+0x14/0x2c)
      [  155.345626]  r7:00000000 r6:00000000 r5:c005cb64 r4:ee4441c0
      [  155.356108] ---[ end trace a58d34c223b190e6 ]---
      [  155.360783] xhci-hcd xhci-hcd.0.auto: Virt dev invalid for slot_id 0x1!
      [  155.574404] xhci-hcd xhci-hcd.0.auto: xhci_setup_device
      [  155.579667] ------------[ cut here ]------------
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      448116bf
    • Roger Quadros's avatar
      usb: xhci: stop everything on the first call to xhci_stop · 8c24d6d7
      Roger Quadros authored
      xhci_stop will be called twice, once for the shared hcd
      and again for the primary hcd.
      
      We stop the XHCI controller in any case so clean up
      everything on the first call else we can timeout
      waiting for pending requests to complete.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8c24d6d7
    • Roger Quadros's avatar
      usb: xhci: Clear XHCI_STATE_DYING on start · e5bfeab0
      Roger Quadros authored
      For whatever reason if XHCI died in the previous instant
      then it will never recover on the next xhci_start unless we
      clear the DYING flag.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e5bfeab0
    • Roger Quadros's avatar
      usb: xhci: lock mutex on xhci_stop · 85ac90f8
      Roger Quadros authored
      Else it races with xhci_setup_device
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      85ac90f8
    • Tomer Barletz's avatar
      xhci: Move xhci_pme_quirk() behind #ifdef CONFIG_PM · 2b7627b7
      Tomer Barletz authored
      xhci_pme_quirk() is only used when CONFIG_PM is defined.
      Compiling a kernel without PM complains about this function
      
      [reworded commit message -Mathias]
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTomer Barletz <barletz@gmail.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2b7627b7
    • Mathias Nyman's avatar
      xhci: give command abortion one more chance before killing xhci · a6809ffd
      Mathias Nyman authored
      We want to give the command abortion an additional try to stop
      the command ring before we completely hose xhci.
      
      Cc: <stable@vger.kernel.org>
      Tested-by: default avatarVincent Pelletier <plr.vincent@gmail.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a6809ffd
    • Mathias Nyman's avatar
      usb: Use the USB_SS_MULT() macro to get the burst multiplier. · ff30cbc8
      Mathias Nyman authored
      Bits 1:0 of the bmAttributes are used for the burst multiplier.
      The rest of the bits used to be reserved (zero), but USB3.1 takes bit 7
      into use.
      
      Use the existing USB_SS_MULT() macro instead to make sure the mult value
      and hence max packet calculations are correct for USB3.1 devices.
      
      Note that burst multiplier in bmAttributes is zero based and that
      the USB_SS_MULT() macro adds one.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ff30cbc8
    • Greg Kroah-Hartman's avatar
      Merge tag 'fixes-for-v4.3-rc3' of... · 01f4fd2a
      Greg Kroah-Hartman authored
      Merge tag 'fixes-for-v4.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus
      
      Felipe writes:
      
      usb: fixes for v4.3-rc3
      
      Here's the second pull request for current -rc cycle.
      
      A few fixes on dummy_hcd which have been around for
      longer than they should be.
      
      MUSB got a couple fixes, the most important of which
      is a fix to DMA channel teardown on AM335x devices.
      
      And DWC3 got a minor fix for when using RT-enabled
      kernels.
      01f4fd2a
  2. 21 Sep, 2015 10 commits
  3. 18 Sep, 2015 1 commit
  4. 17 Sep, 2015 2 commits
  5. 16 Sep, 2015 1 commit
  6. 15 Sep, 2015 3 commits
    • Nathan Sullivan's avatar
      Documentation: bindings: add doc for zynq USB · c1ceb5ff
      Nathan Sullivan authored
      Document the binding for the zynq specific chipidea UDC binding.
      Signed-off-by: default avatarNathan Sullivan <nathan.sullivan@ni.com>
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      c1ceb5ff
    • Nathan Sullivan's avatar
      usb: chipidea: add xilinx zynq platform data · 84bc70f9
      Nathan Sullivan authored
      Due to having hardware tx buffers less than 512 bytes in size, streaming
      must be enabled on the Zynq for the udc to work at all.  Add platform data
      specific to the Zynq udc, which does not set the CI_HDRC_DISABLE_STREAMING
      flag.
      
      Based on a patch by the same name from the Xilinx vendor tree.
      Signed-off-by: default avatarNathan Sullivan <nathan.sullivan@ni.com>
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      84bc70f9
    • Peter Chen's avatar
      usb: chipidea: udc: using the correct stall implementation · 56ffa1d1
      Peter Chen authored
      According to spec, there are functional and protocol stalls.
      
      For functional stall, it is for bulk and interrupt endpoints,
      below are cases for it:
      - Host sends SET_FEATURE request for Set-Halt, the udc driver
      needs to set stall, and return true unconditionally.
      - The gadget driver may call usb_ep_set_halt to stall certain
      endpoints, if there is a transfer in pending, the udc driver
      should not set stall, and return -EAGAIN accordingly.
      These two kinds of stall need to be cleared by host using CLEAR_FEATURE
      request (Clear-Halt).
      
      For protocol stall, it is for control endpoint, this stall will
      be set if the control request has failed. This stall will be
      cleared by next setup request (hardware will do it).
      
      It fixed usbtest (drivers/usb/misc/usbtest.c) Test 13 "set/clear halt"
      test failure, meanwhile, this change has been verified by
      USB2 CV Compliance Test and MSC Tests.
      
      Cc: <stable@vger.kernel.org> #3.10+
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Felipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      56ffa1d1
  7. 14 Sep, 2015 9 commits
  8. 12 Sep, 2015 5 commits
    • Linus Torvalds's avatar
      Linux 4.3-rc1 · 6ff33f39
      Linus Torvalds authored
      6ff33f39
    • Linus Torvalds's avatar
      Merge tag 'cris-for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/jesper/cris · 6917b51d
      Linus Torvalds authored
      Pull CRIS updates from Jesper Nilsson:
       "Mostly removal of old cruft of which we can use a generic version, or
        fixes for code not commonly run in the cris port, but also additions
        to enable some good debug"
      
      * tag 'cris-for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/jesper/cris: (25 commits)
        CRISv10: delete unused lib/dmacopy.c
        CRISv10: delete unused lib/old_checksum.c
        CRIS: fix switch_mm() lockdep splat
        CRISv32: enable LOCKDEP_SUPPORT
        CRIS: add STACKTRACE_SUPPORT
        CRISv32: annotate irq enable in idle loop
        CRISv32: add support for irqflags tracing
        CRIS: UAPI: use generic types.h
        CRIS: UAPI: use generic shmbuf.h
        CRIS: UAPI: use generic msgbuf.h
        CRIS: UAPI: use generic socket.h
        CRIS: UAPI: use generic sembuf.h
        CRIS: UAPI: use generic sockios.h
        CRIS: UAPI: use generic auxvec.h
        CRIS: UAPI: use generic headers via Kbuild
        CRIS: UAPI: fix elf.h export
        CRIS: don't make asm/elf.h depend on asm/user.h
        CRIS: UAPI: fix ptrace.h
        CRISv32: Squash compile warnings for axisflashmap
        CRISv32: Add GPIO driver to the default configs
        ...
      6917b51d
    • Linus Torvalds's avatar
      blk: rq_data_dir() should not return a boolean · 10fbd36e
      Linus Torvalds authored
      rq_data_dir() returns either READ or WRITE (0 == READ, 1 == WRITE), not
      a boolean value.
      
      Now, admittedly the "!= 0" doesn't really change the value (0 stays as
      zero, 1 stays as one), but it's not only redundant, it confuses gcc, and
      causes gcc to warn about the construct
      
          switch (rq_data_dir(req)) {
              case READ:
                  ...
              case WRITE:
                  ...
      
      that we have in a few drivers.
      
      Now, the gcc warning is silly and stupid (it seems to warn not about the
      switch value having a different type from the case statements, but about
      _any_ boolean switch value), but in this case the code itself is silly
      and stupid too, so let's just change it, and get rid of warnings like
      this:
      
        drivers/block/hd.c: In function ‘hd_request’:
        drivers/block/hd.c:630:11: warning: switch condition has boolean value [-Wswitch-bool]
           switch (rq_data_dir(req)) {
      
      The odd '!= 0' came in when "cmd_flags" got turned into a "u64" in
      commit 5953316d ("block: make rq->cmd_flags be 64-bit") and is
      presumably because the old code (that just did a logical 'and' with 1)
      would then end up making the type of rq_data_dir() be u64 too.
      
      But if we want to retain the old regular integer type, let's just cast
      the result to 'int' rather than use that rather odd '!= 0'.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      10fbd36e
    • Linus Torvalds's avatar
      Merge branch 'writeback-plugging' · e1df8b0a
      Linus Torvalds authored
      Fix up the writeback plugging introduced in commit d353d758
      ("writeback: plug writeback at a high level") that then caused problems
      due to the unplug happening with a spinlock held.
      
      * writeback-plugging:
        writeback: plug writeback in wb_writeback() and writeback_inodes_wb()
        Revert "writeback: plug writeback at a high level"
      e1df8b0a
    • Linus Torvalds's avatar
      writeback: plug writeback in wb_writeback() and writeback_inodes_wb() · 505a666e
      Linus Torvalds authored
      We had to revert the pluggin in writeback_sb_inodes() because the
      wb->list_lock is held, but we could easily plug at a higher level before
      taking that lock, and unplug after releasing it.  This does that.
      
      Chris will run performance numbers, just to verify that this approach is
      comparable to the alternative (we could just drop and re-take the lock
      around the blk_finish_plug() rather than these two commits.
      
      I'd have preferred waiting for actual performance numbers before picking
      one approach over the other, but I don't want to release rc1 with the
      known "sleeping function called from invalid context" issue, so I'll
      pick this cleanup version for now.  But if the numbers show that we
      really want to plug just at the writeback_sb_inodes() level, and we
      should just play ugly games with the spinlock, we'll switch to that.
      
      Cc: Chris Mason <clm@fb.com>
      Cc: Josef Bacik <jbacik@fb.com>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      505a666e