linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: fix pci-gart failure handling
@ 2007-10-25 23:08 FUJITA Tomonori
  2007-10-26 11:56 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: FUJITA Tomonori @ 2007-10-25 23:08 UTC (permalink / raw)
  To: jens.axboe; +Cc: linux-kernel, tomof

blk_rq_map_sg doesn't initialize sg->dma_address/length to zero
anymore. Some low level drivers reuse sg lists without initializing so
IOMMUs might get non-zero dma_address/length. If map_sg fails, we need
pass the number of the mapped entries to gart_unmap_sg.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 arch/x86/kernel/pci-gart_64.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
index c56e9ee..6e7f826 100644
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -436,7 +436,7 @@ static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents,
 
 error:
 	flush_gart();
-	gart_unmap_sg(dev, sg, nents, dir);
+	gart_unmap_sg(dev, sg, out, dir);
 	/* When it was forced or merged try again in a dumb way */
 	if (force_iommu || iommu_merge) {
 		out = dma_map_sg_nonforce(dev, sg, nents, dir);
-- 
1.5.2.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86: fix pci-gart failure handling
  2007-10-25 23:08 [PATCH] x86: fix pci-gart failure handling FUJITA Tomonori
@ 2007-10-26 11:56 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2007-10-26 11:56 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: linux-kernel, tomof

On Fri, Oct 26 2007, FUJITA Tomonori wrote:
> blk_rq_map_sg doesn't initialize sg->dma_address/length to zero
> anymore. Some low level drivers reuse sg lists without initializing so
> IOMMUs might get non-zero dma_address/length. If map_sg fails, we need
> pass the number of the mapped entries to gart_unmap_sg.
> 
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>

Thanks Tomo, applied!

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-26 11:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-25 23:08 [PATCH] x86: fix pci-gart failure handling FUJITA Tomonori
2007-10-26 11:56 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).