From: akpm@linux-foundation.org
To: tomof@acm.org, James.Bottomley@steeleye.com,
benh@kernel.crashing.org, fujita.tomonori@lab.ntt.co.jp,
jeff@garzik.org, jens.axboe@oracle.com, paulus@samba.org,
mm-commits@vger.kernel.org
Subject: - iommu-sg-merging-ppc-make-iommu-respect-the-segment-size-limits.patch removed from -mm tree
Date: Tue, 05 Feb 2008 14:28:05 -0800 [thread overview]
Message-ID: <200802052227.m15MRkAr011829@imap1.linux-foundation.org> (raw)
The patch titled
iommu sg merging: ppc: make iommu respect the segment size limits
has been removed from the -mm tree. Its filename was
iommu-sg-merging-ppc-make-iommu-respect-the-segment-size-limits.patch
This patch was dropped because it was merged into mainline or a subsystem tree
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: iommu sg merging: ppc: make iommu respect the segment size limits
From: FUJITA Tomonori <tomof@acm.org>
This patch makes iommu respect segment size limits when merging sg
lists.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
arch/powerpc/kernel/dma_64.c | 2 +-
arch/powerpc/kernel/iommu.c | 8 ++++++--
include/asm-powerpc/iommu.h | 2 +-
3 files changed, 8 insertions(+), 4 deletions(-)
diff -puN arch/powerpc/kernel/dma_64.c~iommu-sg-merging-ppc-make-iommu-respect-the-segment-size-limits arch/powerpc/kernel/dma_64.c
--- a/arch/powerpc/kernel/dma_64.c~iommu-sg-merging-ppc-make-iommu-respect-the-segment-size-limits
+++ a/arch/powerpc/kernel/dma_64.c
@@ -68,7 +68,7 @@ static void dma_iommu_unmap_single(struc
static int dma_iommu_map_sg(struct device *dev, struct scatterlist *sglist,
int nelems, enum dma_data_direction direction)
{
- return iommu_map_sg(dev->archdata.dma_data, sglist, nelems,
+ return iommu_map_sg(dev, sglist, nelems,
device_to_mask(dev), direction);
}
diff -puN arch/powerpc/kernel/iommu.c~iommu-sg-merging-ppc-make-iommu-respect-the-segment-size-limits arch/powerpc/kernel/iommu.c
--- a/arch/powerpc/kernel/iommu.c~iommu-sg-merging-ppc-make-iommu-respect-the-segment-size-limits
+++ a/arch/powerpc/kernel/iommu.c
@@ -270,16 +270,18 @@ static void iommu_free(struct iommu_tabl
spin_unlock_irqrestore(&(tbl->it_lock), flags);
}
-int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist,
+int iommu_map_sg(struct device *dev, struct scatterlist *sglist,
int nelems, unsigned long mask,
enum dma_data_direction direction)
{
+ struct iommu_table *tbl = dev->archdata.dma_data;
dma_addr_t dma_next = 0, dma_addr;
unsigned long flags;
struct scatterlist *s, *outs, *segstart;
int outcount, incount, i;
unsigned int align;
unsigned long handle;
+ unsigned int max_seg_size;
BUG_ON(direction == DMA_NONE);
@@ -298,6 +300,7 @@ int iommu_map_sg(struct iommu_table *tbl
spin_lock_irqsave(&(tbl->it_lock), flags);
+ max_seg_size = dma_get_max_seg_size(dev);
for_each_sg(sglist, s, nelems, i) {
unsigned long vaddr, npages, entry, slen;
@@ -344,7 +347,8 @@ int iommu_map_sg(struct iommu_table *tbl
/* We cannot merge if:
* - allocated dma_addr isn't contiguous to previous allocation
*/
- if (novmerge || (dma_addr != dma_next)) {
+ if (novmerge || (dma_addr != dma_next) ||
+ (outs->dma_length + s->length > max_seg_size)) {
/* Can't merge: create a new segment */
segstart = s;
outcount++;
diff -puN include/asm-powerpc/iommu.h~iommu-sg-merging-ppc-make-iommu-respect-the-segment-size-limits include/asm-powerpc/iommu.h
--- a/include/asm-powerpc/iommu.h~iommu-sg-merging-ppc-make-iommu-respect-the-segment-size-limits
+++ a/include/asm-powerpc/iommu.h
@@ -79,7 +79,7 @@ extern void iommu_free_table(struct iomm
extern struct iommu_table *iommu_init_table(struct iommu_table * tbl,
int nid);
-extern int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist,
+extern int iommu_map_sg(struct device *dev, struct scatterlist *sglist,
int nelems, unsigned long mask,
enum dma_data_direction direction);
extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist,
_
Patches currently in -mm which might be from tomof@acm.org are
origin.patch
reply other threads:[~2008-02-05 22:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200802052227.m15MRkAr011829@imap1.linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=James.Bottomley@steeleye.com \
--cc=benh@kernel.crashing.org \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=jeff@garzik.org \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=paulus@samba.org \
--cc=tomof@acm.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.