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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 27 Sep 2021 17:29:07 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Nikita Yushchenko <nikita.yoush@...entembedded.com>
Cc:     Lee Jones <lee.jones@...aro.org>, linux-staging@...ts.linux.dev,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: most: dim2: force fcnt=3 on Renesas GEN3

On Tue, Sep 21, 2021 at 07:51:30PM +0300, Nikita Yushchenko wrote:
> Per Renesas datasheet, MLBC0 register's fcnt field in the embedded
> dim2 module must be never set to value different from 3.
> 
> Enforce that, via an optional field in struct dim2_platform_data.
> 
> Signed-off-by: Nikita Yushchenko <nikita.yoush@...entembedded.com>
> ---
>  drivers/staging/most/dim2/dim2.c | 25 +++++++++++++++++++------
>  1 file changed, 19 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/most/dim2/dim2.c b/drivers/staging/most/dim2/dim2.c
> index 093ef9a2b291..d90284d79621 100644
> --- a/drivers/staging/most/dim2/dim2.c
> +++ b/drivers/staging/most/dim2/dim2.c
> @@ -108,6 +108,7 @@ struct dim2_hdm {
>  struct dim2_platform_data {
>  	int (*enable)(struct platform_device *pdev);
>  	void (*disable)(struct platform_device *pdev);
> +	u8 fcnt;
>  };
>  
>  #define iface_to_hdm(iface) container_of(iface, struct dim2_hdm, most_iface)
> @@ -731,7 +732,7 @@ static int dim2_probe(struct platform_device *pdev)
>  	struct dim2_hdm *dev;
>  	struct resource *res;
>  	int ret, i;
> -	u8 hal_ret;
> +	u8 dev_fcnt, hal_ret;
>  	int irq;
>  
>  	enum { MLB_INT_IDX, AHB0_INT_IDX };
> @@ -770,8 +771,10 @@ static int dim2_probe(struct platform_device *pdev)
>  
>  	dev->disable_platform = pdata ? pdata->disable : NULL;
>  
> -	dev_info(&pdev->dev, "sync: num of frames per sub-buffer: %u\n", fcnt);
> -	hal_ret = dim_startup(dev->io_base, dev->clk_speed, fcnt);
> +	dev_fcnt = pdata && pdata->fcnt ? pdata->fcnt : fcnt;

Please use a real if () statement here and do not bury real logic in a
crazy line like this one, as that is all but impossible to maintain over
time.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ