[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <155122856693.260864.16771523196413005158@swboyd.mtv.corp.google.com>
Date: Tue, 26 Feb 2019 16:49:26 -0800
From: Stephen Boyd <swboyd@...omium.org>
To: "Raju P.L.S.S.S.N" <rplsssn@...eaurora.org>, andy.gross@...aro.org,
david.brown@...aro.org, linux-arm-msm@...r.kernel.org,
linux-soc@...r.kernel.org
Cc: rnayak@...eaurora.org, bjorn.andersson@...aro.org,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
evgreen@...omium.org, dianders@...omium.org, mka@...omium.org,
ilina@...eaurora.org,
"Raju P . L . S . S . S . N" <rplsssn@...eaurora.org>
Subject: Re: [PATCH RESEND v3 2/3] drivers: qcom: rpmh-rsc: return if the controller is idle
Quoting Raju P.L.S.S.S.N (2019-02-21 04:18:26)
> diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
> index d6b834eeeb37..9cc303e88a06 100644
> --- a/drivers/soc/qcom/rpmh-rsc.c
> +++ b/drivers/soc/qcom/rpmh-rsc.c
> @@ -524,6 +524,30 @@ static int tcs_ctrl_write(struct rsc_drv *drv, const struct tcs_request *msg)
> return ret;
> }
>
> +/**
> + * rpmh_rsc_ctrlr_is_idle: Check if any of the AMCs are busy.
> + *
> + * @drv: The controller
> + *
> + * Returns true if the TCSes are engaged in handling requests.
> + */
> +bool rpmh_rsc_ctrlr_is_idle(struct rsc_drv *drv)
> +{
This API seems inherently racy. How do we know that nothing else is
going to be inserted into the TCS after this function returns true? Do
you have a user of this API? It would be good to know how it is used
instead of adding some code that never gets called.
> + int m;
> + struct tcs_group *tcs = get_tcs_of_type(drv, ACTIVE_TCS);
> +
> + spin_lock(&drv->lock);
> + for (m = tcs->offset; m < tcs->offset + tcs->num_tcs; m++) {
> + if (!tcs_is_free(drv, m)) {
> + spin_unlock(&drv->lock);
> + return false;
> + }
> + }
> + spin_unlock(&drv->lock);
> +
> + return true;
> +}
> +
> /**
> * rpmh_rsc_write_ctrl_data: Write request to the controller
> *
Powered by blists - more mailing lists