Re: [PATCH] SPARC64: fix iommu sg chaining

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <jens.axboe@...>
Cc: <fujita.tomonori@...>, <linux-kernel@...>, <linux-scsi@...>
Date: Wednesday, October 17, 2007 - 6:54 am

From: Jens Axboe <jens.axboe@oracle.com>
Date: Wed, 17 Oct 2007 11:16:29 +0200


Ok, next bug, introduced by this change:

commit f565913ef8a8d0cfa46a1faaf8340cc357a46f3a
Author: Jens Axboe <jens.axboe@oracle.com>
Date:   Fri Sep 21 10:44:19 2007 +0200

    block: convert to using sg helpers
    
    Convert the main rq mapper (blk_rq_map_sg()) to the sg helper setup.
    
    Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

Specifically this part:

 new_segment:
-			memset(&sg[nsegs],0,sizeof(struct scatterlist));
-			sg[nsegs].page = bvec->bv_page;
-			sg[nsegs].length = nbytes;
-			sg[nsegs].offset = bvec->bv_offset;
+			sg = next_sg;
+			next_sg = sg_next(sg);
 
+			sg->page = bvec->bv_page;
+			sg->length = nbytes;
+			sg->offset = bvec->bv_offset;

You can't remove that memset(), it's there for a reason.  The IOMMU
layers depended upon the code zero'ing out the whole scatterlist
struct, there might be more to it than page, length and offset :-)

In sparc64's case, this zero'd the dma_address and dma_length members
and the mapping algorithms use that to their advantage.
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] SPARC64: fix iommu sg chaining, FUJITA Tomonori, (Wed Oct 17, 1:07 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, Jens Axboe, (Wed Oct 17, 3:21 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, David Miller, (Wed Oct 17, 4:33 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, David Miller, (Wed Oct 17, 4:42 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, Jens Axboe, (Wed Oct 17, 4:45 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, David Miller, (Wed Oct 17, 5:13 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, Jens Axboe, (Wed Oct 17, 5:16 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, David Miller, (Wed Oct 17, 6:54 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, Jens Axboe, (Wed Oct 17, 6:58 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, FUJITA Tomonori, (Wed Oct 17, 7:04 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, David Miller, (Wed Oct 17, 7:04 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, Jens Axboe, (Wed Oct 17, 7:04 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, Jens Axboe, (Wed Oct 17, 7:01 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, FUJITA Tomonori, (Wed Oct 17, 7:37 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, FUJITA Tomonori, (Wed Oct 17, 7:01 pm)
Re: [PATCH] SPARC64: fix iommu sg chaining, Jens Axboe, (Wed Oct 17, 7:41 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, FUJITA Tomonori, (Wed Oct 17, 7:57 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, FUJITA Tomonori, (Wed Oct 17, 8:05 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, Jens Axboe, (Wed Oct 17, 10:36 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, David Miller, (Wed Oct 17, 7:10 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, Jens Axboe, (Wed Oct 17, 7:11 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, David Miller, (Wed Oct 17, 7:18 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, Jens Axboe, (Wed Oct 17, 7:27 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, FUJITA Tomonori, (Wed Oct 17, 5:24 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, David Miller, (Wed Oct 17, 5:45 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, FUJITA Tomonori, (Wed Oct 17, 7:08 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, Jens Axboe, (Wed Oct 17, 7:13 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, Jens Axboe, (Wed Oct 17, 7:16 am)
Re: [PATCH] SPARC64: fix iommu sg chaining, Jens Axboe, (Wed Oct 17, 5:27 am)