1. 13 3月, 2018 11 次提交
  2. 08 3月, 2018 1 次提交
  3. 13 12月, 2017 1 次提交
    • D
      usb: dwc2: host: Don't retry NAKed transactions right away · 38d2b5fb
      Douglas Anderson 提交于
      On rk3288-veyron devices on Chrome OS it was found that plugging in an
      Arduino-based USB device could cause the system to lockup, especially
      if the CPU Frequency was at one of the slower operating points (like
      100 MHz / 200 MHz).
      
      Upon tracing, I found that the following was happening:
      * The USB device (full speed) was connected to a high speed hub and
        then to the rk3288.  Thus, we were dealing with split transactions,
        which is all handled in software on dwc2.
      * Userspace was initiating a BULK IN transfer
      * When we sent the SSPLIT (to start the split transaction), we got an
        ACK.  Good.  Then we issued the CSPLIT.
      * When we sent the CSPLIT, we got back a NAK.  We immediately (from
        the interrupt handler) started to retry and sent another SSPLIT.
      * The device kept NAKing our CSPLIT, so we kept ping-ponging between
        sending a SSPLIT and a CSPLIT, each time sending from the interrupt
        handler.
      * The handling of the interrupts was (because of the low CPU speed and
        the inefficiency of the dwc2 interrupt handler) was actually taking
        _longer_ than it took the other side to send the ACK/NAK.  Thus we
        were _always_ in the USB interrupt routine.
      * The fact that USB interrupts were always going off was preventing
        other things from happening in the system.  This included preventing
        the system from being able to transition to a higher CPU frequency.
      
      As I understand it, there is no requirement to retry super quickly
      after a NAK, we just have to retry sometime in the future.  Thus one
      solution to the above is to just add a delay between getting a NAK and
      retrying the transmission.  If this delay is sufficiently long to get
      out of the interrupt routine then the rest of the system will be able
      to make forward progress.  Even a 25 us delay would probably be
      enough, but we'll be extra conservative and try to delay 1 ms (the
      exact amount depends on HZ and the accuracy of the jiffy and how close
      the current jiffy is to ticking, but could be as much as 20 ms or as
      little as 1 ms).
      
      Presumably adding a delay like this could impact the USB throughput,
      so we only add the delay with repeated NAKs.
      
      NOTE: Upon further testing of a pl2303 serial adapter, I found that
      this fix may help with problems there.  Specifically I found that the
      pl2303 serial adapters tend to respond with a NAK when they have
      nothing to say and thus we end with this same sequence.
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Reviewed-by: NJulius Werner <jwerner@chromium.org>
      Tested-by: NStefan Wahren <stefan.wahren@i2se.com>
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      38d2b5fb
  4. 12 12月, 2017 1 次提交
  5. 11 12月, 2017 1 次提交
    • M
      usb: dwc2: Fix TxFIFOn sizes and total TxFIFO size issues · 9273083a
      Minas Harutyunyan 提交于
      In host mode reading from DPTXSIZn returning invalid value in
      dwc2_check_param_tx_fifo_sizes function.
      
      In total TxFIFO size calculations unnecessarily reducing by ep_info.
      hw->total_fifo_size can be fully allocated for FIFO's.
      
      Added num_dev_in_eps member in dwc2_hw_params structure to save number
      of IN EPs.
      
      Added g_tx_fifo_size array in dwc2_hw_params structure to store power
      on reset values of DPTXSIZn registers in forced device mode.
      
      Updated dwc2_hsotg_tx_fifo_count() function to get TxFIFO count from
      num_dev_in_eps.
      
      Updated dwc2_get_dev_hwparams() function to store DPTXFSIZn in
      g_tx_fifo_size array.
      
      dwc2_get_host/dev_hwparams() functions call moved after num_dev_in_eps
      set from hwcfg4.
      
      Modified dwc2_check_param_tx_fifo_sizes() function to check TxFIFOn
      sizes based on g_tx_fifo_size array.
      
      Removed ep_info subtraction during calculation of tx_addr_max in
      dwc2_hsotg_tx_fifo_total_depth() function. Also removed
      dwc2_hsotg_ep_info_size() function as no more need.
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NGevorg Sahakyan <sahakyan@synopsys.com>
      Signed-off-by: NMinas Harutyunyan <hminas@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      9273083a
  6. 04 11月, 2017 1 次提交
  7. 19 10月, 2017 1 次提交
  8. 11 4月, 2017 1 次提交
  9. 26 1月, 2017 1 次提交
  10. 24 1月, 2017 13 次提交
  11. 12 1月, 2017 1 次提交
  12. 18 11月, 2016 7 次提交