Commit e40b0c16 authored by Douglas Anderson's avatar Douglas Anderson Committed by Bjorn Andersson

soc: qcom: rpmh-rsc: A lot of comments

I've been pouring through the rpmh-rsc code and trying to understand
it.  Document everything to the best of my ability.  All documentation
here is strictly from code analysis--no actual knowledge of the
hardware was used.  If something is wrong in here I either
misunderstood the code, had a typo, or the code has a bug in it
leading to my incorrect understanding.

In a few places here I have documented things that don't make tons of
sense.  A future patch will try to address this.  While this means I'm
adding comments / todos and then later fixing them in the series, it
seemed more urgent to get things documented first so that people could
understand the later patches.

Any comments I adjusted I also tried to make match kernel-doc better.
Specifically:
- kernel-doc says do not leave a blank line between the function
  description and the arguments
- kernel-doc examples always have things starting w/ a capital and
  ending with a period.

This should be a no-op.  It's just comment changes.
Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
Reviewed-by: default avatarMaulik Shah <mkshah@codeaurora.org>
Reviewed-by: default avatarStephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20200413100321.v4.6.I52653eb85d7dc8981ee0dafcd0b6cc0f273e9425@changeidSigned-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent 1bc92a93
...@@ -22,15 +22,24 @@ struct rsc_drv; ...@@ -22,15 +22,24 @@ struct rsc_drv;
* struct tcs_group: group of Trigger Command Sets (TCS) to send state requests * struct tcs_group: group of Trigger Command Sets (TCS) to send state requests
* to the controller * to the controller
* *
* @drv: the controller * @drv: The controller.
* @type: type of the TCS in this group - active, sleep, wake * @type: Type of the TCS in this group - active, sleep, wake.
* @mask: mask of the TCSes relative to all the TCSes in the RSC * @mask: Mask of the TCSes relative to all the TCSes in the RSC.
* @offset: start of the TCS group relative to the TCSes in the RSC * @offset: Start of the TCS group relative to the TCSes in the RSC.
* @num_tcs: number of TCSes in this type * @num_tcs: Number of TCSes in this type.
* @ncpt: number of commands in each TCS * @ncpt: Number of commands in each TCS.
* @lock: lock for synchronizing this TCS writes * @lock: Lock for synchronizing this TCS writes.
* @req: requests that are sent from the TCS * @req: Requests that are sent from the TCS; only used for ACTIVE_ONLY
* @slots: indicates which of @cmd_addr are occupied * transfers (could be on a wake/sleep TCS if we are borrowing for
* an ACTIVE_ONLY transfer).
* Start: grab drv->lock, set req, set tcs_in_use, drop drv->lock,
* trigger
* End: get irq, access req,
* grab drv->lock, clear tcs_in_use, drop drv->lock
* @slots: Indicates which of @cmd_addr are occupied; only used for
* SLEEP / WAKE TCSs. Things are tightly packed in the
* case that (ncpt < MAX_CMDS_PER_TCS). That is if ncpt = 2 and
* MAX_CMDS_PER_TCS = 16 then bit[2] = the first bit in 2nd TCS.
*/ */
struct tcs_group { struct tcs_group {
struct rsc_drv *drv; struct rsc_drv *drv;
...@@ -82,19 +91,28 @@ struct rpmh_ctrlr { ...@@ -82,19 +91,28 @@ struct rpmh_ctrlr {
* struct rsc_drv: the Direct Resource Voter (DRV) of the * struct rsc_drv: the Direct Resource Voter (DRV) of the
* Resource State Coordinator controller (RSC) * Resource State Coordinator controller (RSC)
* *
* @name: Controller identifier * @name: Controller identifier.
* @tcs_base: Start address of the TCS registers in this controller * @tcs_base: Start address of the TCS registers in this controller.
* @id: Instance id in the controller (Direct Resource Voter) * @id: Instance id in the controller (Direct Resource Voter).
* @num_tcs: Number of TCSes in this DRV * @num_tcs: Number of TCSes in this DRV.
* @rsc_pm: CPU PM notifier for controller * @rsc_pm: CPU PM notifier for controller.
* Used when solver mode is not present * Used when solver mode is not present.
* @cpus_entered_pm: CPU mask for cpus in idle power collapse * @cpus_entered_pm: CPU mask for cpus in idle power collapse.
* Used when solver mode is not present * Used when solver mode is not present.
* @tcs: TCS groups * @tcs: TCS groups.
* @tcs_in_use: S/W state of the TCS * @tcs_in_use: S/W state of the TCS; only set for ACTIVE_ONLY
* @lock: Synchronize state of the controller * transfers, but might show a sleep/wake TCS in use if
* @pm_lock: Synchronize during PM notifications * it was borrowed for an active_only transfer. You
* Used when solver mode is not present * must hold both the lock in this struct and the
* tcs_lock for the TCS in order to mark a TCS as
* in-use, but you only need the lock in this structure
* (aka the drv->lock) to mark one freed.
* @lock: Synchronize state of the controller. If you will be
* grabbing this lock and a tcs_lock at the same time,
* grab the tcs_lock first so we always have a
* consistent lock ordering.
* @pm_lock: Synchronize during PM notifications.
* Used when solver mode is not present.
* @client: Handle to the DRV's client. * @client: Handle to the DRV's client.
*/ */
struct rsc_drv { struct rsc_drv {
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment