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: <4E9BFC62.1080102@atmel.com>
Date:	Mon, 17 Oct 2011 11:58:58 +0200
From:	Nicolas Ferre <nicolas.ferre@...el.com>
To:	Vinod Koul <vinod.koul@...el.com>
CC:	dan.j.williams@...el.com, linux-kernel@...r.kernel.org,
	jaswinder.singh@...aro.org, 21cnbao@...il.com,
	rmk@....linux.org.uk, Vinod Koul <vinod.koul@...ux.intel.com>,
	Russell King <rmk+kernel@....linux.org.uk>,
	Viresh Kumar <viresh.kumar@...com>,
	Linus Walleij <linus.walleij@...aro.org>,
	Mika Westerberg <mika.westerberg@....fi>,
	H Hartley Sweeten <hartleys@...ionengravers.com>,
	Li Yang <leoli@...escale.com>, Zhang Wei <zw@...kernel.org>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Guennadi Liakhovetski <g.liakhovetski@....de>,
	Shawn Guo <shawn.guo@...escale.com>,
	Yong Wang <yong.y.wang@...el.com>,
	Tomoya MORINAGA <tomoya-linux@....lapis-semi.com>,
	Boojin Kim <boojin.kim@...sung.com>,
	Barry Song <Baohua.Song@....com>
Subject: Re: [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction

On 10/14/2011 07:38 AM, Vinod Koul :
> From: Vinod Koul <vinod.koul@...ux.intel.com>
> 
> Signed-off-by: Vinod Koul <vinod.koul@...ux.intel.com>
> Cc: Jassi Brar <jaswinder.singh@...aro.org>
> Cc: Russell King <rmk+kernel@....linux.org.uk>
> Cc: Viresh Kumar <viresh.kumar@...com>
> Cc: Linus Walleij <linus.walleij@...aro.org>
> Cc: Nicolas Ferre <nicolas.ferre@...el.com>

[..]

> index fcfa0a8..7968a81 100644
> --- a/drivers/dma/at_hdmac.c
> +++ b/drivers/dma/at_hdmac.c
> @@ -660,7 +660,7 @@ err_desc_get:
>   */
>  static struct dma_async_tx_descriptor *
>  atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
> -		unsigned int sg_len, enum dma_data_direction direction,
> +		unsigned int sg_len, enum dma_transfer_direction direction,
>  		unsigned long flags)
>  {
>  	struct at_dma_chan	*atchan = to_at_dma_chan(chan);
> @@ -678,7 +678,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
>  
>  	dev_vdbg(chan2dev(chan), "prep_slave_sg (%d): %s f0x%lx\n",
>  			sg_len,
> -			direction == DMA_TO_DEVICE ? "TO DEVICE" : "FROM DEVICE",
> +			direction == MEM_TO_DEV ? "TO DEVICE" : "FROM DEVICE",
>  			flags);
>  
>  	if (unlikely(!atslave || !sg_len)) {
> @@ -692,7 +692,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
>  	ctrlb = ATC_IEN;
>  
>  	switch (direction) {
> -	case DMA_TO_DEVICE:
> +	case MEM_TO_DEV:
>  		ctrla |=  ATC_DST_WIDTH(reg_width);
>  		ctrlb |=  ATC_DST_ADDR_MODE_FIXED
>  			| ATC_SRC_ADDR_MODE_INCR
> @@ -725,7 +725,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
>  			total_len += len;
>  		}
>  		break;
> -	case DMA_FROM_DEVICE:
> +	case DEV_TO_MEM:
>  		ctrla |=  ATC_SRC_WIDTH(reg_width);
>  		ctrlb |=  ATC_DST_ADDR_MODE_INCR
>  			| ATC_SRC_ADDR_MODE_FIXED
> @@ -787,7 +787,7 @@ err_desc_get:
>   */
>  static int
>  atc_dma_cyclic_check_values(unsigned int reg_width, dma_addr_t buf_addr,
> -		size_t period_len, enum dma_data_direction direction)
> +		size_t period_len, enum dma_transfer_direction direction)
>  {
>  	if (period_len > (ATC_BTSIZE_MAX << reg_width))
>  		goto err_out;
> @@ -795,7 +795,7 @@ atc_dma_cyclic_check_values(unsigned int reg_width, dma_addr_t buf_addr,
>  		goto err_out;
>  	if (unlikely(buf_addr & ((1 << reg_width) - 1)))
>  		goto err_out;
> -	if (unlikely(!(direction & (DMA_TO_DEVICE | DMA_FROM_DEVICE))))
> +	if (unlikely(!(direction & (DEV_TO_MEM | MEM_TO_DEV))))
>  		goto err_out;
>  
>  	return 0;
> @@ -810,7 +810,7 @@ err_out:
>  static int
>  atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
>  		unsigned int period_index, dma_addr_t buf_addr,
> -		size_t period_len, enum dma_data_direction direction)
> +		size_t period_len, enum dma_transfer_direction direction)
>  {
>  	u32		ctrla;
>  	unsigned int	reg_width = atslave->reg_width;
> @@ -822,7 +822,7 @@ atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
>  		| period_len >> reg_width;
>  
>  	switch (direction) {
> -	case DMA_TO_DEVICE:
> +	case MEM_TO_DEV:
>  		desc->lli.saddr = buf_addr + (period_len * period_index);
>  		desc->lli.daddr = atslave->tx_reg;
>  		desc->lli.ctrla = ctrla;
> @@ -833,7 +833,7 @@ atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
>  				| ATC_DIF(AT_DMA_PER_IF);
>  		break;
>  
> -	case DMA_FROM_DEVICE:
> +	case DEV_TO_MEM:
>  		desc->lli.saddr = atslave->rx_reg;
>  		desc->lli.daddr = buf_addr + (period_len * period_index);
>  		desc->lli.ctrla = ctrla;
> @@ -861,7 +861,7 @@ atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
>   */
>  static struct dma_async_tx_descriptor *
>  atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
> -		size_t period_len, enum dma_data_direction direction)
> +		size_t period_len, enum dma_transfer_direction direction)
>  {
>  	struct at_dma_chan	*atchan = to_at_dma_chan(chan);
>  	struct at_dma_slave	*atslave = chan->private;
> @@ -872,7 +872,7 @@ atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
>  	unsigned int		i;
>  
>  	dev_vdbg(chan2dev(chan), "prep_dma_cyclic: %s buf@...08x - %d (%d/%d)\n",
> -			direction == DMA_TO_DEVICE ? "TO DEVICE" : "FROM DEVICE",
> +			direction == MEM_TO_DEV ? "TO DEVICE" : "FROM DEVICE",
>  			buf_addr,
>  			periods, buf_len, period_len);
>  

For at_hdmac (Atmel DMA controller)

Acked-by: Nicolas Ferre <nicolas.ferre@...el.com>

Best regards,
-- 
Nicolas Ferre
--
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