1. 04 2月, 2019 3 次提交
  2. 01 2月, 2019 1 次提交
  3. 28 1月, 2019 4 次提交
  4. 14 1月, 2019 3 次提交
    • Z
      usb: dwc3: gadget: Fix the uninitialized link_state when udc starts · 88b1bb1f
      Zeng Tao 提交于
      Currently the link_state is uninitialized and the default value is 0(U0)
      before the first time we start the udc, and after we start the udc then
       stop the udc, the link_state will be undefined.
      We may have the following warnings if we start the udc again with
      an undefined link_state:
      
      WARNING: CPU: 0 PID: 327 at drivers/usb/dwc3/gadget.c:294 dwc3_send_gadget_ep_cmd+0x304/0x308
      dwc3 100e0000.hidwc3_0: wakeup failed --> -22
      [...]
      Call Trace:
      [<c010f270>] (unwind_backtrace) from [<c010b3d8>] (show_stack+0x10/0x14)
      [<c010b3d8>] (show_stack) from [<c034a4dc>] (dump_stack+0x84/0x98)
      [<c034a4dc>] (dump_stack) from [<c0118000>] (__warn+0xe8/0x100)
      [<c0118000>] (__warn) from [<c0118050>](warn_slowpath_fmt+0x38/0x48)
      [<c0118050>] (warn_slowpath_fmt) from [<c0442ec0>](dwc3_send_gadget_ep_cmd+0x304/0x308)
      [<c0442ec0>] (dwc3_send_gadget_ep_cmd) from [<c0445e68>](dwc3_ep0_start_trans+0x48/0xf4)
      [<c0445e68>] (dwc3_ep0_start_trans) from [<c0446750>](dwc3_ep0_out_start+0x64/0x80)
      [<c0446750>] (dwc3_ep0_out_start) from [<c04451c0>](__dwc3_gadget_start+0x1e0/0x278)
      [<c04451c0>] (__dwc3_gadget_start) from [<c04452e0>](dwc3_gadget_start+0x88/0x10c)
      [<c04452e0>] (dwc3_gadget_start) from [<c045ee54>](udc_bind_to_driver+0x88/0xbc)
      [<c045ee54>] (udc_bind_to_driver) from [<c045f29c>](usb_gadget_probe_driver+0xf8/0x140)
      [<c045f29c>] (usb_gadget_probe_driver) from [<bf005424>](gadget_dev_desc_UDC_store+0xac/0xc4 [libcomposite])
      [<bf005424>] (gadget_dev_desc_UDC_store [libcomposite]) from[<c023d8e0>] (configfs_write_file+0xd4/0x160)
      [<c023d8e0>] (configfs_write_file) from [<c01d51e8>] (__vfs_write+0x1c/0x114)
      [<c01d51e8>] (__vfs_write) from [<c01d5ff4>] (vfs_write+0xa4/0x168)
      [<c01d5ff4>] (vfs_write) from [<c01d6d40>] (SyS_write+0x3c/0x90)
      [<c01d6d40>] (SyS_write) from [<c0107400>] (ret_fast_syscall+0x0/0x3c)
      Signed-off-by: NZeng Tao <prime.zeng@hisilicon.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      88b1bb1f
    • J
      usb: dwc3: gadget: Clear req->needs_extra_trb flag on cleanup · bd674224
      Jack Pham 提交于
      OUT endpoint requests may somtimes have this flag set when
      preparing to be submitted to HW indicating that there is an
      additional TRB chained to the request for alignment purposes.
      If that request is removed before the controller can execute the
      transfer (e.g. ep_dequeue/ep_disable), the request will not go
      through the dwc3_gadget_ep_cleanup_completed_request() handler
      and will not have its needs_extra_trb flag cleared when
      dwc3_gadget_giveback() is called.  This same request could be
      later requeued for a new transfer that does not require an
      extra TRB and if it is successfully completed, the cleanup
      and TRB reclamation will incorrectly process the additional TRB
      which belongs to the next request, and incorrectly advances the
      TRB dequeue pointer, thereby messing up calculation of the next
      requeust's actual/remaining count when it completes.
      
      The right thing to do here is to ensure that the flag is cleared
      before it is given back to the function driver.  A good place
      to do that is in dwc3_gadget_del_and_unmap_request().
      
      Fixes: c6267a51 ("usb: dwc3: gadget: align transfers to wMaxPacketSize")
      Cc: stable@vger.kernel.org
      Signed-off-by: NJack Pham <jackp@codeaurora.org>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      bd674224
    • B
      usb: dwc3: gadget: synchronize_irq dwc irq in suspend · 01c10880
      Bo He 提交于
      We see dwc3 endpoint stopped by unwanted irq during
      suspend resume test, which is caused dwc3 ep can't be started
      with error "No Resource".
      
      Here, add synchronize_irq before suspend to sync the
      pending IRQ handlers complete.
      Signed-off-by: NBo He <bo.he@intel.com>
      Signed-off-by: NYu Wang <yu.y.wang@intel.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      01c10880
  5. 10 12月, 2018 1 次提交
    • T
      usb: dwc3: gadget: Disable CSP for stream OUT ep · 244add8e
      Tejas Joglekar 提交于
      In stream mode, when fast-forwarding TRBs, the stream number
      is not cleared causing the new stream to not get assigned. So
      we don't want controller to carry on transfers when short packet
      is received. So disable the CSP for stream capable endpoint.
      
      This is based on the 3.30a Programming guide, where table 3-1
      device descriptor structure field definitions says for CSP bit
      If this bit is 0, the controller generates an XferComplete event
      and remove the stream. So if we keep CSP as 1 then switching between
      streams would not happen as in stream mode, when fast-forwarding
      TRBs, the stream number is not cleared causing the new stream to not get
      assigned.
      Signed-off-by: NTejas Joglekar <joglekar@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      244add8e
  6. 05 12月, 2018 4 次提交
  7. 27 11月, 2018 1 次提交
    • F
      usb: dwc3: gadget: check if dep->frame_number is still valid · d5370106
      Felipe Balbi 提交于
      Gadget driver may take an unbounded amount of time to queue requests
      after XferNotReady. This is important for isochronous endpoints which
      need to be started for a specific (micro-)frame.
      
      If we fail to start a transfer for isochronous endpoint, let's try
      queueing to a future interval and see if that helps. We will stop trying
      if we fail a start transfer for 5 intervals in the future.
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      d5370106
  8. 26 11月, 2018 11 次提交
  9. 14 11月, 2018 1 次提交
  10. 06 11月, 2018 1 次提交
    • T
      usb: dwc3: gadget: Properly check last unaligned/zero chain TRB · ba3a51ac
      Thinh Nguyen 提交于
      Current check for the last extra TRB for zero and unaligned transfers
      does not account for isoc OUT. The last TRB of the Buffer Descriptor for
      isoc OUT transfers will be retired with HWO=0. As a result, we won't
      return early. The req->remaining will be updated to include the BUFSIZ
      count of the extra TRB, and the actual number of transferred bytes
      calculation will be wrong.
      
      To fix this, check whether it's a short or zero packet and the last TRB
      chain bit to return early.
      
      Fixes: c6267a51 ("usb: dwc3: gadget: align transfers to wMaxPacketSize")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NThinh Nguyen <thinhn@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      ba3a51ac
  11. 02 10月, 2018 1 次提交
  12. 05 9月, 2018 1 次提交
  13. 30 7月, 2018 1 次提交
  14. 21 5月, 2018 7 次提交