1. 13 3月, 2018 8 次提交
  2. 08 3月, 2018 1 次提交
  3. 12 2月, 2018 3 次提交
  4. 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
  5. 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
  6. 04 11月, 2017 1 次提交
  7. 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
  8. 15 8月, 2017 1 次提交
  9. 18 7月, 2017 1 次提交
  10. 24 1月, 2017 10 次提交
  11. 16 1月, 2017 1 次提交
  12. 12 1月, 2017 1 次提交
  13. 02 1月, 2017 1 次提交
    • M
      usb: dwc2: fix flags for DMA descriptor allocation in dwc2_hsotg_ep_enable · 86e881e7
      Marek Szyprowski 提交于
      dwc2_hsotg_ep_enable can be called from interrupt context, so all
      allocations should be done with GFP_ATOMIC flags. This fixes following
      issue on ARM architecture:
      
      [<c010d830>] (unwind_backtrace) from [<c010a51c>] (show_stack+0x10/0x14)
      [<c010a51c>] (show_stack) from [<c032930c>] (dump_stack+0x74/0x94)
      [<c032930c>] (dump_stack) from [<c011cd30>] (__warn+0xd4/0x100)
      [<c011cd30>] (__warn) from [<c011cd7c>] (warn_slowpath_null+0x20/0x28)
      [<c011cd7c>] (warn_slowpath_null) from [<c0187e04>] (smp_call_function_many+0xcc/0x2a4)
      [<c0187e04>] (smp_call_function_many) from [<c0188014>] (on_each_cpu_mask+0x38/0xa8)
      [<c0188014>] (on_each_cpu_mask) from [<c01ddfe0>] (start_isolate_page_range+0x134/0x1b8)
      [<c01ddfe0>] (start_isolate_page_range) from [<c01a3c14>] (alloc_contig_range+0xac/0x2f8)
      [<c01a3c14>] (alloc_contig_range) from [<c01de3e4>] (cma_alloc+0xe0/0x1a8)
      [<c01de3e4>] (cma_alloc) from [<c0110acc>] (__alloc_from_contiguous+0x38/0xe0)
      [<c0110acc>] (__alloc_from_contiguous) from [<c0110ba4>] (cma_allocator_alloc+0x30/0x38)
      [<c0110ba4>] (cma_allocator_alloc) from [<c0111034>] (__dma_alloc+0x1c0/0x2c8)
      [<c0111034>] (__dma_alloc) from [<c01111b4>] (arm_dma_alloc+0x3c/0x48)
      [<c01111b4>] (arm_dma_alloc) from [<c04ad800>] (dwc2_hsotg_ep_enable+0xec/0x46c)
      [<c04ad800>] (dwc2_hsotg_ep_enable) from [<c04da610>] (usb_ep_enable+0x2c/0x3c)
      [<c04da610>] (usb_ep_enable) from [<c04dc0c0>] (ecm_set_alt+0xa8/0x154)
      [<c04dc0c0>] (ecm_set_alt) from [<c04d678c>] (composite_setup+0xd74/0x1540)
      [<c04d678c>] (composite_setup) from [<c04ae048>] (dwc2_hsotg_complete_setup+0xb8/0x370)
      [<c04ae048>] (dwc2_hsotg_complete_setup) from [<c04d987c>] (usb_gadget_giveback_request+0xc/0x10)
      [<c04d987c>] (usb_gadget_giveback_request) from [<c04acafc>] (dwc2_hsotg_complete_request+0x78/0x128)
      [<c04acafc>] (dwc2_hsotg_complete_request) from [<c04aed28>] (dwc2_hsotg_epint+0x69c/0x81c)
      [<c04aed28>] (dwc2_hsotg_epint) from [<c04af6c4>] (dwc2_hsotg_irq+0xfc/0x748)
      [<c04af6c4>] (dwc2_hsotg_irq) from [<c0163264>] (__handle_irq_event_percpu+0x58/0x140)
      [<c0163264>] (__handle_irq_event_percpu) from [<c0163368>] (handle_irq_event_percpu+0x1c/0x58)
      [<c0163368>] (handle_irq_event_percpu) from [<c01633dc>] (handle_irq_event+0x38/0x5c)
      [<c01633dc>] (handle_irq_event) from [<c01666e4>] (handle_fasteoi_irq+0xc4/0x19c)
      [<c01666e4>] (handle_fasteoi_irq) from [<c0162a2c>] (generic_handle_irq+0x18/0x28)
      [<c0162a2c>] (generic_handle_irq) from [<c0162b40>] (__handle_domain_irq+0x6c/0xe4)
      [<c0162b40>] (__handle_domain_irq) from [<c0101470>] (gic_handle_irq+0x50/0x9c)
      [<c0101470>] (gic_handle_irq) from [<c010b00c>] (__irq_svc+0x6c/0xa8)
      
      Fixes: 5f54c54b ("usb: dwc2: gadget: Add DDMA chain pointers to
      	dwc2_hsotg_ep structure")
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      86e881e7
  14. 18 11月, 2016 8 次提交