[PATCH] [9/12] GBPAGES: Switch pci-gart over to using cpa instead of clear_kernel_mapping

2008-02-01 Thread Andi Kleen

pci-gart needs to unmap the IOMMU aperture to prevent cache corruptions.

Switch this over to using cpa instead of clear_kernel_mapping()

Drawback right now is that cpa will split everything down to 4k
pages, and this costs 4K for each 2MB of aperture; 128KB for a typical
64MB aperture.

Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>

---
 arch/x86/kernel/pci-gart_64.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux/arch/x86/kernel/pci-gart_64.c
===
--- linux.orig/arch/x86/kernel/pci-gart_64.c
+++ linux/arch/x86/kernel/pci-gart_64.c
@@ -731,7 +731,8 @@ void __init gart_iommu_init(void)
 * the backing memory. The GART address is only used by PCI
 * devices.
 */
-   clear_kernel_mapping((unsigned long)__va(iommu_bus_base), iommu_size);
+   set_memory_np((unsigned long)__va(iommu_bus_base),
+   iommu_size >> PAGE_SHIFT);
 
/*
 * Try to workaround a bug (thanks to BenH)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [9/12] GBPAGES: Switch pci-gart over to using cpa instead of clear_kernel_mapping

2008-02-01 Thread Andi Kleen

pci-gart needs to unmap the IOMMU aperture to prevent cache corruptions.

Switch this over to using cpa instead of clear_kernel_mapping()

Drawback right now is that cpa will split everything down to 4k
pages, and this costs 4K for each 2MB of aperture; 128KB for a typical
64MB aperture.

Signed-off-by: Andi Kleen [EMAIL PROTECTED]

---
 arch/x86/kernel/pci-gart_64.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux/arch/x86/kernel/pci-gart_64.c
===
--- linux.orig/arch/x86/kernel/pci-gart_64.c
+++ linux/arch/x86/kernel/pci-gart_64.c
@@ -731,7 +731,8 @@ void __init gart_iommu_init(void)
 * the backing memory. The GART address is only used by PCI
 * devices.
 */
-   clear_kernel_mapping((unsigned long)__va(iommu_bus_base), iommu_size);
+   set_memory_np((unsigned long)__va(iommu_bus_base),
+   iommu_size  PAGE_SHIFT);
 
/*
 * Try to workaround a bug (thanks to BenH)
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86: fix pci-gart failure handling

2007-10-26 Thread Jens Axboe
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 <[EMAIL PROTECTED]>

Thanks Tomo, applied!

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86: fix pci-gart failure handling

2007-10-26 Thread Jens Axboe
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 [EMAIL PROTECTED]

Thanks Tomo, applied!

-- 
Jens Axboe

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] x86: fix pci-gart failure handling

2007-10-25 Thread FUJITA Tomonori
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 <[EMAIL PROTECTED]>
---
 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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] x86: fix pci-gart failure handling

2007-10-25 Thread FUJITA Tomonori
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 [EMAIL PROTECTED]
---
 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

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH -mm 03/11] x86: make pci-gart iommu respect the segment size limits

2007-10-24 Thread FUJITA Tomonori
This patch makes pci-gart iommu respect segment size limits when
merging sg lists.

Signed-off-by: FUJITA Tomonori <[EMAIL PROTECTED]>
---
 arch/x86/kernel/pci-gart_64.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
index c56e9ee..dfe3828 100644
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -384,6 +384,8 @@ static int gart_map_sg(struct device *dev, struct 
scatterlist *sg, int nents,
int start;
unsigned long pages = 0;
int need = 0, nextneed;
+   unsigned int seg_size;
+   unsigned int max_seg_size;
struct scatterlist *s, *ps, *start_sg, *sgmap;
 
if (nents == 0) 
@@ -395,6 +397,8 @@ static int gart_map_sg(struct device *dev, struct 
scatterlist *sg, int nents,
out = 0;
start = 0;
start_sg = sgmap = sg;
+   seg_size = 0;
+   max_seg_size = dma_get_max_seg_size(dev);
ps = NULL; /* shut up gcc */
for_each_sg(sg, s, nents, i) {
dma_addr_t addr = sg_phys(s);
@@ -408,11 +412,13 @@ static int gart_map_sg(struct device *dev, struct 
scatterlist *sg, int nents,
/* Can only merge when the last chunk ends on a page 
   boundary and the new one doesn't have an offset. */
if (!iommu_merge || !nextneed || !need || s->offset ||
+   (s->length + seg_size > max_seg_size) ||
(ps->offset + ps->length) % PAGE_SIZE) {
if (dma_map_cont(start_sg, i - start, sgmap,
  pages, need) < 0)
goto error;
out++;
+   seg_size = 0;
sgmap = sg_next(sgmap);
pages = 0;
start = i;
@@ -420,6 +426,7 @@ static int gart_map_sg(struct device *dev, struct 
scatterlist *sg, int nents,
}
}
 
+   seg_size += s->length;
need = nextneed;
pages += to_pages(s->offset, s->length);
ps = s;
-- 
1.5.2.4

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH -mm 03/11] x86: make pci-gart iommu respect the segment size limits

2007-10-24 Thread FUJITA Tomonori
This patch makes pci-gart iommu respect segment size limits when
merging sg lists.

Signed-off-by: FUJITA Tomonori [EMAIL PROTECTED]
---
 arch/x86/kernel/pci-gart_64.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
index c56e9ee..dfe3828 100644
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -384,6 +384,8 @@ static int gart_map_sg(struct device *dev, struct 
scatterlist *sg, int nents,
int start;
unsigned long pages = 0;
int need = 0, nextneed;
+   unsigned int seg_size;
+   unsigned int max_seg_size;
struct scatterlist *s, *ps, *start_sg, *sgmap;
 
if (nents == 0) 
@@ -395,6 +397,8 @@ static int gart_map_sg(struct device *dev, struct 
scatterlist *sg, int nents,
out = 0;
start = 0;
start_sg = sgmap = sg;
+   seg_size = 0;
+   max_seg_size = dma_get_max_seg_size(dev);
ps = NULL; /* shut up gcc */
for_each_sg(sg, s, nents, i) {
dma_addr_t addr = sg_phys(s);
@@ -408,11 +412,13 @@ static int gart_map_sg(struct device *dev, struct 
scatterlist *sg, int nents,
/* Can only merge when the last chunk ends on a page 
   boundary and the new one doesn't have an offset. */
if (!iommu_merge || !nextneed || !need || s-offset ||
+   (s-length + seg_size  max_seg_size) ||
(ps-offset + ps-length) % PAGE_SIZE) {
if (dma_map_cont(start_sg, i - start, sgmap,
  pages, need)  0)
goto error;
out++;
+   seg_size = 0;
sgmap = sg_next(sgmap);
pages = 0;
start = i;
@@ -420,6 +426,7 @@ static int gart_map_sg(struct device *dev, struct 
scatterlist *sg, int nents,
}
}
 
+   seg_size += s-length;
need = nextneed;
pages += to_pages(s-offset, s-length);
ps = s;
-- 
1.5.2.4

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86-64: pci-gart iommu sg chaining zeroes wrong sg.

2007-09-30 Thread Benny Halevy
On Sep 27, 2007, 18:46 +0200, FUJITA Tomonori <[EMAIL PROTECTED]> wrote:
> On Fri, 28 Sep 2007 01:38:27 +0900
> FUJITA Tomonori <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>
>> 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 <[EMAIL PROTECTED]>
>> ---
>>  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 [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86-64: pci-gart iommu sg chaining zeroes wrong sg.

2007-09-30 Thread Benny Halevy
On Sep 27, 2007, 18:46 +0200, FUJITA Tomonori [EMAIL PROTECTED] wrote:
 On Fri, 28 Sep 2007 01:38:27 +0900
 FUJITA Tomonori [EMAIL PROTECTED] 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 [EMAIL PROTECTED]
 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 [EMAIL PROTECTED]
 ---
  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 [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86-64: pci-gart iommu sg chaining zeroes wrong sg.

2007-09-27 Thread FUJITA Tomonori
On Fri, 28 Sep 2007 01:38:27 +0900
FUJITA Tomonori <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>
> 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 <[EMAIL PROTECTED]>
> ---
>  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:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] x86-64: pci-gart iommu sg chaining zeroes wrong sg.

2007-09-27 Thread 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 <[EMAIL PROTECTED]>
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 <[EMAIL PROTECTED]>
---
 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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] x86-64: pci-gart iommu sg chaining zeroes wrong sg.

2007-09-27 Thread 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 [EMAIL PROTECTED]
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 [EMAIL PROTECTED]
---
 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

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86-64: pci-gart iommu sg chaining zeroes wrong sg.

2007-09-27 Thread FUJITA Tomonori
On Fri, 28 Sep 2007 01:38:27 +0900
FUJITA Tomonori [EMAIL PROTECTED] 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 [EMAIL PROTECTED]
 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 [EMAIL PROTECTED]
 ---
  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:
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [21/45] x86_64: Some cleanups for pci gart code

2007-09-21 Thread Andi Kleen

- Mark function static
- Clarify license

Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>

---
 arch/x86_64/kernel/pci-gart.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux/arch/x86_64/kernel/pci-gart.c
===
--- linux.orig/arch/x86_64/kernel/pci-gart.c
+++ linux/arch/x86_64/kernel/pci-gart.c
@@ -8,6 +8,7 @@
  * See Documentation/DMA-mapping.txt for the interface specification.
  * 
  * Copyright 2002 Andi Kleen, SuSE Labs.
+ * Subject to the GNU General Public License v2 only.
  */
 
 #include 
@@ -374,7 +375,8 @@ static inline int dma_map_cont(struct sc
  * DMA map all entries in a scatterlist.
  * Merge chunks that have page aligned sizes into a continuous mapping. 
  */
-int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, int dir)
+static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents,
+   int dir)
 {
int i;
int out;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: PCI GART (?)

2001-02-13 Thread Ion Badulescu

On Tue, 13 Feb 2001 12:09:32 + (GMT), Michèl Alexandre Salim 
<[EMAIL PROTECTED]> wrote:

> Currently running the XFree 4.0.2 from RH 7.0.90 (7.1
> beta, Fisher) on top of my RH 7 + Ximian system and
> when using aviplay it doesn't use any acceleration
> features at all, consequently choppy display. The same
> file plays much better in Windows.

Get the XFree ati.2 drivers from http://www.linuxvideo.org/gatos/,
and you will have hardware scaling. DRI is not supported yet.

> Xdpyinfo shows that Xvideo and Xrender are both
> loaded, so I presume they *should* work.

xvinfo is a bit more informative about these things.

Ion

-- 
  It is better to keep your mouth shut and be thought a fool,
than to open it and remove all doubt.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: PCI GART (?)

2001-02-13 Thread Benjamin Herrenschmidt

>> I have RTFM but on the matter of enabling DRI for the
>> ATI Mobility video chipset, which on that notebook is
>> a PCI model, there is practically nil information. The
>> DRI website mentions using PCI GART, but there is no
>> option for that in the kernel. How do I enable this?
>
>You need to get XFree86 CVS and really the right place to ask
>is the XFree86 folks. The standard kernel doesnt include pcigart

Michel, FYI, PCI GART is a feature of the video chipset, not the host
bridge, and so is not directly related to the kernel (there's no generic
PCI GART driver like there is an AGP GART driver). AFAIK, the only PCI
GART implementation so far is for rage 128 (or derived, like the M3), and
is available in the "ati-pcigart-0-0-1-branch" DRI CVS branch. You need
to compile the DRM inside this X server version, not the kernel one.

Ben.



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: PCI GART (?)

2001-02-13 Thread Mike A. Harris

On Tue, 13 Feb 2001, Michèl Alexandre Salim wrote:

>This might not be the proper place to ask - my
>apologies - but since it pertains to the Sony
>Picturebook (C1VE - Crusoe) that people have been
>discussing on this list anyway, I hope people don't
>mind too much :)
>
>I have RTFM but on the matter of enabling DRI for the
>ATI Mobility video chipset, which on that notebook is
>a PCI model, there is practically nil information. The
>DRI website mentions using PCI GART, but there is no
>option for that in the kernel. How do I enable this?
>
>Currently running the XFree 4.0.2 from RH 7.0.90 (7.1
>beta, Fisher) on top of my RH 7 + Ximian system and
>when using aviplay it doesn't use any acceleration
>features at all, consequently choppy display. The same
>file plays much better in Windows.
>
>Xdpyinfo shows that Xvideo and Xrender are both
>loaded, so I presume they *should* work.

http://dri.sourceforge.net


--
Mike A. Harris  Shipping/mailing address:
OS Systems Engineer 190 Pittsburgh Ave., Sault Ste. Marie,
Red Hat Inc.Ontario, Canada, P6C 5B3
http://www.redhat.com   Phone: (705)949-2136

"If it isn't source, it isn't software."  -- NASA

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: PCI GART (?)

2001-02-13 Thread Alan Cox

> I have RTFM but on the matter of enabling DRI for the
> ATI Mobility video chipset, which on that notebook is
> a PCI model, there is practically nil information. The
> DRI website mentions using PCI GART, but there is no
> option for that in the kernel. How do I enable this?

You need to get XFree86 CVS and really the right place to ask
is the XFree86 folks. The standard kernel doesnt include pcigart

> Xdpyinfo shows that Xvideo and Xrender are both
> loaded, so I presume they *should* work.

Could be your aviplay doesnt support it.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



PCI GART (?)

2001-02-13 Thread Michèl Alexandre Salim

Hello,

This might not be the proper place to ask - my
apologies - but since it pertains to the Sony
Picturebook (C1VE - Crusoe) that people have been
discussing on this list anyway, I hope people don't
mind too much :)

I have RTFM but on the matter of enabling DRI for the
ATI Mobility video chipset, which on that notebook is
a PCI model, there is practically nil information. The
DRI website mentions using PCI GART, but there is no
option for that in the kernel. How do I enable this?

Currently running the XFree 4.0.2 from RH 7.0.90 (7.1
beta, Fisher) on top of my RH 7 + Ximian system and
when using aviplay it doesn't use any acceleration
features at all, consequently choppy display. The same
file plays much better in Windows.

Xdpyinfo shows that Xvideo and Xrender are both
loaded, so I presume they *should* work.

Thanks in advance,

Michel Salim


Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



PCI GART (?)

2001-02-13 Thread Michèl Alexandre Salim

Hello,

This might not be the proper place to ask - my
apologies - but since it pertains to the Sony
Picturebook (C1VE - Crusoe) that people have been
discussing on this list anyway, I hope people don't
mind too much :)

I have RTFM but on the matter of enabling DRI for the
ATI Mobility video chipset, which on that notebook is
a PCI model, there is practically nil information. The
DRI website mentions using PCI GART, but there is no
option for that in the kernel. How do I enable this?

Currently running the XFree 4.0.2 from RH 7.0.90 (7.1
beta, Fisher) on top of my RH 7 + Ximian system and
when using aviplay it doesn't use any acceleration
features at all, consequently choppy display. The same
file plays much better in Windows.

Xdpyinfo shows that Xvideo and Xrender are both
loaded, so I presume they *should* work.

Thanks in advance,

Michel Salim


Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: PCI GART (?)

2001-02-13 Thread Alan Cox

 I have RTFM but on the matter of enabling DRI for the
 ATI Mobility video chipset, which on that notebook is
 a PCI model, there is practically nil information. The
 DRI website mentions using PCI GART, but there is no
 option for that in the kernel. How do I enable this?

You need to get XFree86 CVS and really the right place to ask
is the XFree86 folks. The standard kernel doesnt include pcigart

 Xdpyinfo shows that Xvideo and Xrender are both
 loaded, so I presume they *should* work.

Could be your aviplay doesnt support it.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: PCI GART (?)

2001-02-13 Thread Mike A. Harris

On Tue, 13 Feb 2001, Michl Alexandre Salim wrote:

This might not be the proper place to ask - my
apologies - but since it pertains to the Sony
Picturebook (C1VE - Crusoe) that people have been
discussing on this list anyway, I hope people don't
mind too much :)

I have RTFM but on the matter of enabling DRI for the
ATI Mobility video chipset, which on that notebook is
a PCI model, there is practically nil information. The
DRI website mentions using PCI GART, but there is no
option for that in the kernel. How do I enable this?

Currently running the XFree 4.0.2 from RH 7.0.90 (7.1
beta, Fisher) on top of my RH 7 + Ximian system and
when using aviplay it doesn't use any acceleration
features at all, consequently choppy display. The same
file plays much better in Windows.

Xdpyinfo shows that Xvideo and Xrender are both
loaded, so I presume they *should* work.

http://dri.sourceforge.net


--
Mike A. Harris  Shipping/mailing address:
OS Systems Engineer 190 Pittsburgh Ave., Sault Ste. Marie,
Red Hat Inc.Ontario, Canada, P6C 5B3
http://www.redhat.com   Phone: (705)949-2136

"If it isn't source, it isn't software."  -- NASA

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: PCI GART (?)

2001-02-13 Thread Benjamin Herrenschmidt

 I have RTFM but on the matter of enabling DRI for the
 ATI Mobility video chipset, which on that notebook is
 a PCI model, there is practically nil information. The
 DRI website mentions using PCI GART, but there is no
 option for that in the kernel. How do I enable this?

You need to get XFree86 CVS and really the right place to ask
is the XFree86 folks. The standard kernel doesnt include pcigart

Michel, FYI, PCI GART is a feature of the video chipset, not the host
bridge, and so is not directly related to the kernel (there's no generic
PCI GART driver like there is an AGP GART driver). AFAIK, the only PCI
GART implementation so far is for rage 128 (or derived, like the M3), and
is available in the "ati-pcigart-0-0-1-branch" DRI CVS branch. You need
to compile the DRM inside this X server version, not the kernel one.

Ben.



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/