mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Ralph Campbell <ralph.campbell@qlogic.com>,
	Roland Dreier <rolandd@cisco.com>
Subject: Re: IB: Add DMA mapping functions to allow device drivers to interpose
Date: Tue, 12 Dec 2006 23:47:20 -0800	[thread overview]
Message-ID: <20061212234720.700f3cea.akpm@osdl.org> (raw)
In-Reply-To: <200612130359.kBD3xjWp028210@hera.kernel.org>

On Wed, 13 Dec 2006 03:59:45 GMT
Linux Kernel Mailing List <linux-kernel@vger.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@qlogic.com>
>     Signed-off-by: Roland Dreier <rolandd@cisco.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.



       reply	other threads:[~2006-12-13  7:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200612130359.kBD3xjWp028210@hera.kernel.org>
2006-12-13  7:47 ` Andrew Morton [this message]
2006-12-13 20:11   ` Ralph Campbell
2006-12-13 20:30     ` Andrew Morton
2006-12-13 21:22       ` Ralph Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061212234720.700f3cea.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ralph.campbell@qlogic.com \
    --cc=rolandd@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®