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: <20151007135412.GB3320@vkoul-mobl.iind.intel.com>
Date:	Wed, 7 Oct 2015 14:54:13 +0100
From:	Vinod Koul <vinod.koul@...el.com>
To:	Maxime Ripard <maxime.ripard@...e-electrons.com>
Cc:	Nicolas Ferre <nicolas.ferre@...el.com>,
	Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
	dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	Ludovic Desroches <ludovic.desroches@...el.com>,
	Cyrille Pitchen <cyrille.pitchen@...el.com>
Subject: Re: [PATCH 1/2] dmaengine: hdmac: factorise memset descriptor
 allocation

On Thu, Oct 01, 2015 at 04:52:37PM +0200, Maxime Ripard wrote:

> +static struct at_desc *atc_create_memset_desc(struct dma_chan *chan,
> +					      dma_addr_t psrc,
> +					      dma_addr_t pdst,
> +					      size_t len)
> +{
> +	struct at_dma_chan *atchan = to_at_dma_chan(chan);
> +	struct at_desc *desc;
> +	size_t xfer_count;
> +
> +	u32 ctrla = ATC_SRC_WIDTH(2) |
> +		ATC_DST_WIDTH(2);

why is this over two lines :)

> +	u32 ctrlb = ATC_DEFAULT_CTRLB | ATC_IEN |
> +		ATC_SRC_ADDR_MODE_FIXED |
> +		ATC_DST_ADDR_MODE_INCR |
> +		ATC_FC_MEM2MEM;
> +
> +	xfer_count = len >> 2;
> +	if (xfer_count > ATC_BTSIZE_MAX) {
> +		dev_err(chan2dev(chan), "%s: buffer is too big\n",
> +			__func__);
> +		return NULL;
> +	}

This is fine, but this is driver limitation. We should really split the
txn to multiple descriptors here..

> @@ -914,46 +953,26 @@ atc_prep_dma_memset(struct dma_chan *chan, dma_addr_t dest, int value,
>  		return NULL;
>  	}
>  
> -	xfer_count = len >> 2;
> -	if (xfer_count > ATC_BTSIZE_MAX) {
> -		dev_err(chan2dev(chan), "%s: buffer is too big\n",
> +	vaddr = dma_pool_alloc(atdma->memset_pool, GFP_ATOMIC, &paddr);

Mostly people use _zalloc variant, any reason why you don't want that

-- 
~Vinod
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ