Skip to content
Snippets Groups Projects
  1. Oct 08, 2021
  2. Oct 04, 2021
  3. Aug 23, 2021
  4. Aug 16, 2021
  5. Aug 04, 2021
  6. Jun 18, 2021
  7. May 20, 2021
  8. Mar 16, 2021
  9. Mar 15, 2021
  10. Mar 12, 2021
    • Beata Michalska's avatar
      opp: Don't drop extra references to OPPs accidentally · 606a5d42
      Beata Michalska authored
      
      We are required to call dev_pm_opp_put() from outside of the
      opp_table->lock as debugfs removal needs to happen lock-less to avoid
      circular dependency issues.
      
      commit cf1fac94 ("opp: Reduce the size of critical section in
      _opp_kref_release()") tried to fix that introducing a new routine
      _opp_get_next() which keeps returning OPPs that can be freed by the
      callers and this routine shall be called without holding the
      opp_table->lock.
      
      Though the commit overlooked the fact that the OPPs can be referenced by
      other users as well and this routine will end up dropping references
      which were taken by other users and hence freeing the OPPs prematurely.
      
      In effect, other users of the OPPs will end up having invalid pointers
      at hand. We didn't see any crash reports earlier as the exact situation
      never happened, though it is certainly possible.
      
      We need a way to mark which OPPs are no longer referenced by the OPP
      core, so we don't drop extra references to them accidentally.
      
      This commit adds another OPP flag, "removed", which is used to track
      this. And now we should never end up dropping extra references to the
      OPPs.
      
      Cc: v5.11+ <stable@vger.kernel.org> # v5.11+
      Fixes: cf1fac94 ("opp: Reduce the size of critical section in _opp_kref_release()")
      Signed-off-by: default avatarBeata Michalska <beata.michalska@arm.com>
      [ Viresh: Almost rewrote entire patch, added new "removed" field,
      	  rewrote commit log and added the correct Fixes tag. ]
      Co-developed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      606a5d42
  11. Feb 18, 2021
    • Jonathan Marek's avatar
      opp: Don't skip freq update for different frequency · de04241a
      Jonathan Marek authored
      
      We skip the OPP update if the current and target OPPs are same. This is
      fine for the devices that don't support frequency but may cause issues
      for the ones that need to program frequency.
      
      An OPP entry doesn't really signify a single operating frequency but
      rather the highest frequency at which the other properties of the OPP
      entry apply. And we may reach here with different frequency values,
      while all of them would point to the same OPP entry in the OPP table.
      
      We just need to update the clock frequency in that case, though in order
      to not add special exit points we reuse the code flow from a normal
      path.
      
      While at it, rearrange the conditionals in the 'if' statement to check
      'enabled' flag at the end.
      
      Fixes: 81c4d8a3 ("opp: Keep track of currently programmed OPP")
      Signed-off-by: default avatarJonathan Marek <jonathan@marek.ca>
      [ Viresh: Improved commit log and subject, rename current_freq as
      	  current_rate, document it, remove local variable and rearrange
      	  code. ]
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      de04241a
  12. Feb 04, 2021
  13. Feb 02, 2021
Loading