mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Muli Ben-Yehuda <muli@il.ibm.com>
To: akepner@sgi.com
Cc: linux-kernel@vger.kernel.org, Roland Dreier <rdreier@cisco.com>,
	glebn@voltaire.com
Subject: Re: [RFC/PATCH] allow memory to be tagged "coherent" via dma_map_sg()
Date: Tue, 17 Jul 2007 13:16:58 +0300	[thread overview]
Message-ID: <20070717101658.GB18721@rhun.ibm.com> (raw)
In-Reply-To: <20070717021812.GH16538@sgi.com>

On Mon, Jul 16, 2007 at 07:18:12PM -0700, akepner@sgi.com wrote:

> diff --git a/include/asm-ia64/dma-mapping.h b/include/asm-ia64/dma-mapping.h
> index 6299b51..22af26b 100644
> --- a/include/asm-ia64/dma-mapping.h
> +++ b/include/asm-ia64/dma-mapping.h
> @@ -73,4 +73,26 @@ dma_cache_sync (struct device *dev, void *vaddr, size_t size,
>  
>  #define dma_is_consistent(d, h)	(1)	/* all we do is coherent memory... */
>  
> +#define ARCH_DOES_POSTED_DMA
> +#define DMA_ATTR_SHIFT	8	/* bottom 8 bits for direction, upper bits 
> +				 * for additional "attributes". For now the 
> +				 * only attribute is "flush in-flight dma 
> +				 * when writing to scatterlist" */
> +#define DMA_DIR_MASK	((1 << DMA_ATTR_SHIFT) - 1)
> +#define DMA_ATTR_MASK	~DMA_DIR_MASK
> +static inline int
> +dma_data_direction_set_dmaflush(enum dma_data_direction dir, int dmaflush) {
> +	return (dir | (dmaflush << DMA_ATTR_SHIFT));
> +}
> +
> +static inline int 
> +dma_data_direction_get_direction(enum dma_data_direction dir) {
> +	return (dir & DMA_DIR_MASK);
> +}
> +
> +static inline int 
> +dma_data_direction_get_dmaflush(enum dma_data_direction dir) {
> +	return ((dir & DMA_ATTR_MASK) >> DMA_ATTR_SHIFT);
> +}
> +
>  #endif /* _ASM_IA64_DMA_MAPPING_H */
> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
> index 9a663c6..885589a 100644
> --- a/include/linux/dma-mapping.h
> +++ b/include/linux/dma-mapping.h
> @@ -95,4 +95,11 @@ static inline void dmam_release_declared_memory(struct device *dev)
>  }
>  #endif /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */
>  
> +#ifndef ARCH_DOES_POSTED_DMA
> +static inline int
> +dma_data_direction_set_dmaflush(enum dma_data_direction dir, int dmaflush) {
> +	return (dir);
> +}
> +#endif /* ARCH_DOES_POSTED_DMA */
> +
>  #endif

The generic bits look much better than the previous version,
thanks. Is the generic dma_data_direction_set_dmaflush really needed?
if yes, what about dma_data_direction_get_direction and
dma_data_direction_get_dmaflush?

Cheers,
Muli

  reply	other threads:[~2007-07-17 10:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-17  2:18 akepner
2007-07-17 10:16 ` Muli Ben-Yehuda [this message]
2007-07-17 15:22   ` akepner

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=20070717101658.GB18721@rhun.ibm.com \
    --to=muli@il.ibm.com \
    --cc=akepner@sgi.com \
    --cc=glebn@voltaire.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdreier@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®