From: xiaomin1 <xiaoming.wang@intel.com>
To: konrad.wilk@oracle.com, akpm@linux-foundation.org,
linux@horizon.com, lauraa@codeaurora.org,
heiko.carstens@de.ibm.com, d.kasatkin@samsung.com,
takahiro.akashi@linaro.org, chris@chris-wilson.co.uk,
u.kleine-koenig@pengutronix.de, linux-kernel@vger.kernel.org
Cc: xiaomin1 <xiaoming.wang@intel.com>,
Chuansheng Liu <chuansheng.liu@intel.com>,
Zhang Dongxing <dongxing.zhang@intel.com>
Subject: [PATCH] modify the IO_TLB_SEGSIZE to configtable as flexible requirement about IOMMU/SW-IOMMU.
Date: Tue, 27 Jan 2015 03:30:21 +0800 [thread overview]
Message-ID: <1422300621-4453-1-git-send-email-xiaoming.wang@intel.com> (raw)
The maximum of SW-IOMMU is limited to 2^11*128 = 256K.
While in different platform and different requirements this seems improper.
So modify the IO_TLB_SEGSIZE to configtable is make sense.
Example:
If 1M bytes are requied. There has an error like.
[ 33.293120] DMA: Out of SW-IOMMU space for 1048576 bytes at device gadget
Signed-off-by: Chuansheng Liu <chuansheng.liu@intel.com>
Signed-off-by: Zhang Dongxing <dongxing.zhang@intel.com>
Signed-off-by: xiaomin1 <xiaoming.wang@intel.com>
---
include/linux/swiotlb.h | 2 +-
lib/Kconfig | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index e7a018e..5ab10b9 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -14,7 +14,7 @@ extern int swiotlb_force;
* must be a power of 2. What is the appropriate value ?
* The complexity of {map,unmap}_single is linearly dependent on this value.
*/
-#define IO_TLB_SEGSIZE 128
+#define IO_TLB_SEGSIZE CONFIG_DEFAULT_IO_TLB_SEGSIZE
/*
* log of the size of each IO TLB slab. The number of slabs is command line
diff --git a/lib/Kconfig b/lib/Kconfig
index 54cf309..76f1108 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -518,4 +518,8 @@ source "lib/fonts/Kconfig"
config ARCH_HAS_SG_CHAIN
def_bool n
+config DEFAULT_IO_TLB_SEGSIZE
+ int
+ default 128
+
endmenu
--
1.7.9.5
next reply other threads:[~2015-01-26 3:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-26 19:30 xiaomin1 [this message]
2015-01-26 11:15 ` Paul Bolle
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=1422300621-4453-1-git-send-email-xiaoming.wang@intel.com \
--to=xiaoming.wang@intel.com \
--cc=akpm@linux-foundation.org \
--cc=chris@chris-wilson.co.uk \
--cc=chuansheng.liu@intel.com \
--cc=d.kasatkin@samsung.com \
--cc=dongxing.zhang@intel.com \
--cc=heiko.carstens@de.ibm.com \
--cc=konrad.wilk@oracle.com \
--cc=lauraa@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@horizon.com \
--cc=takahiro.akashi@linaro.org \
--cc=u.kleine-koenig@pengutronix.de \
/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
Powered by JetHome