1. 03 Sep, 2016 6 commits
  2. 02 Sep, 2016 1 commit
  3. 01 Sep, 2016 28 commits
  4. 31 Aug, 2016 5 commits
    • Felipe Balbi's avatar
      usb: dwc3: gadget: always cleanup all TRBs · 1bc6efe0
      Felipe Balbi authored
      [ Upstream commit 7c705dfe ]
      
      If we stop earlier due to short packet, we will
      not be able to giveback all TRBs.
      
      Cc: <stable@vger.kernel.org>
      Cc: Brian E Rogers <brian.e.rogers@intel.com>
      Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      1bc6efe0
    • Felipe Balbi's avatar
      usb: dwc3: gadget: fix for short pkts during chained xfers · de72ed19
      Felipe Balbi authored
      [ Upstream commit e5b36ae2 ]
      
      DWC3 has one interesting peculiarity with chained
      transfers. If we setup N chained transfers and we
      get a short packet before processing all N TRBs,
      DWC3 will (conditionally) issue a XferComplete or
      XferInProgress event and retire all TRBs from the
      one which got a short packet to the last without
      clearing their HWO bits.
      
      This means SW must clear HWO bit manually, which
      this patch is doing.
      
      Cc: <stable@vger.kernel.org>
      Cc: Brian E Rogers <brian.e.rogers@intel.com>
      Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      de72ed19
    • Felipe Balbi's avatar
      usb: dwc3: gadget: increment request->actual once · 9bf46c6c
      Felipe Balbi authored
      [ Upstream commit c7de5734 ]
      
      When using SG lists, we would end up setting
      request->actual to:
      
      	num_mapped_sgs * (request->length - count)
      
      Let's fix that up by incrementing request->actual
      only once.
      
      Cc: <stable@vger.kernel.org>
      Reported-by: default avatarBrian E Rogers <brian.e.rogers@intel.com>
      Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      9bf46c6c
    • Stefan Haberland's avatar
      s390/dasd: fix hanging device after clear subchannel · c68f2d57
      Stefan Haberland authored
      [ Upstream commit 9ba333dc ]
      
      When a device is in a status where CIO has killed all I/O by itself the
      interrupt for a clear request may not contain an irb to determine the
      clear function. Instead it contains an error pointer -EIO.
      This was ignored by the DASD int_handler leading to a hanging device
      waiting for a clear interrupt.
      
      Handle -EIO error pointer correctly for requests that are clear pending and
      treat the clear as successful.
      Signed-off-by: default avatarStefan Haberland <sth@linux.vnet.ibm.com>
      Reviewed-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      c68f2d57
    • Viresh Kumar's avatar
      usb: hub: Fix unbalanced reference count/memory leak/deadlocks · 64a45a08
      Viresh Kumar authored
      [ Upstream commit 6bb47e8a ]
      
      Memory leak and unbalanced reference count:
      
      If the hub gets disconnected while the core is still activating it, this
      can result in leaking memory of few USB structures.
      
      This will happen if we have done a kref_get() from hub_activate() and
      scheduled a delayed work item for HUB_INIT2/3. Now if hub_disconnect()
      gets called before the delayed work expires, then we will cancel the
      work from hub_quiesce(), but wouldn't do a kref_put(). And so the
      unbalance.
      
      kmemleak reports this as (with the commit e50293ef backported to
      3.10 kernel with other changes, though the same is true for mainline as
      well):
      
      unreferenced object 0xffffffc08af5b800 (size 1024):
        comm "khubd", pid 73, jiffies 4295051211 (age 6482.350s)
        hex dump (first 32 bytes):
          30 68 f3 8c c0 ff ff ff 00 a0 b2 2e c0 ff ff ff  0h..............
          01 00 00 00 00 00 00 00 00 94 7d 40 c0 ff ff ff  ..........}@....
        backtrace:
          [<ffffffc0003079ec>] create_object+0x148/0x2a0
          [<ffffffc000cc150c>] kmemleak_alloc+0x80/0xbc
          [<ffffffc000303a7c>] kmem_cache_alloc_trace+0x120/0x1ac
          [<ffffffc0006fa610>] hub_probe+0x120/0xb84
          [<ffffffc000702b20>] usb_probe_interface+0x1ec/0x298
          [<ffffffc0005d50cc>] driver_probe_device+0x160/0x374
          [<ffffffc0005d5308>] __device_attach+0x28/0x4c
          [<ffffffc0005d3164>] bus_for_each_drv+0x78/0xac
          [<ffffffc0005d4ee0>] device_attach+0x6c/0x9c
          [<ffffffc0005d42b8>] bus_probe_device+0x28/0xa0
          [<ffffffc0005d23a4>] device_add+0x324/0x604
          [<ffffffc000700fcc>] usb_set_configuration+0x660/0x6cc
          [<ffffffc00070a350>] generic_probe+0x44/0x84
          [<ffffffc000702914>] usb_probe_device+0x54/0x74
          [<ffffffc0005d50cc>] driver_probe_device+0x160/0x374
          [<ffffffc0005d5308>] __device_attach+0x28/0x4c
      
      Deadlocks:
      
      If the hub gets disconnected early enough (i.e. before INIT2/INIT3 are
      finished and the init_work is still queued), the core may call
      hub_quiesce() after acquiring interface device locks and it will wait
      for the work to be cancelled synchronously. But if the work handler is
      already running in parallel, it may try to acquire the same interface
      device lock and this may result in deadlock.
      
      Fix both the issues by removing the call to cancel_delayed_work_sync().
      
      CC: <stable@vger.kernel.org> #4.4+
      Fixes: e50293ef ("USB: fix invalid memory access in hub_activate()")
      Reported-by: default avatarManu Gautam <mgautam@codeaurora.org>
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
      64a45a08