* [PATCH] x86-64: pci-gart iommu sg chaining zeroes wrong sg.
@ 2007-09-27 16:38 FUJITA Tomonori
2007-09-27 16:46 ` FUJITA Tomonori
0 siblings, 1 reply; 3+ messages in thread
From: FUJITA Tomonori @ 2007-09-27 16:38 UTC (permalink / raw)
To: jens.axboe; +Cc: linux-kernel, linux-scsi, fujita.tomonori
This patch is for Jens' block tree (sg chaining branch).
I don't have the hardware but this looks like a bug.
---
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Subject: [PATCH] x86-64: pci-gart iommu sg chaining zeroes a wrong sg's dma_length
Needs to zero the end of the list.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
arch/x86_64/kernel/pci-gart.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
index 27b7db4..a4151a7 100644
--- a/arch/x86_64/kernel/pci-gart.c
+++ b/arch/x86_64/kernel/pci-gart.c
@@ -425,9 +425,10 @@ int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, int dir)
if (dma_map_cont(start_sg, i - start, sgmap, pages, need) < 0)
goto error;
out++;
+ sgmap = sg_next(sgmap);
flush_gart();
if (out < nents)
- ps->dma_length = 0;
+ sgmap->dma_length = 0;
return out;
error:
--
1.5.2.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] x86-64: pci-gart iommu sg chaining zeroes wrong sg.
2007-09-27 16:38 [PATCH] x86-64: pci-gart iommu sg chaining zeroes wrong sg FUJITA Tomonori
@ 2007-09-27 16:46 ` FUJITA Tomonori
2007-09-30 11:34 ` Benny Halevy
0 siblings, 1 reply; 3+ messages in thread
From: FUJITA Tomonori @ 2007-09-27 16:46 UTC (permalink / raw)
To: jens.axboe; +Cc: linux-kernel, linux-scsi, fujita.tomonori
On Fri, 28 Sep 2007 01:38:27 +0900
FUJITA Tomonori <tomof@acm.org> wrote:
> This patch is for Jens' block tree (sg chaining branch).
>
> I don't have the hardware but this looks like a bug.
>
> ---
> From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Subject: [PATCH] x86-64: pci-gart iommu sg chaining zeroes a wrong sg's dma_length
>
> Needs to zero the end of the list.
>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> ---
> arch/x86_64/kernel/pci-gart.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
> index 27b7db4..a4151a7 100644
> --- a/arch/x86_64/kernel/pci-gart.c
> +++ b/arch/x86_64/kernel/pci-gart.c
> @@ -425,9 +425,10 @@ int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, int dir)
> if (dma_map_cont(start_sg, i - start, sgmap, pages, need) < 0)
> goto error;
> out++;
> + sgmap = sg_next(sgmap);
> flush_gart();
> if (out < nents)
> - ps->dma_length = 0;
> + sgmap->dma_length = 0;
> return out;
Sorry, it should be:
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
index 27b7db4..cfcc84e 100644
--- a/arch/x86_64/kernel/pci-gart.c
+++ b/arch/x86_64/kernel/pci-gart.c
@@ -426,8 +426,10 @@ int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, int dir)
goto error;
out++;
flush_gart();
- if (out < nents)
- ps->dma_length = 0;
+ if (out < nents) {
+ sgmap = sg_next(sgmap);
+ sgmap->dma_length = 0;
+ }
return out;
error:
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] x86-64: pci-gart iommu sg chaining zeroes wrong sg.
2007-09-27 16:46 ` FUJITA Tomonori
@ 2007-09-30 11:34 ` Benny Halevy
0 siblings, 0 replies; 3+ messages in thread
From: Benny Halevy @ 2007-09-30 11:34 UTC (permalink / raw)
To: FUJITA Tomonori; +Cc: jens.axboe, linux-kernel, linux-scsi, fujita.tomonori
On Sep 27, 2007, 18:46 +0200, FUJITA Tomonori <tomof@acm.org> wrote:
> On Fri, 28 Sep 2007 01:38:27 +0900
> FUJITA Tomonori <tomof@acm.org> wrote:
>
>> This patch is for Jens' block tree (sg chaining branch).
>>
>> I don't have the hardware but this looks like a bug.
>>
>> ---
>> From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
>> Subject: [PATCH] x86-64: pci-gart iommu sg chaining zeroes a wrong sg's dma_length
>>
>> Needs to zero the end of the list.
>>
>> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
>> ---
>> arch/x86_64/kernel/pci-gart.c | 3 ++-
>> 1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
>> index 27b7db4..a4151a7 100644
>> --- a/arch/x86_64/kernel/pci-gart.c
>> +++ b/arch/x86_64/kernel/pci-gart.c
>> @@ -425,9 +425,10 @@ int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, int dir)
>> if (dma_map_cont(start_sg, i - start, sgmap, pages, need) < 0)
>> goto error;
>> out++;
>> + sgmap = sg_next(sgmap);
>> flush_gart();
>> if (out < nents)
>> - ps->dma_length = 0;
>> + sgmap->dma_length = 0;
>> return out;
>
> Sorry, it should be:
>
>
> diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
> index 27b7db4..cfcc84e 100644
> --- a/arch/x86_64/kernel/pci-gart.c
> +++ b/arch/x86_64/kernel/pci-gart.c
> @@ -426,8 +426,10 @@ int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, int dir)
> goto error;
> out++;
> flush_gart();
> - if (out < nents)
> - ps->dma_length = 0;
> + if (out < nents) {
> + sgmap = sg_next(sgmap);
> + sgmap->dma_length = 0;
> + }
looks correct to me.
ps points at the previous "scanned" sg entry while you want to zero out
dma_length at the entry immediately following the last entry mapped
(if (out < nents))
the original code before 62296749bd421904dace1e6b0fc3c4538aac7111 was:
- if (out < nents)
- sg[out].dma_length = 0;
Benny
> return out;
>
> error:
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-09-30 12:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-27 16:38 [PATCH] x86-64: pci-gart iommu sg chaining zeroes wrong sg FUJITA Tomonori
2007-09-27 16:46 ` FUJITA Tomonori
2007-09-30 11:34 ` Benny Halevy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox