lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <339a7a7b-af4e-d6a9-4b48-2a603ea10172@codeaurora.org>
Date:   Wed, 1 Apr 2020 18:10:18 +0530
From:   Maulik Shah <mkshah@...eaurora.org>
To:     Douglas Anderson <dianders@...omium.org>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>
Cc:     mka@...omium.org, Rajendra Nayak <rnayak@...eaurora.org>,
        evgreen@...omium.org, Lina Iyer <ilina@...eaurora.org>,
        swboyd@...omium.org, linux-arm-msm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [RFT PATCH v2 07/10] drivers: qcom: rpmh-rsc: Warning if
 tcs_write() used for non-active

Hi,

On 3/12/2020 4:43 AM, Douglas Anderson wrote:
> tcs_write() is documented to only be useful for writing
> RPMH_ACTIVE_ONLY_STATE.  Let's be loud if someone messes up.
>
> Signed-off-by: Douglas Anderson <dianders@...omium.org>
> ---
>
> Changes in v2: None
>
>   drivers/soc/qcom/rpmh-rsc.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
> index 93f5d1fb71ca..ba489d18c20e 100644
> --- a/drivers/soc/qcom/rpmh-rsc.c
> +++ b/drivers/soc/qcom/rpmh-rsc.c
> @@ -573,6 +573,12 @@ static int tcs_write(struct rsc_drv *drv, const struct tcs_request *msg)
>   	unsigned long flags;
>   	int ret;
>   
> +	/*
> +	 * It only makes sense to grab a whole TCS for ourselves if we're
> +	 * triggering right away, which we only do for ACTIVE_ONLY.
> +	 */
> +	WARN_ON(msg->state != RPMH_ACTIVE_ONLY_STATE);
> +

Unnecessary check, we will never hit this warning. Lets not add such check.

Saying that you can modify this change to drop below check  from 
rpmh_rsc_write_ctrl_data() as that never hit.

         /* Data sent to this API will not be sent immediately */
         if (msg->state == RPMH_ACTIVE_ONLY_STATE)
                 return -EINVAL;

we always call rpmh_rsc_write_ctrl_data() for RPMH_SLEEP_STATE and 
RPMH_WAKE_ONLY_STATE.

Thanks,
Maulik
>   	/* TODO: get_tcs_for_msg() can return -EAGAIN and nobody handles */
>   	tcs = get_tcs_for_msg(drv, msg);
>   	if (IS_ERR(tcs))

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ