public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH] Various swiotlb fixes
Date: Wed, 04 Aug 2004 22:04:12 +0000	[thread overview]
Message-ID: <200408041504.12907.suresh.b.siddha@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 402 bytes --]

On Friday 30 July 2004 09:59, Andi Kleen wrote:
>
> I added support for swiotlb=force for easier testing.

This bootparam has exposed a bug in today's ia64 swiotlb code, because of 
which the kernel was not booting on my tiger with "swiotlb=force"

In swiotlb_map/unmap_sg(), sg->dma_address is getting setup with virtual 
address instead of physical.

Attached patch fixes this issue.

thanks,
suresh

[-- Attachment #2: swiotlb-0408.patch --]
[-- Type: text/x-diff, Size: 1031 bytes --]

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>

--- linux-2.6.8-rc2/arch/ia64/lib/swiotlb.c.orig	2004-08-04 14:12:09.000000000 -0700
+++ linux-2.6.8-rc2/arch/ia64/lib/swiotlb.c	2004-08-04 14:12:16.000000000 -0700
@@ -492,7 +492,7 @@
 		addr = SG_ENT_VIRT_ADDRESS(sg);
 		dev_addr = virt_to_phys(addr);
 		if (swiotlb_force || address_needs_mapping(hwdev, dev_addr)) {
-			sg->dma_address = (dma_addr_t) map_single(hwdev, addr, sg->length, dir);
+			sg->dma_address = (dma_addr_t) virt_to_phys(map_single(hwdev, addr, sg->length, dir));
 			if (!sg->dma_address) {
 				/* Don't panic here, we expect pci_map_sg users
 				   to do proper error handling. */
@@ -522,7 +522,7 @@
 
 	for (i = 0; i < nelems; i++, sg++)
 		if (sg->dma_address != SG_ENT_PHYS_ADDRESS(sg))
-			unmap_single(hwdev, (void *) sg->dma_address, sg->dma_length, dir);
+			unmap_single(hwdev, (void *) phys_to_virt(sg->dma_address), sg->dma_length, dir);
 		else if (dir == DMA_FROM_DEVICE)
 			mark_clean(SG_ENT_VIRT_ADDRESS(sg), sg->dma_length);
 }

             reply	other threads:[~2004-08-04 22:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-04 22:04 Siddha, Suresh B [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-07-30 16:59 [PATCH] Various swiotlb fixes Andi Kleen

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=200408041504.12907.suresh.b.siddha@intel.com \
    --to=suresh.b.siddha@intel.com \
    --cc=linux-ia64@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox