mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] iommu: fix end address of vm area comparation in alloc_iovm_area
@ 2010-08-17  3:51 Guzman Lugo, Fernando
  2010-08-17  4:48 ` Guzman Lugo, Fernando
  0 siblings, 1 reply; 6+ messages in thread
From: Guzman Lugo, Fernando @ 2010-08-17  3:51 UTC (permalink / raw)
  To: linux-omap, linux-kernel; +Cc: Hiroshi.DOYO, Kanigeri, Hari

>From cc48c0adaee97c8385a356aefa5b64a51818b4fd Mon Sep 17 00:00:00 2001
From: Fernando Guzman Lugo <x0095840@ti.com>
Date: Mon, 16 Aug 2010 22:28:24 -0500
Subject: [PATCH] iommu: fix end address of vm area comparation in alloc_iovm_area

End address of the vm area is “start + bytes -1”,
not “start + byte”. This patch fixes that issue by doing
an inclusive comparison with tmp->da_start. This issue
was preventing allocate an area of size exactly the same
than the free area. I did no change the value of da_end
of each vm area because it is used to get area size in
several places.

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
---
 arch/arm/plat-omap/iovmm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
index b8bcad5..8745d4e 100644
--- a/arch/arm/plat-omap/iovmm.c
+++ b/arch/arm/plat-omap/iovmm.c
@@ -295,7 +295,7 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da,
 	prev_end = 0;
 	list_for_each_entry(tmp, &obj->mmap, list) {
 
-		if ((prev_end <= start) && (start + bytes < tmp->da_start))
+		if ((prev_end <= start) && (start + bytes <= tmp->da_start))
 			goto found;
 
 		if (flags & IOVMF_DA_ANON)
-- 
1.7.0.4

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

* RE: [PATCH] iommu: fix end address of vm area comparation in alloc_iovm_area
  2010-08-17  3:51 [PATCH] iommu: fix end address of vm area comparation in alloc_iovm_area Guzman Lugo, Fernando
@ 2010-08-17  4:48 ` Guzman Lugo, Fernando
  2010-08-17  5:27   ` Hiroshi DOYU
  0 siblings, 1 reply; 6+ messages in thread
From: Guzman Lugo, Fernando @ 2010-08-17  4:48 UTC (permalink / raw)
  To: linux-omap, linux-kernel; +Cc: Kanigeri, Hari, Hiroshi.DOYU


There was a mistake with Hiroshi email. Looping in Hiroshi

Sorry for the noise.

Regards,
Fernando.
________________________________________
From: linux-omap-owner@vger.kernel.org [linux-omap-owner@vger.kernel.org] On Behalf Of Guzman Lugo, Fernando [fernando.lugo@ti.com]
Sent: Monday, August 16, 2010 10:51 PM
To: linux-omap@vger.kernel.org; linux-kernel@vger.kernel.org
Cc: Hiroshi.DOYO@nokia.com; Kanigeri, Hari
Subject: [PATCH] iommu: fix end address of vm area comparation in alloc_iovm_area

>From cc48c0adaee97c8385a356aefa5b64a51818b4fd Mon Sep 17 00:00:00 2001
From: Fernando Guzman Lugo <x0095840@ti.com>
Date: Mon, 16 Aug 2010 22:28:24 -0500
Subject: [PATCH] iommu: fix end address of vm area comparation in alloc_iovm_area

End address of the vm area is “start + bytes -1”,
not “start + byte”. This patch fixes that issue by doing
an inclusive comparison with tmp->da_start. This issue
was preventing allocate an area of size exactly the same
than the free area. I did no change the value of da_end
of each vm area because it is used to get area size in
several places.

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
---
 arch/arm/plat-omap/iovmm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
index b8bcad5..8745d4e 100644
--- a/arch/arm/plat-omap/iovmm.c
+++ b/arch/arm/plat-omap/iovmm.c
@@ -295,7 +295,7 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da,
        prev_end = 0;
        list_for_each_entry(tmp, &obj->mmap, list) {

-               if ((prev_end <= start) && (start + bytes < tmp->da_start))
+               if ((prev_end <= start) && (start + bytes <= tmp->da_start))
                        goto found;

                if (flags & IOVMF_DA_ANON)
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" 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] 6+ messages in thread

* Re: [PATCH] iommu: fix end address of vm area comparation in alloc_iovm_area
  2010-08-17  4:48 ` Guzman Lugo, Fernando
@ 2010-08-17  5:27   ` Hiroshi DOYU
  2010-08-17  6:08     ` Guzman Lugo, Fernando
  0 siblings, 1 reply; 6+ messages in thread
From: Hiroshi DOYU @ 2010-08-17  5:27 UTC (permalink / raw)
  To: fernando.lugo; +Cc: linux-omap, linux-kernel, h-kanigeri2

From: "ext Guzman Lugo, Fernando" <fernando.lugo@ti.com>
Subject: RE: [PATCH] iommu: fix end address of vm area comparation in alloc_iovm_area
Date: Tue, 17 Aug 2010 06:48:14 +0200

> From: linux-omap-owner@vger.kernel.org [linux-omap-owner@vger.kernel.org] On Behalf Of Guzman Lugo, Fernando [fernando.lugo@ti.com]
> Sent: Monday, August 16, 2010 10:51 PM
> To: linux-omap@vger.kernel.org; linux-kernel@vger.kernel.org
> Cc: Hiroshi.DOYO@nokia.com; Kanigeri, Hari
> Subject: [PATCH] iommu: fix end address of vm area comparation in alloc_iovm_area
> 
> From cc48c0adaee97c8385a356aefa5b64a51818b4fd Mon Sep 17 00:00:00 2001
> From: Fernando Guzman Lugo <x0095840@ti.com>
> Date: Mon, 16 Aug 2010 22:28:24 -0500
> Subject: [PATCH] iommu: fix end address of vm area comparation in alloc_iovm_area
> 
> End address of the vm area is “start + bytes -1”,
> not “start + byte”. This patch fixes that issue by doing
> an inclusive comparison with tmp->da_start. This issue
> was preventing allocate an area of size exactly the same
> than the free area. I did no change the value of da_end
> of each vm area because it is used to get area size in
> several places.

Ok for me. Is this patch against the latest?

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

* RE: [PATCH] iommu: fix end address of vm area comparation in alloc_iovm_area
  2010-08-17  5:27   ` Hiroshi DOYU
@ 2010-08-17  6:08     ` Guzman Lugo, Fernando
  0 siblings, 0 replies; 6+ messages in thread
From: Guzman Lugo, Fernando @ 2010-08-17  6:08 UTC (permalink / raw)
  To: Hiroshi DOYU; +Cc: linux-omap, linux-kernel, Kanigeri, Hari


>From: Hiroshi DOYU [Hiroshi.DOYU@nokia.com]
>Sent: Tuesday, August 17, 2010 12:27 AM
>To: Guzman Lugo, Fernando
>Cc: linux-omap@vger.kernel.org; linux-kernel@vger.kernel.org; Kanigeri, Hari
>Subject: Re: [PATCH] iommu: fix end address of vm area comparation in alloc_iovm_area
>
>From: "ext Guzman Lugo, Fernando" <fernando.lugo@ti.com>
>Subject: RE: [PATCH] iommu: fix end address of vm area comparation in alloc_iovm_area
>Date: Tue, 17 Aug 2010 06:48:14 +0200
>
>> From: linux-omap-owner@vger.kernel.org [linux-omap-owner@vger.kernel.org] On Behalf Of Guzman Lugo, Fernando [fernando.lugo@ti.com]
>> Sent: Monday, August 16, 2010 10:51 PM
>> To: linux-omap@vger.kernel.org; linux-kernel@vger.kernel.org
>> Cc: Hiroshi.DOYO@nokia.com; Kanigeri, Hari
>> Subject: [PATCH] iommu: fix end address of vm area comparation in alloc_iovm_area
>>
>> From cc48c0adaee97c8385a356aefa5b64a51818b4fd Mon Sep 17 00:00:00 2001
>> From: Fernando Guzman Lugo <x0095840@ti.com>
>> Date: Mon, 16 Aug 2010 22:28:24 -0500
>> Subject: [PATCH] iommu: fix end address of vm area comparation in alloc_iovm_area
>>
>> End address of the vm area is “start + bytes -1”,
>> not “start + byte”. This patch fixes that issue by doing
>> an inclusive comparison with tmp->da_start. This issue
>> was preventing allocate an area of size exactly the same
>> than the free area. I did no change the value of da_end
>> of each vm area because it is used to get area size in
>> several places.
>
>Ok for me. Is this patch against the latest?

not it isn't, but I don't think it could have issues applying. However I will resend it, base against the latest and include you ack.

Regards,
Fernando.


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

* Re: [PATCH] iommu: fix end address of vm area comparation in alloc_iovm_area
  2010-08-17 16:56 Fernando Guzman Lugo
@ 2010-10-10 16:38 ` Felipe Contreras
  0 siblings, 0 replies; 6+ messages in thread
From: Felipe Contreras @ 2010-10-10 16:38 UTC (permalink / raw)
  To: Fernando Guzman Lugo; +Cc: linux-kernel, linux-omap, Hiroshi.DOYU, h-kanigeri2

On Tue, Aug 17, 2010 at 7:56 PM, Fernando Guzman Lugo <x0095840@ti.com> wrote:
> End address of the vm area is .start + bytes -1., not start + byte.
> This patch fixes that issue by doing an inclusive comparison with
> tmp->da_start. This issue was preventing allocate an area of size
> exactly the same than the free area. I did no change the value of
> da_end of each vm area because it is used to get area size in
> several places.
>
> Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
> Acked-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>

-- 
Felipe Contreras

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

* [PATCH] iommu: fix end address of vm area comparation in alloc_iovm_area
@ 2010-08-17 16:56 Fernando Guzman Lugo
  2010-10-10 16:38 ` Felipe Contreras
  0 siblings, 1 reply; 6+ messages in thread
From: Fernando Guzman Lugo @ 2010-08-17 16:56 UTC (permalink / raw)
  To: linux-kernel, linux-omap; +Cc: Hiroshi.DOYU, h-kanigeri2, Fernando Guzman Lugo

End address of the vm area is .start + bytes -1., not start + byte.
This patch fixes that issue by doing an inclusive comparison with
tmp->da_start. This issue was preventing allocate an area of size
exactly the same than the free area. I did no change the value of
da_end of each vm area because it is used to get area size in
several places.

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Acked-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
---
 arch/arm/plat-omap/iovmm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
index 8ce0de2..24ca9c4 100644
--- a/arch/arm/plat-omap/iovmm.c
+++ b/arch/arm/plat-omap/iovmm.c
@@ -292,7 +292,7 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da,
 		if (prev_end >= start)
 			break;
 
-		if (start + bytes < tmp->da_start)
+		if (start + bytes <= tmp->da_start)
 			goto found;
 
 		if (flags & IOVMF_DA_ANON)
-- 
1.6.3.3


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

end of thread, other threads:[~2010-10-10 16:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-17  3:51 [PATCH] iommu: fix end address of vm area comparation in alloc_iovm_area Guzman Lugo, Fernando
2010-08-17  4:48 ` Guzman Lugo, Fernando
2010-08-17  5:27   ` Hiroshi DOYU
2010-08-17  6:08     ` Guzman Lugo, Fernando
2010-08-17 16:56 Fernando Guzman Lugo
2010-10-10 16:38 ` Felipe Contreras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®