From: Bob Breuer <breuerr@mc.net>
To: sparclinux@vger.kernel.org
Subject: [PATCH] sparc32: fix iommu_flush_iotlb end address
Date: Tue, 20 Jun 2006 04:08:59 +0000 [thread overview]
Message-ID: <449774DB.6090201@mc.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 603 bytes --]
Fix the calculation of the end address when flushing iotlb entries to
ram. This bug has been a cause of esp dma errors, and it affects
HyperSPARC systems much worse than SuperSPARC systems.
Signed-off-by: Bob Breuer <breuerr@mc.net>
---
Just in case it's not obvious from the patch as to how the dma was
broken: Each dma mapping sets up iopte entries for the iommu, and the
iommu only looks in main memory for the iopte entries. If there is a
group of iopte entries that are smaller than a page in size, but
straddle a page boundary, the broken code would fail to flush the last
page to ram.
Bob
[-- Attachment #2: sparc32-fix-flush_iotlb_end.patch.txt --]
[-- Type: text/plain, Size: 490 bytes --]
diff --git a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c
index 77840c8..7215849 100644
--- a/arch/sparc/mm/iommu.c
+++ b/arch/sparc/mm/iommu.c
@@ -144,8 +144,9 @@ static void iommu_flush_iotlb(iopte_t *i
unsigned long start;
unsigned long end;
- start = (unsigned long)iopte & PAGE_MASK;
+ start = (unsigned long)iopte;
end = PAGE_ALIGN(start + niopte*sizeof(iopte_t));
+ start &= PAGE_MASK;
if (viking_mxcc_present) {
while(start < end) {
viking_mxcc_flush_page(start);
next reply other threads:[~2006-06-20 4:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-20 4:08 Bob Breuer [this message]
2006-06-20 7:41 ` [PATCH] sparc32: fix iommu_flush_iotlb end address David Miller
2006-06-23 10:41 ` Martin Habets
2006-06-23 11:48 ` BERTRAND Joël
2006-06-23 16:40 ` Bob Breuer
2006-06-26 12:01 ` BERTRAND Joël
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=449774DB.6090201@mc.net \
--to=breuerr@mc.net \
--cc=sparclinux@vger.kernel.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.