From: Nishanth Aravamudan <nacc@us.ibm.com>
To: Milton Miller <miltonm@bga.com>
Cc: Vinod Koul <vinod.koul@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] dma-mapping: add get_required_mask if arch overrides default
Date: Fri, 24 Jun 2011 12:05:23 -0700 [thread overview]
Message-ID: <1308942325-4813-3-git-send-email-nacc@us.ibm.com> (raw)
In-Reply-To: <1308942325-4813-1-git-send-email-nacc@us.ibm.com>
From: Milton Miller <miltonm@bga.com>
If an architecture sets ARCH_HAS_DMA_GET_REQUIRED_MASK and has settable
dma_map_ops, the required mask may change by the ops implementation.
For example, a system that always has an mmu inline may only require 32
bits while a swiotlb would desire bits to cover all of memory.
Therefore add the field if the architecture does not use the generic
definition of dma_get_required_mask. The first use will by by powerpc.
Note that this does add some dependency on the order in which files are
visible here.
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org
Cc: benh@kernel.crashing.org
---
include/linux/dma-mapping.h | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index ba8319a..d0e023b 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -49,6 +49,9 @@ struct dma_map_ops {
int (*mapping_error)(struct device *dev, dma_addr_t dma_addr);
int (*dma_supported)(struct device *dev, u64 mask);
int (*set_dma_mask)(struct device *dev, u64 mask);
+#ifdef ARCH_HAS_DMA_GET_REQUIRED_MASK
+ u64 (*get_required_mask)(struct device *dev);
+#endif
int is_phys;
};
--
1.7.4.1
next prev parent reply other threads:[~2011-06-24 19:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-24 19:05 [PATCH 0/4] pseries/iommu bug-fixes and cleanups for dynamic dma windows Nishanth Aravamudan
2011-06-24 19:05 ` [PATCH 1/4] powerpc: override dma_get_required_mask by platform hook and ops Nishanth Aravamudan
2011-06-24 19:05 ` Nishanth Aravamudan [this message]
2011-06-29 8:19 ` [PATCH 2/4] dma-mapping: add get_required_mask if arch overrides default FUJITA Tomonori
2011-09-01 5:35 ` Benjamin Herrenschmidt
2011-09-16 18:51 ` FUJITA Tomonori
2011-06-24 19:05 ` [PATCH 3/4] powerpc: use the newly added get_required_mask dma_map_ops hook Nishanth Aravamudan
2011-06-25 15:41 ` Geoff Levand
2011-06-24 19:05 ` [PATCH 4/4] powerpc: tidy up dma_map_ops after adding new hook Nishanth Aravamudan
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=1308942325-4813-3-git-send-email-nacc@us.ibm.com \
--to=nacc@us.ibm.com \
--cc=dan.j.williams@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=miltonm@bga.com \
--cc=vinod.koul@intel.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;
as well as URLs for NNTP newsgroup(s).