From: Tushar Dave <tushar.n.dave@oracle.com>
To: davem@davemloft.net, chris.hyser@oracle.com,
sowmini.varadhan@oracle.com, vgupta@synopsys.com,
jroedel@suse.de, egtvedt@samfundet.no, robin.murphy@arm.com,
m.szyprowski@samsung.com, krzk@kernel.org,
sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 6/6] sparc64: Enable 64-bit DMA
Date: Thu, 27 Oct 2016 17:23:32 -0700 [thread overview]
Message-ID: <1477614212-13466-7-git-send-email-tushar.n.dave@oracle.com> (raw)
In-Reply-To: <1477614212-13466-1-git-send-email-tushar.n.dave@oracle.com>
ATU 64bit addressing allows PCIe devices with 64bit DMA capabilities
to use ATU for 64bit DMA.
Signed-off-by: Tushar Dave <tushar.n.dave@oracle.com>
Reviewed-by: chris hyser <chris.hyser@oracle.com>
Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
---
arch/sparc/Kconfig | 4 ++++
arch/sparc/kernel/iommu.c | 8 ++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 5202eb4..60145c9 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -93,6 +93,10 @@ config ARCH_ATU
bool
default y if SPARC64
+config ARCH_DMA_ADDR_T_64BIT
+ bool
+ default y if ARCH_ATU
+
config IOMMU_HELPER
bool
default y if SPARC64
diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c
index 5c615ab..852a329 100644
--- a/arch/sparc/kernel/iommu.c
+++ b/arch/sparc/kernel/iommu.c
@@ -760,8 +760,12 @@ int dma_supported(struct device *dev, u64 device_mask)
struct iommu *iommu = dev->archdata.iommu;
u64 dma_addr_mask = iommu->dma_addr_mask;
- if (device_mask >= (1UL << 32UL))
- return 0;
+ if (device_mask > DMA_BIT_MASK(32)) {
+ if (iommu->atu)
+ dma_addr_mask = iommu->atu->dma_addr_mask;
+ else
+ return 0;
+ }
if ((device_mask & dma_addr_mask) == dma_addr_mask)
return 1;
--
1.9.1
prev parent reply other threads:[~2016-10-28 0:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-28 0:23 [PATCH v2 0/6] sparc: Enable sun4v hypervisor PCI IOMMU v2 APIs and ATU Tushar Dave
2016-10-28 0:23 ` [PATCH v2 1/6] sparc64: Add FORCE_MAX_ZONEORDER and default to 13 Tushar Dave
2016-10-28 0:23 ` [PATCH v2 2/6] sparc64: Add ATU (new IOMMU) support Tushar Dave
2016-10-28 0:23 ` [PATCH v2 3/6] sparc64: Initialize iommu_map_table and iommu_pool Tushar Dave
2016-10-28 0:23 ` [PATCH v2 4/6] sparc64: Bind PCIe devices to use IOMMU v2 service Tushar Dave
2016-10-28 0:23 ` [PATCH v2 5/6] sparc64: Enable sun4v dma ops to use IOMMU v2 APIs Tushar Dave
2016-10-28 0:41 ` Joe Perches
2016-10-28 16:09 ` tndave
2016-10-28 0:23 ` Tushar Dave [this message]
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=1477614212-13466-7-git-send-email-tushar.n.dave@oracle.com \
--to=tushar.n.dave@oracle.com \
--cc=chris.hyser@oracle.com \
--cc=davem@davemloft.net \
--cc=egtvedt@samfundet.no \
--cc=jroedel@suse.de \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=robin.murphy@arm.com \
--cc=sowmini.varadhan@oracle.com \
--cc=sparclinux@vger.kernel.org \
--cc=vgupta@synopsys.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®