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: <4F58806E.9090500@metafoo.de>
Date:	Thu, 08 Mar 2012 10:48:30 +0100
From:	Lars-Peter Clausen <lars@...afoo.de>
To:	Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
CC:	Vinod Koul <vinod.koul@...el.com>,
	Dan Williams <dan.j.williams@...el.com>,
	Russell King <linux@....linux.org.uk>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] dmaengine: care sd_dma_address/len in dmaengine_prep_slave_single()

On 01/31/2012 02:13 AM, Kuninori Morimoto wrote:
> dmaengine_prep_slave_single() is helper macro of dmaengine.
> But it doesn't have sg_dma_address/len() settings which are required.
> And it used void *buf in parameter, but it should be dma_addr_t.
> This patch fixes up it.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>

Hi,

Any news regarding this patch? The dmaengine_prep_slave_single in upstream
is not really usable as it is right now.

Thanks,
- Lars

> ---
> V1 -> v2
> 
> - based on latest linus/master branch
> 
>  include/linux/dmaengine.h |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> index 679b349..97eaf57 100644
> --- a/include/linux/dmaengine.h
> +++ b/include/linux/dmaengine.h
> @@ -606,11 +606,16 @@ static inline int dmaengine_slave_config(struct dma_chan *chan,
>  }
>  
>  static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single(
> -	struct dma_chan *chan, void *buf, size_t len,
> +	struct dma_chan *chan, dma_addr_t buf, size_t len,
>  	enum dma_transfer_direction dir, unsigned long flags)
>  {
>  	struct scatterlist sg;
> -	sg_init_one(&sg, buf, len);
> +
> +	sg_init_table(&sg, 1);
> +	sg_set_page(&sg, pfn_to_page(PFN_DOWN(buf)),
> +		    len, offset_in_page(buf));
> +	sg_dma_address(&sg) = buf;
> +	sg_dma_len(&sg) = len;
>  
>  	return chan->device->device_prep_slave_sg(chan, &sg, 1, dir, flags);
>  }

--
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