From: akpm@linux-foundation.org
To: tomof@acm.org, James.Bottomley@steeleye.com, davem@davemloft.net,
fujita.tomonori@lab.ntt.co.jp, jeff@garzik.org,
jens.axboe@oracle.com, mm-commits@vger.kernel.org
Subject: - iommu-sg-merging-sparc64-make-iommu-respect-the-segment-size-limits.patch removed from -mm tree
Date: Tue, 05 Feb 2008 14:28:16 -0800 [thread overview]
Message-ID: <200802052227.m15MRvJs011839@imap1.linux-foundation.org> (raw)
The patch titled
iommu sg merging: sparc64: make iommu respect the segment size limits
has been removed from the -mm tree. Its filename was
iommu-sg-merging-sparc64-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: sparc64: 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: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
arch/sparc64/kernel/iommu.c | 2 +-
arch/sparc64/kernel/iommu_common.c | 8 ++++++--
arch/sparc64/kernel/iommu_common.h | 3 ++-
arch/sparc64/kernel/pci_sun4v.c | 2 +-
4 files changed, 10 insertions(+), 5 deletions(-)
diff -puN arch/sparc64/kernel/iommu.c~iommu-sg-merging-sparc64-make-iommu-respect-the-segment-size-limits arch/sparc64/kernel/iommu.c
--- a/arch/sparc64/kernel/iommu.c~iommu-sg-merging-sparc64-make-iommu-respect-the-segment-size-limits
+++ a/arch/sparc64/kernel/iommu.c
@@ -580,7 +580,7 @@ static int dma_4u_map_sg(struct device *
/* Step 1: Prepare scatter list. */
- npages = prepare_sg(sglist, nelems);
+ npages = prepare_sg(dev, sglist, nelems);
/* Step 2: Allocate a cluster and context, if necessary. */
diff -puN arch/sparc64/kernel/iommu_common.c~iommu-sg-merging-sparc64-make-iommu-respect-the-segment-size-limits arch/sparc64/kernel/iommu_common.c
--- a/arch/sparc64/kernel/iommu_common.c~iommu-sg-merging-sparc64-make-iommu-respect-the-segment-size-limits
+++ a/arch/sparc64/kernel/iommu_common.c
@@ -4,6 +4,7 @@
* Copyright (C) 1999 David S. Miller (davem@redhat.com)
*/
+#include <linux/dma-mapping.h>
#include "iommu_common.h"
/* You are _strongly_ advised to enable the following debugging code
@@ -201,21 +202,24 @@ void verify_sglist(struct scatterlist *s
}
#endif
-unsigned long prepare_sg(struct scatterlist *sg, int nents)
+unsigned long prepare_sg(struct device *dev, struct scatterlist *sg, int nents)
{
struct scatterlist *dma_sg = sg;
unsigned long prev;
u32 dent_addr, dent_len;
+ unsigned int max_seg_size;
prev = (unsigned long) sg_virt(sg);
prev += (unsigned long) (dent_len = sg->length);
dent_addr = (u32) ((unsigned long)(sg_virt(sg)) & (IO_PAGE_SIZE - 1UL));
+ max_seg_size = dma_get_max_seg_size(dev);
while (--nents) {
unsigned long addr;
sg = sg_next(sg);
addr = (unsigned long) sg_virt(sg);
- if (! VCONTIG(prev, addr)) {
+ if (! VCONTIG(prev, addr) ||
+ dent_len + sg->length > max_seg_size) {
dma_sg->dma_address = dent_addr;
dma_sg->dma_length = dent_len;
dma_sg = sg_next(dma_sg);
diff -puN arch/sparc64/kernel/iommu_common.h~iommu-sg-merging-sparc64-make-iommu-respect-the-segment-size-limits arch/sparc64/kernel/iommu_common.h
--- a/arch/sparc64/kernel/iommu_common.h~iommu-sg-merging-sparc64-make-iommu-respect-the-segment-size-limits
+++ a/arch/sparc64/kernel/iommu_common.h
@@ -9,6 +9,7 @@
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/scatterlist.h>
+#include <linux/device.h>
#include <asm/iommu.h>
#include <asm/scatterlist.h>
@@ -46,4 +47,4 @@ extern void verify_sglist(struct scatter
#define VCONTIG(__X, __Y) (((__X) == (__Y)) || \
(((__X) | (__Y)) << (64UL - PAGE_SHIFT)) == 0UL)
-extern unsigned long prepare_sg(struct scatterlist *sg, int nents);
+extern unsigned long prepare_sg(struct device *dev, struct scatterlist *sg, int nents);
diff -puN arch/sparc64/kernel/pci_sun4v.c~iommu-sg-merging-sparc64-make-iommu-respect-the-segment-size-limits arch/sparc64/kernel/pci_sun4v.c
--- a/arch/sparc64/kernel/pci_sun4v.c~iommu-sg-merging-sparc64-make-iommu-respect-the-segment-size-limits
+++ a/arch/sparc64/kernel/pci_sun4v.c
@@ -490,7 +490,7 @@ static int dma_4v_map_sg(struct device *
goto bad;
/* Step 1: Prepare scatter list. */
- npages = prepare_sg(sglist, nelems);
+ npages = prepare_sg(dev, sglist, nelems);
/* Step 2: Allocate a cluster and context, if necessary. */
spin_lock_irqsave(&iommu->lock, flags);
_
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.m15MRvJs011839@imap1.linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=James.Bottomley@steeleye.com \
--cc=davem@davemloft.net \
--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=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.