Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread FUJITA Tomonori
On Wed, 17 Oct 2007 20:37:58 +0900 FUJITA Tomonori <[EMAIL PROTECTED]> wrote: > On Wed, 17 Oct 2007 13:01:42 +0200 > Jens Axboe <[EMAIL PROTECTED]> wrote: > > > On Wed, Oct 17 2007, Jens Axboe wrote: > > > On Wed, Oct 17 2007, David Miller wrote: > > > > From: Jens Axboe <[EMAIL PROTECTED]> > > >

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread Jens Axboe
On Wed, Oct 17 2007, FUJITA Tomonori wrote: > > I think that it would be better that IOMMU code handles uninitialized > > sg entries (sg list can be pretty large). Execpt for sparc64, the > > IOMMU code can do, I think. > > And I think that with this patch, sparc64 can handle it: > > http://marc.

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread FUJITA Tomonori
On Wed, 17 Oct 2007 20:57:17 +0900 FUJITA Tomonori <[EMAIL PROTECTED]> wrote: > On Wed, 17 Oct 2007 13:41:17 +0200 > Jens Axboe <[EMAIL PROTECTED]> wrote: > > > On Wed, Oct 17 2007, FUJITA Tomonori wrote: > > > On Wed, 17 Oct 2007 13:01:42 +0200 > > > Jens Axboe <[EMAIL PROTECTED]> wrote: > > >

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread FUJITA Tomonori
On Wed, 17 Oct 2007 13:41:17 +0200 Jens Axboe <[EMAIL PROTECTED]> wrote: > On Wed, Oct 17 2007, FUJITA Tomonori wrote: > > On Wed, 17 Oct 2007 13:01:42 +0200 > > Jens Axboe <[EMAIL PROTECTED]> wrote: > > > > > On Wed, Oct 17 2007, Jens Axboe wrote: > > > > On Wed, Oct 17 2007, David Miller wrote:

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread Jens Axboe
On Wed, Oct 17 2007, FUJITA Tomonori wrote: > On Wed, 17 Oct 2007 13:01:42 +0200 > Jens Axboe <[EMAIL PROTECTED]> wrote: > > > On Wed, Oct 17 2007, Jens Axboe wrote: > > > On Wed, Oct 17 2007, David Miller wrote: > > > > From: Jens Axboe <[EMAIL PROTECTED]> > > > > Date: Wed, 17 Oct 2007 11:16:29

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread FUJITA Tomonori
On Wed, 17 Oct 2007 13:01:42 +0200 Jens Axboe <[EMAIL PROTECTED]> wrote: > On Wed, Oct 17 2007, Jens Axboe wrote: > > On Wed, Oct 17 2007, David Miller wrote: > > > From: Jens Axboe <[EMAIL PROTECTED]> > > > Date: Wed, 17 Oct 2007 11:16:29 +0200 > > > > > > > On Wed, Oct 17 2007, David Miller wro

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread Jens Axboe
On Wed, Oct 17 2007, David Miller wrote: > From: Jens Axboe <[EMAIL PROTECTED]> > Date: Wed, 17 Oct 2007 13:11:46 +0200 > > > On Wed, Oct 17 2007, David Miller wrote: > > > Jens, please also add the following on top of Fujita-san's most recent > > > sparc64 patch and we should be good to go. > >

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread David Miller
From: Jens Axboe <[EMAIL PROTECTED]> Date: Wed, 17 Oct 2007 13:11:46 +0200 > On Wed, Oct 17 2007, David Miller wrote: > > Jens, please also add the following on top of Fujita-san's most recent > > sparc64 patch and we should be good to go. > > Awesome, thanks. And sorry for messing up sparc64. D

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread Jens Axboe
On Wed, Oct 17 2007, Jens Axboe wrote: > On Wed, Oct 17 2007, FUJITA Tomonori wrote: > > On Wed, 17 Oct 2007 02:45:47 -0700 (PDT) > > David Miller <[EMAIL PROTECTED]> wrote: > > > > > From: FUJITA Tomonori <[EMAIL PROTECTED]> > > > Date: Wed, 17 Oct 2007 18:24:01 +0900 > > > > > > > On Wed, 17 Oc

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread Jens Axboe
On Wed, Oct 17 2007, FUJITA Tomonori wrote: > On Wed, 17 Oct 2007 02:45:47 -0700 (PDT) > David Miller <[EMAIL PROTECTED]> wrote: > > > From: FUJITA Tomonori <[EMAIL PROTECTED]> > > Date: Wed, 17 Oct 2007 18:24:01 +0900 > > > > > On Wed, 17 Oct 2007 11:16:29 +0200 > > > Jens Axboe <[EMAIL PROTECTE

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread Jens Axboe
On Wed, Oct 17 2007, David Miller wrote: > From: Jens Axboe <[EMAIL PROTECTED]> > Date: Wed, 17 Oct 2007 13:01:42 +0200 > > > Actually, just clearing AFTER sg_next() would be fine, since we know > > that is not a link entry. Duh... > > Yes and I'm running a kernel successfully with this fix. Gre

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread David Miller
From: Jens Axboe <[EMAIL PROTECTED]> Date: Wed, 17 Oct 2007 13:01:42 +0200 > Actually, just clearing AFTER sg_next() would be fine, since we know > that is not a link entry. Duh... Yes and I'm running a kernel successfully with this fix. Jens, please also add the following on top of Fujita-san's

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread FUJITA Tomonori
On Wed, 17 Oct 2007 02:45:47 -0700 (PDT) David Miller <[EMAIL PROTECTED]> wrote: > From: FUJITA Tomonori <[EMAIL PROTECTED]> > Date: Wed, 17 Oct 2007 18:24:01 +0900 > > > On Wed, 17 Oct 2007 11:16:29 +0200 > > Jens Axboe <[EMAIL PROTECTED]> wrote: > > > > > On Wed, Oct 17 2007, David Miller wrot

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread FUJITA Tomonori
On Wed, 17 Oct 2007 12:58:40 +0200 Jens Axboe <[EMAIL PROTECTED]> wrote: > On Wed, Oct 17 2007, David Miller wrote: > > From: Jens Axboe <[EMAIL PROTECTED]> > > Date: Wed, 17 Oct 2007 11:16:29 +0200 > > > > > On Wed, Oct 17 2007, David Miller wrote: > > > > From: Jens Axboe <[EMAIL PROTECTED]> >

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread David Miller
From: Jens Axboe <[EMAIL PROTECTED]> Date: Wed, 17 Oct 2007 12:58:40 +0200 > The problem is that you cannot zero the entire sg entry, because then > you'd potentially overwrite the chain pointer. > > I'd propose just adding a > > sg_dma_address(sg) = 0; > sg_dma_len(sg) = 0; > >

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread Jens Axboe
On Wed, Oct 17 2007, David Miller wrote: > From: Jens Axboe <[EMAIL PROTECTED]> > Date: Wed, 17 Oct 2007 12:58:40 +0200 > > > The problem is that you cannot zero the entire sg entry, because then > > you'd potentially overwrite the chain pointer. > > > > I'd propose just adding a > > > >

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread Jens Axboe
On Wed, Oct 17 2007, Jens Axboe wrote: > On Wed, Oct 17 2007, David Miller wrote: > > From: Jens Axboe <[EMAIL PROTECTED]> > > Date: Wed, 17 Oct 2007 11:16:29 +0200 > > > > > On Wed, Oct 17 2007, David Miller wrote: > > > > From: Jens Axboe <[EMAIL PROTECTED]> > > > > Date: Wed, 17 Oct 2007 10:45:

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread Jens Axboe
On Wed, Oct 17 2007, David Miller wrote: > From: Jens Axboe <[EMAIL PROTECTED]> > Date: Wed, 17 Oct 2007 11:16:29 +0200 > > > On Wed, Oct 17 2007, David Miller wrote: > > > From: Jens Axboe <[EMAIL PROTECTED]> > > > Date: Wed, 17 Oct 2007 10:45:28 +0200 > > > > > > > Righto, it's invalid to call

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread David Miller
From: Jens Axboe <[EMAIL PROTECTED]> Date: Wed, 17 Oct 2007 11:16:29 +0200 > On Wed, Oct 17 2007, David Miller wrote: > > From: Jens Axboe <[EMAIL PROTECTED]> > > Date: Wed, 17 Oct 2007 10:45:28 +0200 > > > > > Righto, it's invalid to call sg_next() on the last entry! > > > > Unfortunately, that

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread David Miller
From: FUJITA Tomonori <[EMAIL PROTECTED]> Date: Wed, 17 Oct 2007 18:24:01 +0900 > On Wed, 17 Oct 2007 11:16:29 +0200 > Jens Axboe <[EMAIL PROTECTED]> wrote: > > > On Wed, Oct 17 2007, David Miller wrote: > > > I would suggest that other sg_last() uses be audited for the same bug. > > > > Agree.

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread Jens Axboe
On Wed, Oct 17 2007, FUJITA Tomonori wrote: > On Wed, 17 Oct 2007 11:16:29 +0200 > Jens Axboe <[EMAIL PROTECTED]> wrote: > > > On Wed, Oct 17 2007, David Miller wrote: > > > From: Jens Axboe <[EMAIL PROTECTED]> > > > Date: Wed, 17 Oct 2007 10:45:28 +0200 > > > > > > > Righto, it's invalid to call

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread FUJITA Tomonori
On Wed, 17 Oct 2007 11:16:29 +0200 Jens Axboe <[EMAIL PROTECTED]> wrote: > On Wed, Oct 17 2007, David Miller wrote: > > From: Jens Axboe <[EMAIL PROTECTED]> > > Date: Wed, 17 Oct 2007 10:45:28 +0200 > > > > > Righto, it's invalid to call sg_next() on the last entry! > > > > Unfortunately, that's

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread Jens Axboe
On Wed, Oct 17 2007, David Miller wrote: > From: Jens Axboe <[EMAIL PROTECTED]> > Date: Wed, 17 Oct 2007 10:45:28 +0200 > > > Righto, it's invalid to call sg_next() on the last entry! > > Unfortunately, that's what the sparc64 code wanted to do, this > transformation in the sparc64 sg chaining pa

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread David Miller
From: Jens Axboe <[EMAIL PROTECTED]> Date: Wed, 17 Oct 2007 10:45:28 +0200 > Righto, it's invalid to call sg_next() on the last entry! Unfortunately, that's what the sparc64 code wanted to do, this transformation in the sparc64 sg chaining patch is not equilavent: - struct scatterlist *sg_

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread Jens Axboe
On Wed, Oct 17 2007, David Miller wrote: > From: David Miller <[EMAIL PROTECTED]> > Date: Wed, 17 Oct 2007 01:33:25 -0700 (PDT) > > > sg_next() gives you a NULL after the last entry, but tests have been > > changed to compare against sg_last() which is likely not what we > > want for those checks.

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread David Miller
From: David Miller <[EMAIL PROTECTED]> Date: Wed, 17 Oct 2007 01:33:25 -0700 (PDT) > sg_next() gives you a NULL after the last entry, but tests have been > changed to compare against sg_last() which is likely not what we > want for those checks. This of course isn't true, ignore me as I'm still l

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread David Miller
From: Jens Axboe <[EMAIL PROTECTED]> Date: Wed, 17 Oct 2007 09:21:49 +0200 > On Wed, Oct 17 2007, FUJITA Tomonori wrote: > > Commit 2c941a204070ab32d92d40318a3196a7fb994c00 looks incomplete. The > > helper functions like prepare_sg() need to support sg chaining too. > > Thanks Tomo, applied. I'll

Re: [PATCH] SPARC64: fix iommu sg chaining

2007-10-17 Thread Jens Axboe
On Wed, Oct 17 2007, FUJITA Tomonori wrote: > Commit 2c941a204070ab32d92d40318a3196a7fb994c00 looks incomplete. The > helper functions like prepare_sg() need to support sg chaining too. Thanks Tomo, applied. I'll get this pushed out later today with any other sg chaining fallout we may see. -- J

[PATCH] SPARC64: fix iommu sg chaining

2007-10-16 Thread FUJITA Tomonori
Commit 2c941a204070ab32d92d40318a3196a7fb994c00 looks incomplete. The helper functions like prepare_sg() need to support sg chaining too. Signed-off-by: FUJITA Tomonori <[EMAIL PROTECTED]> --- arch/sparc64/kernel/iommu.c|1 - arch/sparc64/kernel/iommu_common.c | 51 +