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: <0faf621bd00847dc8f5776504faf0b223e8ae35c.camel@pengutronix.de>
Date: Mon, 18 Mar 2024 15:50:46 +0100
From: Philipp Zabel <p.zabel@...gutronix.de>
To: Ivan Bornyakov <brnkv.i1@...il.com>, Nas Chung
 <nas.chung@...psnmedia.com>,  Jackson Lee <jackson.lee@...psnmedia.com>,
 Mauro Carvalho Chehab <mchehab@...nel.org>
Cc: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski
	 <krzysztof.kozlowski+dt@...aro.org>, Conor Dooley <conor+dt@...nel.org>, 
	linux-media@...r.kernel.org, linux-kernel@...r.kernel.org, 
	devicetree@...r.kernel.org
Subject: Re: [PATCH 2/6] media: chips-media: wave5: support reset lines

Hi Ivan,

On Mo, 2024-03-18 at 17:42 +0300, Ivan Bornyakov wrote:
> Add initial support for optional reset lines. For now, simply deassert
> resets on driver probe and assert them back on driver remove.
> 
> Signed-off-by: Ivan Bornyakov <brnkv.i1@...il.com>
> ---
>  .../media/platform/chips-media/wave5/wave5-vpu.c    | 13 +++++++++++++
>  .../media/platform/chips-media/wave5/wave5-vpuapi.h |  1 +
>  2 files changed, 14 insertions(+)
> 
> diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> index 1b3df5b04249..f3ecadefd37a 100644
> --- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> @@ -10,6 +10,7 @@
>  #include <linux/clk.h>
>  #include <linux/firmware.h>
>  #include <linux/interrupt.h>
> +#include <linux/reset.h>
>  #include "wave5-vpu.h"
>  #include "wave5-regdefine.h"
>  #include "wave5-vpuconfig.h"
> @@ -151,6 +152,17 @@ static int wave5_vpu_probe(struct platform_device *pdev)
>  	dev_set_drvdata(&pdev->dev, dev);
>  	dev->dev = &pdev->dev;
>  
> +	dev->resets = devm_reset_control_array_get_optional_exclusive(&pdev->dev);
> +	if (IS_ERR(dev->resets)) {
> +		return dev_err_probe(&pdev->dev, PTR_ERR(dev->resets),
> +				     "Failed to get reset control\n");
> +	} else {
> +		ret = reset_control_deassert(dev->resets);
> +		if (ret)
> +			return dev_err_probe(&pdev->dev, ret,
> +					     "Failed to deassert resets\n");

This doesn't have to be in an else block, the error path above returns.

> +	}
> +
>  	ret = devm_clk_bulk_get_all(&pdev->dev, &dev->clks);

I'd expect the reset control to be asserted in the error path.


regards
Philipp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ