1. 18 6月, 2018 3 次提交
  2. 21 5月, 2018 2 次提交
  3. 15 5月, 2018 5 次提交
    • A
      usb: dwc2: Change reading of current frame number flow. · c7c24e7a
      Artur Petrosyan 提交于
      The current frame_number is read from core for both
      device and host modes. Reading of the current frame
      number needs to be performed ASAP due to IRQ latency's.
      This is why, it is moved to common interrupt handler.
      
      Accordingly updated dwc2_gadget_target_frame_elapsed()
      function which uses stored frame_number instead of
      reading frame number.
      
      In cases when target frame value is incremented
      the frame_number is required to read again.
      Signed-off-by: NArtur Petrosyan <arturp@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      c7c24e7a
    • A
      usb: dwc2: Fix crash in incomplete isoc intr handlers. · d5d5f079
      Artur Petrosyan 提交于
      Crash caused by going out of "eps_out" array range.
      Iteration on "eps_out" changed to less than "num_of_eps".
      Signed-off-by: NArtur Petrosyan <arturp@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      d5d5f079
    • G
      usb: dwc2: Add Interpacket Gap(IPG) feature support · b43ebc96
      Grigor Tovmasyan 提交于
      Added GHWCFG4_IPG_ISOC_SUPPORTED and DCFG_IPG_ISOC_SUPPORDED
      bits definitions to enable/disable IPG feature.
      
      Added ipg_isoc_en core parameter which will indicate IPG support
      enable/disable and initialize it.
      Signed-off-by: NGrigor Tovmasyan <tovmasya@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      b43ebc96
    • M
      usb: dwc2: Enable BNA interrupt for IN endpoints · 37981e00
      Minas Harutyunyan 提交于
      In DDMA mode required to enable BNA interrupt for
      both directions.
      Signed-off-by: NMinas Harutyunyan <hminas@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      37981e00
    • M
      usb: dwc2: Change ISOC DDMA flow · 729cac69
      Minas Harutyunyan 提交于
      Changed existing two descriptor-chain flow to one chain.
      
      In two-chain implementation BNA interrupt used for switching between
      two chains. BNA interrupt asserted because of returning to
      beginning of the chain based on L-bit of last descriptor.
      
      Because of that we lose packets. This issue resolved by using one
      desc-chain.
      
      Removed all staff related to two desc-chain flow from
      DDMA ISOC related functions.
      
      Removed request length checking from dwc2_gadget_fill_isoc_desc()
      function. Request length checking added to dwc2_hsotg_ep_queue()
      function. If request length greater than descriptor limits then
      request not added to queue. Additional checking done for High
      Bandwidth ISOC OUT's which not supported by driver. In
      dwc2_gadget_fill_isoc_desc() function also checked desc-chain
      status (full or not) to avoid of reusing not yet processed
      descriptors.
      
      In dwc2_gadget_start_isoc_ddma() function creation of desc-chain
      always started from descriptor 0. Before filling descriptors, they
      were initialized by HOST BUSY status.
      
      In dwc2_gadget_complete_isoc_request_ddma() added checking for
      desc-chain rollover. Also added checking completion status.
      Request completed successfully if DEV_DMA_STS is DEV_DMA_STS_SUCC,
      otherwise complete with actual=0. For systems with high IRQ latency
      added pointer compl_desc to next descriptor to be completed by
      XferCompl interrupt. This pointer replace descriptor index calculation
      based on DxEPDMA register. On descriptor completion interrupt
      processing all descriptors starting from compl_desc till descriptor
      which Buffer Status field not equal DMA_DONE status.
      
      Actually removed dwc2_gadget_start_next_isoc_ddma() function because
      now driver use only one desc-chain and instead that function added
      dwc2_gadget_handle_isoc_bna() function for handling BNA interrupts.
      
      Handling BNA interrupt done by flushing TxFIFOs for OUT EPs,
      completing request with actual=0 and resetting desc-chain number and
      target frame to initial values for restarting transfers.
      
      On handling NAK request completed with actual=0. Incremented target
      frame to allow fill desc chain and start transfers.
      In DDMA mode avoided of frame number incrementing, because tracking
      of frame number performed in dwc2_gadget_fill_isoc_desc() function.
      
      When core assert XferCompl along with BNA, we should ignore XferCompl
      in dwc2_hsotg_epint() function.
      
      On BNA interrupt replaced dwc2_gadget_start_next_isoc_ddma() by above
      mentioned BNA handler.
      
      In dwc2_hsotg_ep_enable() function added sanity check of bInterval
      for ISOC IN in DDMA mode, because HW doesn't supported EP's with
      bInterval more than 10 and check for mc for ISOC OUT transfers,
      because core doesn't support high bandwidth transfers.
      Signed-off-by: NMinas Harutyunyan <hminas@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      729cac69
  4. 25 4月, 2018 1 次提交
  5. 13 3月, 2018 17 次提交
  6. 08 3月, 2018 1 次提交
  7. 12 2月, 2018 3 次提交
  8. 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
  9. 07 11月, 2017 1 次提交
    • G
      USB: dwc2: Remove redundant license text · 6c2d03e8
      Greg Kroah-Hartman 提交于
      Now that the SPDX tag is in all USB files, that identifies the license
      in a specific and legally-defined manner.  So the extra GPL text wording
      can be removed as it is no longer needed at all.
      
      This is done on a quest to remove the 700+ different ways that files in
      the kernel describe the GPL license text.  And there's unneeded stuff
      like the address (sometimes incorrect) for the FSF which is never
      needed.
      
      No copyright headers or other non-license-description text was removed.
      
      Cc: John Youn <johnyoun@synopsys.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6c2d03e8
  10. 04 11月, 2017 1 次提交
  11. 24 10月, 2017 2 次提交
    • J
      usb: dwc2: Fix UDC state tracking · ce2b21a4
      John Stultz 提交于
      It has been noticed that the dwc2 udc state reporting doesn't
      seem to work (at least on HiKey boards). Where after the initial
      setup, the sysfs /sys/class/udc/f72c0000.usb/state file would
      report "configured" no matter the state of the OTG port.
      
      This patch adds a call so that we report to the UDC layer when
      the gadget device is disconnected.
      
      This patch does depend on the previous patch ("usb: dwc2:
      Improve gadget state disconnection handling") in this patch set
      in order to properly work.
      
      Cc: Wei Xu <xuwei5@hisilicon.com>
      Cc: Guodong Xu <guodong.xu@linaro.org>
      Cc: Amit Pundir <amit.pundir@linaro.org>
      Cc: YongQin Liu <yongqin.liu@linaro.org>
      Cc: John Youn <johnyoun@synopsys.com>
      Cc: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
      Cc: Douglas Anderson <dianders@chromium.org>
      Cc: Chen Yu <chenyu56@huawei.com>
      Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: linux-usb@vger.kernel.org
      Acked-by: NMinas Harutyunyan <hminas@synopsys.com>
      Tested-by: NMinas Harutyunyan <hminas@synopsys.com>
      Reported-by: NAmit Pundir <amit.pundir@linaro.org>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      ce2b21a4
    • J
      usb: dwc2: Error out of dwc2_hsotg_ep_disable() if we're in host mode · 9b481092
      John Stultz 提交于
      We've found that while in host mode, using Android, if one runs
      the command:
        stop adbd
      
      The existing usb devices being utilized in host mode are disconnected.
      This is most visible with usb networking devices.
      
      This seems to be due to adbd closing the file:
        /dev/usb-ffs/adb/ep0
      Which calls ffs_ep0_release() and the following backtrace:
      
      [<ffffff800875a430>] dwc2_hsotg_ep_disable+0x148/0x150
      [<ffffff800875a498>] dwc2_hsotg_udc_stop+0x60/0x110
      [<ffffff8008787950>] usb_gadget_remove_driver+0x58/0x78
      [<ffffff80087879e4>] usb_gadget_unregister_driver+0x74/0xe8
      [<ffffff80087850c0>] unregister_gadget+0x28/0x58
      [<ffffff800878511c>] unregister_gadget_item+0x2c/0x40
      [<ffffff8008790ea8>] ffs_data_clear+0xe8/0xf8
      [<ffffff8008790ed8>] ffs_data_reset+0x20/0x58
      [<ffffff8008793218>] ffs_data_closed+0x98/0xe8
      [<ffffff80087932d8>] ffs_ep0_release+0x20/0x30
      
      Then when dwc2_hsotg_ep_disable() is called, we call
      kill_all_requests() which causes a bunch of the following
      messages:
      
      dwc2 f72c0000.usb: Mode Mismatch Interrupt: currently in Host mode
      dwc2 f72c0000.usb: Mode Mismatch Interrupt: currently in Host mode
      dwc2 f72c0000.usb: Mode Mismatch Interrupt: currently in Host mode
      dwc2 f72c0000.usb: Mode Mismatch Interrupt: currently in Host mode
      dwc2 f72c0000.usb: Mode Mismatch Interrupt: currently in Host mode
      dwc2 f72c0000.usb: Mode Mismatch Interrupt: currently in Host mode
      dwc2 f72c0000.usb: Mode Mismatch Interrupt: currently in Host mode
      dwc2 f72c0000.usb: Mode Mismatch Interrupt: currently in Host mode
      init: Service 'adbd' (pid 1915) killed by signal 9
      init: Sending signal 9 to service 'adbd' (pid 1915) process group...
      init: Successfully killed process cgroup uid 0 pid 1915 in 0ms
      init: processing action (init.svc.adbd=stopped) from (/init.usb.configfs.rc:15)
      dwc2 f72c0000.usb: dwc2_hc_chhltd_intr_dma: Channel 8 - ChHltd set, but reason is unknown
      dwc2 f72c0000.usb: hcint 0x00000002, intsts 0x04200029
      dwc2 f72c0000.usb: dwc2_hc_chhltd_intr_dma: Channel 12 - ChHltd set, but reason is unknown
      dwc2 f72c0000.usb: hcint 0x00000002, intsts 0x04200029
      dwc2 f72c0000.usb: dwc2_hc_chhltd_intr_dma: Channel 15 - ChHltd set, but reason is unknown
      dwc2 f72c0000.usb: hcint 0x00000002, intsts 0x04200029
      dwc2 f72c0000.usb: dwc2_hc_chhltd_intr_dma: Channel 3 - ChHltd set, but reason is unknown
      dwc2 f72c0000.usb: hcint 0x00000002, intsts 0x04200029
      dwc2 f72c0000.usb: dwc2_hc_chhltd_intr_dma: Channel 4 - ChHltd set, but reason is unknown
      dwc2 f72c0000.usb: hcint 0x00000002, intsts 0x04200029
      dwc2 f72c0000.usb: dwc2_update_urb_state_abn(): trimming xfer length
      
      And the usb devices connected are basically hung at this point.
      
      It seems like if we're in host mode, we probably shouldn't run
      the dwc2_hostg_ep_disable logic, so this patch returns an error
      in that case.
      
      With this patch (along with the previous patch in this set), we avoid
      the mismatched interrupts and connected usb devices continue to function.
      
      I'm not sure if some other solution would be better here, but this seems
      to work, so I wanted to send it out for input on what the right approach
      should be.
      
      Cc: Wei Xu <xuwei5@hisilicon.com>
      Cc: Guodong Xu <guodong.xu@linaro.org>
      Cc: Amit Pundir <amit.pundir@linaro.org>
      Cc: YongQin Liu <yongqin.liu@linaro.org>
      Cc: John Youn <johnyoun@synopsys.com>
      Cc: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
      Cc: Douglas Anderson <dianders@chromium.org>
      Cc: Chen Yu <chenyu56@huawei.com>
      Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: linux-usb@vger.kernel.org
      Acked-by: NMinas Harutyunyan <hminas@synopsys.com>
      Tested-by: NMinas Harutyunyan <hminas@synopsys.com>
      Reported-by: NYongQin Liu <yongqin.liu@linaro.org>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      9b481092
  12. 15 8月, 2017 1 次提交
  13. 18 7月, 2017 1 次提交
  14. 24 1月, 2017 1 次提交