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: <20230925083425.GB8583@pendragon.ideasonboard.com>
Date:   Mon, 25 Sep 2023 11:34:25 +0300
From:   Laurent Pinchart <laurent.pinchart@...asonboard.com>
To:     Bryan O'Donoghue <bryan.odonoghue@...aro.org>
Cc:     rfoss@...nel.org, todor.too@...il.com, agross@...nel.org,
        andersson@...nel.org, konrad.dybcio@...aro.org, mchehab@...nel.org,
        hverkuil-cisco@...all.nl, sakari.ailus@...ux.intel.com,
        andrey.konovalov@...aro.org, linux-media@...r.kernel.org,
        linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 09/17] media: qcom: camss: Remove special case for VFE
 get/put

Hi Bryan,

Thank you for the patch.

On Mon, Sep 11, 2023 at 02:14:03PM +0100, Bryan O'Donoghue wrote:
> From sdm845 onwards we need to ensure the VFE is powered on prior to
> switching on the CSID.
> 
> Currently the code tests for sdm845, sm8250 and then does get/set. This is
> not extensible and it turns out is not necessary either since vfe_get and
> vfe_set reference count.
> 
> Remove the over-conservative SoC version check.
> 
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@...aro.org>
> Suggested-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
> Tested-by: Bryan O'Donoghue <bryan.odonoghue@...aro.org> # rb3 # db410c
> ---
>  drivers/media/platform/qcom/camss/camss-csid.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
> index 99f651e2021cb..02ae3f5cb0c0e 100644
> --- a/drivers/media/platform/qcom/camss/camss-csid.c
> +++ b/drivers/media/platform/qcom/camss/camss-csid.c
> @@ -159,15 +159,12 @@ static int csid_set_power(struct v4l2_subdev *sd, int on)
>  	struct camss *camss = csid->camss;
>  	struct device *dev = camss->dev;
>  	struct vfe_device *vfe = &camss->vfe[csid->id];
> -	u32 version = camss->res->version;
>  	int ret = 0;
>  
>  	if (on) {
> -		if (version == CAMSS_8250 || version == CAMSS_845) {
> -			ret = vfe_get(vfe);
> -			if (ret < 0)
> -				return ret;
> -		}

Maybe a comment to explain why we call vfe_get() could be useful ?

		/*
		 * From SDM845 onwards, the VFE needs to be powered on before
		 * switching on the CSID. Do so unconditionally, as there is no
		 * drawback in following the same powering order on older SoCs.
		 */

Reviewed-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>

> +		ret = vfe_get(vfe);
> +		if (ret < 0)
> +			return ret;
>  
>  		ret = pm_runtime_resume_and_get(dev);
>  		if (ret < 0)
> @@ -217,8 +214,7 @@ static int csid_set_power(struct v4l2_subdev *sd, int on)
>  		regulator_bulk_disable(csid->num_supplies,
>  				       csid->supplies);
>  		pm_runtime_put_sync(dev);
> -		if (version == CAMSS_8250 || version == CAMSS_845)
> -			vfe_put(vfe);
> +		vfe_put(vfe);
>  	}
>  
>  	return ret;

-- 
Regards,

Laurent Pinchart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ