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: <VI1PR0402MB34854421031A02B1AE3F953098C70@VI1PR0402MB3485.eurprd04.prod.outlook.com>
Date:   Tue, 23 Jul 2019 16:02:16 +0000
From:   Horia Geanta <horia.geanta@....com>
To:     Andrey Smirnov <andrew.smirnov@...il.com>,
        "linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>
CC:     Chris Spencer <christopher.spencer@....co.uk>,
        Cory Tusar <cory.tusar@....aero>,
        Chris Healy <cphealy@...il.com>,
        Lucas Stach <l.stach@...gutronix.de>,
        Aymen Sghaier <aymen.sghaier@....com>,
        Leonard Crestez <leonard.crestez@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v6 04/14] crypto: caam - request JR IRQ as the last step

On 7/17/2019 6:25 PM, Andrey Smirnov wrote:
> In order to avoid any risk of JR IRQ request being handled while some
> of the resources used for that are not yet allocated move the code
> requesting said IRQ to the endo of caam_jr_init(). No functional
                             ^ typo
> change intended.
> 
What qualifies as a "functional change"?
I've seen this comment in several commits.

>  	error = caam_reset_hw_jr(dev);
>  	if (error)
> -		goto out_kill_deq;
> +		return error;
>  
>  	error = -ENOMEM;
>  	jrp->inpring = dmam_alloc_coherent(dev, sizeof(*jrp->inpring) *
>  					   JOBR_DEPTH, &inpbusaddr,
>  					   GFP_KERNEL);
>  	if (!jrp->inpring)
> -		goto out_kill_deq;
> +		return -ENOMEM;
Above there's "error = -ENOMEM;", so why not "return err;" here and
in all the other cases below?

>  
>  	jrp->outring = dmam_alloc_coherent(dev, sizeof(*jrp->outring) *
>  					   JOBR_DEPTH, &outbusaddr,
>  					   GFP_KERNEL);
>  	if (!jrp->outring)
> -		goto out_kill_deq;
> +		return -ENOMEM;
>  
>  	jrp->entinfo = devm_kcalloc(dev, JOBR_DEPTH, sizeof(*jrp->entinfo),
>  				    GFP_KERNEL);
>  	if (!jrp->entinfo)
> -		goto out_kill_deq;
> +		return -ENOMEM;
>  
>  	for (i = 0; i < JOBR_DEPTH; i++)
>  		jrp->entinfo[i].desc_addr_dma = !0;
> @@ -483,10 +472,19 @@ static int caam_jr_init(struct device *dev)
>  		      (JOBR_INTC_COUNT_THLD << JRCFG_ICDCT_SHIFT) |
>  		      (JOBR_INTC_TIME_THLD << JRCFG_ICTT_SHIFT));
>  
> +	tasklet_init(&jrp->irqtask, caam_jr_dequeue, (unsigned long)dev);
> +
> +	/* Connect job ring interrupt handler. */
> +	error = devm_request_irq(dev, jrp->irq, caam_jr_interrupt, IRQF_SHARED,
> +				 dev_name(dev), dev);
> +	if (error) {
> +		dev_err(dev, "can't connect JobR %d interrupt (%d)\n",
> +			jrp->ridx, jrp->irq);
> +		tasklet_kill(&jrp->irqtask);
> +		return error;
"return error;" should be moved out the if block.

> +	}
> +
>  	return 0;
> -out_kill_deq:
> -	tasklet_kill(&jrp->irqtask);
> -	return error;
>  }

Horia

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ