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-next>] [day] [month] [year] [list]
Date:	Tue, 12 Dec 2006 23:47:20 -0800
From:	Andrew Morton <akpm@...l.org>
To:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Cc:	Ralph Campbell <ralph.campbell@...gic.com>,
	Roland Dreier <rolandd@...co.com>
Subject: Re: IB: Add DMA mapping functions to allow device drivers to
 interpose

On Wed, 13 Dec 2006 03:59:45 GMT
Linux Kernel Mailing List <linux-kernel@...r.kernel.org> wrote:

>     IB: Add DMA mapping functions to allow device drivers to interpose
>     
>     The QLogic InfiniPath HCAs use programmed I/O instead of HW DMA.
>     This patch allows a verbs device driver to interpose on DMA mapping
>     function calls in order to avoid relying on bus_to_virt() and
>     phys_to_virt() to undo the mappings created by dma_map_single(),
>     dma_map_sg(), etc.
>     
>     Signed-off-by: Ralph Campbell <ralph.campbell@...gic.com>
>     Signed-off-by: Roland Dreier <rolandd@...co.com>

include/rdma/ib_verbs.h: In function 'ib_dma_alloc_coherent':
include/rdma/ib_verbs.h:1635: warning: passing argument 3 of 'dma_alloc_coherent' from incompatible pointer type
In file included from drivers/infiniband/hw/mthca/mthca_provider.h:41,
                 from drivers/infiniband/hw/mthca/mthca_dev.h:53,
                 from drivers/infiniband/hw/mthca/mthca_main.c:44:
include/rdma/ib_verbs.h: In function 'ib_dma_alloc_coherent':
include/rdma/ib_verbs.h:1635: warning: passing argument 3 of 'dma_alloc_coherent' from incompatible pointer type


That u64 needs to become a dma_addr_t.  That means that
ib_dma_mapping_ops.alloc_coherent() and ib_dma_mapping_ops.free_coherent() are
wrong as well.

> +struct ib_dma_mapping_ops {
> ...
> +	void		*(*alloc_coherent)(struct ib_device *dev,
> +					   size_t size,
> +					   u64 *dma_handle,
> +					   gfp_t flag);
> +	void		(*free_coherent)(struct ib_device *dev,
> +					 size_t size, void *cpu_addr,
> +					 u64 dma_handle);
> +};

I'd have picked this up if it had been in git-infiniband for even a couple
of days.  I'm assuming this all got slammed into mainline because of the
merge window thing.

I cannot find these patches on the kernel mailing list.  I cannot find the
pull request anywhere.

> +static inline u64 ib_dma_map_single(struct ib_device *dev,
> +				    void *cpu_addr, size_t size,
> +				    enum dma_data_direction direction)

no, dma_map_single() returns a dma_addr_t.


-
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