1. 02 6月, 2021 1 次提交
    • J
      usb: dwc3: debugfs: Add and remove endpoint dirs dynamically · 5ff90af9
      Jack Pham 提交于
      The DWC3 DebugFS directory and files are currently created once
      during probe.  This includes creation of subdirectories for each
      of the gadget's endpoints.  This works fine for peripheral-only
      controllers, as dwc3_core_init_mode() calls dwc3_gadget_init()
      just prior to calling dwc3_debugfs_init().
      
      However, for dual-role controllers, dwc3_core_init_mode() will
      instead call dwc3_drd_init() which is problematic in a few ways.
      First, the initial state must be determined, then dwc3_set_mode()
      will have to schedule drd_work and by then dwc3_debugfs_init()
      could have already been invoked.  Even if the initial mode is
      peripheral, dwc3_gadget_init() happens after the DebugFS files
      are created, and worse so if the initial state is host and the
      controller switches to peripheral much later.  And secondly,
      even if the gadget endpoints' debug entries were successfully
      created, if the controller exits peripheral mode, its dwc3_eps
      are freed so the debug files would now hold stale references.
      
      So it is best if the DebugFS endpoint entries are created and
      removed dynamically at the same time the underlying dwc3_eps are.
      Do this by calling dwc3_debugfs_create_endpoint_dir() as each
      endpoint is created, and conversely remove the DebugFS entry when
      the endpoint is freed.
      
      Fixes: 41ce1456 ("usb: dwc3: core: make dwc3_set_mode() work properly")
      Reviewed-by: NPeter Chen <peter.chen@kernel.org>
      Signed-off-by: NJack Pham <jackp@codeaurora.org>
      Link: https://lore.kernel.org/r/20210529192932.22912-1-jackp@codeaurora.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5ff90af9
  2. 21 5月, 2021 1 次提交
  3. 10 5月, 2021 4 次提交
  4. 23 4月, 2021 1 次提交
  5. 22 4月, 2021 2 次提交
  6. 14 4月, 2021 2 次提交
  7. 02 4月, 2021 1 次提交
  8. 28 3月, 2021 2 次提交
  9. 26 3月, 2021 1 次提交
  10. 23 3月, 2021 5 次提交
  11. 18 3月, 2021 1 次提交
  12. 10 3月, 2021 1 次提交
  13. 09 2月, 2021 2 次提交
  14. 06 2月, 2021 5 次提交
  15. 14 1月, 2021 1 次提交
  16. 07 1月, 2021 1 次提交
  17. 04 1月, 2021 4 次提交
  18. 02 10月, 2020 5 次提交