1. 19 Jul, 2022 10 commits
  2. 18 Jul, 2022 8 commits
  3. 16 Jul, 2022 13 commits
  4. 15 Jul, 2022 5 commits
  5. 13 Jul, 2022 4 commits
    • Maxime Ripard's avatar
      drm/vc4: v3d: Switch to devm_pm_runtime_enable · 887ddf32
      Maxime Ripard authored
      devm_pm_runtime_enable() simplifies the driver a bit since it will call
      pm_runtime_disable() automatically through a device-managed action.
      Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20220711173939.1132294-70-maxime@cerno.tech
      887ddf32
    • Maxime Ripard's avatar
      drm/vc4: v3d: Rework the runtime_pm setup · 266cff37
      Maxime Ripard authored
      At bind time, vc4_v3d_bind() will read a register to retrieve the v3d
      version and make sure it's a version we're compatible with.
      
      However, the v3d has an optional clock that is enabled only after the
      register read-out and a power domain that wasn't enabled at all in the bind
      implementation. This was working fine at boot because both were enabled,
      but resulted in the version check failing if we were unbinding and
      rebinding the driver because the unbinding would have turned them off.
      
      The fix isn't as easy as calling pm_runtime_resume_and_get() prior to the
      register access to power up the power domain though.
      
      Indeed, the runtime_resume implementation will enable the clock mentioned
      above, call vc4_v3d_init_hw() and then vc4_irq_enable().
      
      Prior to the previous patch, vc4_irq_enable() needed to occur after our
      call to platform_get_irq() and vc4_irq_install(), since vc4_irq_enable()
      used to call enable_irq() and vc4_irq_install() will call request_irq().
      
      vc4_irq_install() will also do some register access, so needs the power
      domain to be on. So we ended up in a situation where
      vc4_v3d_runtime_resume() needed vc4_irq_install() to have been called
      before, and vc4_irq_install() needed vc4_v3d_runtime_resume().
      
      The previous patch removed the enable_irq() call in vc4_irq_enable() and
      thus removed the dependency of vc4_v3d_runtime_resume() on
      vc4_irq_install().
      
      Thus, we can now rework our bind implementation to call
      pm_runtime_resume_and_get() before our register access to make sure the
      power domain is on. vc4_v3d_runtime_resume() also takes care of turning the
      clock on and calling vc4_v3d_init_hw() so we can remove them from bind.
      Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20220711173939.1132294-69-maxime@cerno.tech
      266cff37
    • Maxime Ripard's avatar
      drm/vc4: v3d: Stop disabling interrupts · 9b6f4615
      Maxime Ripard authored
      The vc4_irq_disable(), among other things, will call disable_irq() to
      complete any in-flight interrupts.
      
      This requires its counterpart, vc4_irq_enable(), to call enable_irq() which
      causes issues addressed in a later patch.
      
      However, vc4_irq_disable() is called by two callees: vc4_irq_uninstall()
      and vc4_v3d_runtime_suspend().
      
      vc4_irq_uninstall() also calls free_irq() which already disables the
      interrupt line. We thus don't require an explicit disable_irq() for that
      call site.
      
      vc4_v3d_runtime_suspend() doesn't have any other code. However, the rest of
      vc4_irq_disable() masks the interrupts coming from the v3d, so explictly
      disabling the interrupt line is also redundant.
      
      The only thing we really care about is thus to make sure we don't have any
      handler in-flight, as suggested by the comment. We can thus replace
      disable_irq() by synchronize_irq().
      Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20220711173939.1132294-68-maxime@cerno.tech
      9b6f4615
    • Maxime Ripard's avatar
      drm/vc4: perfmon: Add missing mutex_destroy · 57d68ee8
      Maxime Ripard authored
      vc4_perfmon_open_file() will instantiate a mutex for that file instance,
      but we never call mutex_destroy () in vc4_perfmon_close_file().
      
      Let's add that missing call.
      Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20220711173939.1132294-67-maxime@cerno.tech
      57d68ee8