All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ramzswap: remove ARM specific d-cache hack
@ 2009-12-12  6:14 Nitin Gupta
  2009-12-12  7:41 ` Pekka Enberg
  2009-12-18 19:33 ` patch staging-ramzswap-remove-arm-specific-d-cache-hack.patch added to gregkh-2.6 tree gregkh
  0 siblings, 2 replies; 6+ messages in thread
From: Nitin Gupta @ 2009-12-12  6:14 UTC (permalink / raw
  To: Greg KH; +Cc: Andrew Morton, linux-kernel

Remove d-cache hack in ramzswap driver that was needed
to workaround a bug in ARM version of update_mmu_cache()
which caused stale data in d-cache to be transferred to
userspace. This bug was fixed by git commit:
	787b2faadc4356b6c2c71feb42fb944fece9a12f
This also brings down one entry in TODO file.

Signed-off-by: Nitin Gupta <ngupta@vflare.org>
---
 drivers/staging/ramzswap/TODO           |    1 -
 drivers/staging/ramzswap/ramzswap_drv.c |   28 +++-------------------------
 2 files changed, 3 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/ramzswap/TODO b/drivers/staging/ramzswap/TODO
index bac40d6..8d64e28 100644
--- a/drivers/staging/ramzswap/TODO
+++ b/drivers/staging/ramzswap/TODO
@@ -1,6 +1,5 @@
 TODO:
 	- Add support for swap notifiers
-	- Remove CONFIG_ARM hack
 
 Please send patches to Greg Kroah-Hartman <greg@kroah.com> and
 Nitin Gupta <ngupta@vflare.org>
diff --git a/drivers/staging/ramzswap/ramzswap_drv.c b/drivers/staging/ramzswap/ramzswap_drv.c
index b839f05..989fac5 100644
--- a/drivers/staging/ramzswap/ramzswap_drv.c
+++ b/drivers/staging/ramzswap/ramzswap_drv.c
@@ -222,28 +222,6 @@ out:
 	return ret;
 }
 
-static void ramzswap_flush_dcache_page(struct page *page)
-{
-#ifdef CONFIG_ARM
-	int flag = 0;
-	/*
-	 * Ugly hack to get flush_dcache_page() work on ARM.
-	 * page_mapping(page) == NULL after clearing this swap cache flag.
-	 * Without clearing this flag, flush_dcache_page() will simply set
-	 * "PG_dcache_dirty" bit and return.
-	 */
-	if (PageSwapCache(page)) {
-		flag = 1;
-		ClearPageSwapCache(page);
-	}
-#endif
-	flush_dcache_page(page);
-#ifdef CONFIG_ARM
-	if (flag)
-		SetPageSwapCache(page);
-#endif
-}
-
 void ramzswap_ioctl_get_stats(struct ramzswap *rzs,
 			struct ramzswap_ioctl_stats *s)
 {
@@ -655,7 +633,7 @@ static int handle_zero_page(struct bio *bio)
 	memset(user_mem, 0, PAGE_SIZE);
 	kunmap_atomic(user_mem, KM_USER0);
 
-	ramzswap_flush_dcache_page(page);
+	flush_dcache_page(page);
 
 	set_bit(BIO_UPTODATE, &bio->bi_flags);
 	bio_endio(bio, 0);
@@ -679,7 +657,7 @@ static int handle_uncompressed_page(struct ramzswap *rzs, struct bio *bio)
 	kunmap_atomic(user_mem, KM_USER0);
 	kunmap_atomic(cmem, KM_USER1);
 
-	ramzswap_flush_dcache_page(page);
+	flush_dcache_page(page);
 
 	set_bit(BIO_UPTODATE, &bio->bi_flags);
 	bio_endio(bio, 0);
@@ -779,7 +757,7 @@ static int ramzswap_read(struct ramzswap *rzs, struct bio *bio)
 		goto out;
 	}
 
-	ramzswap_flush_dcache_page(page);
+	flush_dcache_page(page);
 
 	set_bit(BIO_UPTODATE, &bio->bi_flags);
 	bio_endio(bio, 0);

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

* Re: [PATCH] ramzswap: remove ARM specific d-cache hack
  2009-12-12  6:14 [PATCH] ramzswap: remove ARM specific d-cache hack Nitin Gupta
@ 2009-12-12  7:41 ` Pekka Enberg
  2009-12-13  1:21   ` Nitin Gupta
  2009-12-18 19:33 ` patch staging-ramzswap-remove-arm-specific-d-cache-hack.patch added to gregkh-2.6 tree gregkh
  1 sibling, 1 reply; 6+ messages in thread
From: Pekka Enberg @ 2009-12-12  7:41 UTC (permalink / raw
  To: Nitin Gupta; +Cc: Greg KH, Andrew Morton, linux-kernel

On Sat, Dec 12, 2009 at 8:14 AM, Nitin Gupta <ngupta@vflare.org> wrote:
> Remove d-cache hack in ramzswap driver that was needed
> to workaround a bug in ARM version of update_mmu_cache()
> which caused stale data in d-cache to be transferred to
> userspace. This bug was fixed by git commit:
>        787b2faadc4356b6c2c71feb42fb944fece9a12f
> This also brings down one entry in TODO file.
>
> Signed-off-by: Nitin Gupta <ngupta@vflare.org>

Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>

> ---
>  drivers/staging/ramzswap/TODO           |    1 -
>  drivers/staging/ramzswap/ramzswap_drv.c |   28 +++-------------------------
>  2 files changed, 3 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/staging/ramzswap/TODO b/drivers/staging/ramzswap/TODO
> index bac40d6..8d64e28 100644
> --- a/drivers/staging/ramzswap/TODO
> +++ b/drivers/staging/ramzswap/TODO
> @@ -1,6 +1,5 @@
>  TODO:
>        - Add support for swap notifiers
> -       - Remove CONFIG_ARM hack
>
>  Please send patches to Greg Kroah-Hartman <greg@kroah.com> and
>  Nitin Gupta <ngupta@vflare.org>
> diff --git a/drivers/staging/ramzswap/ramzswap_drv.c b/drivers/staging/ramzswap/ramzswap_drv.c
> index b839f05..989fac5 100644
> --- a/drivers/staging/ramzswap/ramzswap_drv.c
> +++ b/drivers/staging/ramzswap/ramzswap_drv.c
> @@ -222,28 +222,6 @@ out:
>        return ret;
>  }
>
> -static void ramzswap_flush_dcache_page(struct page *page)
> -{
> -#ifdef CONFIG_ARM
> -       int flag = 0;
> -       /*
> -        * Ugly hack to get flush_dcache_page() work on ARM.
> -        * page_mapping(page) == NULL after clearing this swap cache flag.
> -        * Without clearing this flag, flush_dcache_page() will simply set
> -        * "PG_dcache_dirty" bit and return.
> -        */
> -       if (PageSwapCache(page)) {
> -               flag = 1;
> -               ClearPageSwapCache(page);
> -       }
> -#endif
> -       flush_dcache_page(page);
> -#ifdef CONFIG_ARM
> -       if (flag)
> -               SetPageSwapCache(page);
> -#endif
> -}
> -
>  void ramzswap_ioctl_get_stats(struct ramzswap *rzs,
>                        struct ramzswap_ioctl_stats *s)
>  {
> @@ -655,7 +633,7 @@ static int handle_zero_page(struct bio *bio)
>        memset(user_mem, 0, PAGE_SIZE);
>        kunmap_atomic(user_mem, KM_USER0);
>
> -       ramzswap_flush_dcache_page(page);
> +       flush_dcache_page(page);
>
>        set_bit(BIO_UPTODATE, &bio->bi_flags);
>        bio_endio(bio, 0);
> @@ -679,7 +657,7 @@ static int handle_uncompressed_page(struct ramzswap *rzs, struct bio *bio)
>        kunmap_atomic(user_mem, KM_USER0);
>        kunmap_atomic(cmem, KM_USER1);
>
> -       ramzswap_flush_dcache_page(page);
> +       flush_dcache_page(page);
>
>        set_bit(BIO_UPTODATE, &bio->bi_flags);
>        bio_endio(bio, 0);
> @@ -779,7 +757,7 @@ static int ramzswap_read(struct ramzswap *rzs, struct bio *bio)
>                goto out;
>        }
>
> -       ramzswap_flush_dcache_page(page);
> +       flush_dcache_page(page);
>
>        set_bit(BIO_UPTODATE, &bio->bi_flags);
>        bio_endio(bio, 0);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

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

* Re: [PATCH] ramzswap: remove ARM specific d-cache hack
  2009-12-12  7:41 ` Pekka Enberg
@ 2009-12-13  1:21   ` Nitin Gupta
  2009-12-13 20:36     ` Pekka Enberg
  0 siblings, 1 reply; 6+ messages in thread
From: Nitin Gupta @ 2009-12-13  1:21 UTC (permalink / raw
  To: Pekka Enberg; +Cc: Greg KH, Andrew Morton, linux-kernel

On 12/12/2009 01:11 PM, Pekka Enberg wrote:
> On Sat, Dec 12, 2009 at 8:14 AM, Nitin Gupta <ngupta@vflare.org> wrote:
>> Remove d-cache hack in ramzswap driver that was needed
>> to workaround a bug in ARM version of update_mmu_cache()
>> which caused stale data in d-cache to be transferred to
>> userspace. This bug was fixed by git commit:
>>        787b2faadc4356b6c2c71feb42fb944fece9a12f
>> This also brings down one entry in TODO file.
>>
>> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
> 
> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>

Thanks for review Pekka.
Now wondering when this patch will be committed to mainline.

Nitin

> 
>> ---
>>  drivers/staging/ramzswap/TODO           |    1 -
>>  drivers/staging/ramzswap/ramzswap_drv.c |   28 +++-------------------------
>>  2 files changed, 3 insertions(+), 26 deletions(-)
>>
>> diff --git a/drivers/staging/ramzswap/TODO b/drivers/staging/ramzswap/TODO
>> index bac40d6..8d64e28 100644
>> --- a/drivers/staging/ramzswap/TODO
>> +++ b/drivers/staging/ramzswap/TODO
>> @@ -1,6 +1,5 @@
>>  TODO:
>>        - Add support for swap notifiers
>> -       - Remove CONFIG_ARM hack
>>
>>  Please send patches to Greg Kroah-Hartman <greg@kroah.com> and
>>  Nitin Gupta <ngupta@vflare.org>
>> diff --git a/drivers/staging/ramzswap/ramzswap_drv.c b/drivers/staging/ramzswap/ramzswap_drv.c
>> index b839f05..989fac5 100644
>> --- a/drivers/staging/ramzswap/ramzswap_drv.c
>> +++ b/drivers/staging/ramzswap/ramzswap_drv.c
>> @@ -222,28 +222,6 @@ out:
>>        return ret;
>>  }
>>
>> -static void ramzswap_flush_dcache_page(struct page *page)
>> -{
>> -#ifdef CONFIG_ARM
>> -       int flag = 0;
>> -       /*
>> -        * Ugly hack to get flush_dcache_page() work on ARM.
>> -        * page_mapping(page) == NULL after clearing this swap cache flag.
>> -        * Without clearing this flag, flush_dcache_page() will simply set
>> -        * "PG_dcache_dirty" bit and return.
>> -        */
>> -       if (PageSwapCache(page)) {
>> -               flag = 1;
>> -               ClearPageSwapCache(page);
>> -       }
>> -#endif
>> -       flush_dcache_page(page);
>> -#ifdef CONFIG_ARM
>> -       if (flag)
>> -               SetPageSwapCache(page);
>> -#endif
>> -}
>> -
>>  void ramzswap_ioctl_get_stats(struct ramzswap *rzs,
>>                        struct ramzswap_ioctl_stats *s)
>>  {
>> @@ -655,7 +633,7 @@ static int handle_zero_page(struct bio *bio)
>>        memset(user_mem, 0, PAGE_SIZE);
>>        kunmap_atomic(user_mem, KM_USER0);
>>
>> -       ramzswap_flush_dcache_page(page);
>> +       flush_dcache_page(page);
>>
>>        set_bit(BIO_UPTODATE, &bio->bi_flags);
>>        bio_endio(bio, 0);
>> @@ -679,7 +657,7 @@ static int handle_uncompressed_page(struct ramzswap *rzs, struct bio *bio)
>>        kunmap_atomic(user_mem, KM_USER0);
>>        kunmap_atomic(cmem, KM_USER1);
>>
>> -       ramzswap_flush_dcache_page(page);
>> +       flush_dcache_page(page);
>>
>>        set_bit(BIO_UPTODATE, &bio->bi_flags);
>>        bio_endio(bio, 0);
>> @@ -779,7 +757,7 @@ static int ramzswap_read(struct ramzswap *rzs, struct bio *bio)
>>                goto out;
>>        }
>>
>> -       ramzswap_flush_dcache_page(page);
>> +       flush_dcache_page(page);
>>
>>        set_bit(BIO_UPTODATE, &bio->bi_flags);
>>        bio_endio(bio, 0);
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>>
> 


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

* Re: [PATCH] ramzswap: remove ARM specific d-cache hack
  2009-12-13  1:21   ` Nitin Gupta
@ 2009-12-13 20:36     ` Pekka Enberg
  2009-12-14 15:18       ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Pekka Enberg @ 2009-12-13 20:36 UTC (permalink / raw
  To: ngupta; +Cc: Greg KH, Andrew Morton, linux-kernel

On Sun, Dec 13, 2009 at 3:21 AM, Nitin Gupta <ngupta@vflare.org> wrote:
> On 12/12/2009 01:11 PM, Pekka Enberg wrote:
>> On Sat, Dec 12, 2009 at 8:14 AM, Nitin Gupta <ngupta@vflare.org> wrote:
>>> Remove d-cache hack in ramzswap driver that was needed
>>> to workaround a bug in ARM version of update_mmu_cache()
>>> which caused stale data in d-cache to be transferred to
>>> userspace. This bug was fixed by git commit:
>>>        787b2faadc4356b6c2c71feb42fb944fece9a12f
>>> This also brings down one entry in TODO file.
>>>
>>> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
>>
>> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
>
> Thanks for review Pekka.
> Now wondering when this patch will be committed to mainline.

I don't see any reason why this shouldn't go into .33 but that's
really up to Greg.

                      Pekka

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

* Re: [PATCH] ramzswap: remove ARM specific d-cache hack
  2009-12-13 20:36     ` Pekka Enberg
@ 2009-12-14 15:18       ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2009-12-14 15:18 UTC (permalink / raw
  To: Pekka Enberg; +Cc: ngupta, Andrew Morton, linux-kernel

On Sun, Dec 13, 2009 at 10:36:26PM +0200, Pekka Enberg wrote:
> On Sun, Dec 13, 2009 at 3:21 AM, Nitin Gupta <ngupta@vflare.org> wrote:
> > On 12/12/2009 01:11 PM, Pekka Enberg wrote:
> >> On Sat, Dec 12, 2009 at 8:14 AM, Nitin Gupta <ngupta@vflare.org> wrote:
> >>> Remove d-cache hack in ramzswap driver that was needed
> >>> to workaround a bug in ARM version of update_mmu_cache()
> >>> which caused stale data in d-cache to be transferred to
> >>> userspace. This bug was fixed by git commit:
> >>> ? ? ? ?787b2faadc4356b6c2c71feb42fb944fece9a12f
> >>> This also brings down one entry in TODO file.
> >>>
> >>> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
> >>
> >> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
> >
> > Thanks for review Pekka.
> > Now wondering when this patch will be committed to mainline.
> 
> I don't see any reason why this shouldn't go into .33 but that's
> really up to Greg.

It will end up there, thanks, I will queue it up in a few days to go
there.

thanks,

greg k-h

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

* patch staging-ramzswap-remove-arm-specific-d-cache-hack.patch added to gregkh-2.6 tree
  2009-12-12  6:14 [PATCH] ramzswap: remove ARM specific d-cache hack Nitin Gupta
  2009-12-12  7:41 ` Pekka Enberg
@ 2009-12-18 19:33 ` gregkh
  1 sibling, 0 replies; 6+ messages in thread
From: gregkh @ 2009-12-18 19:33 UTC (permalink / raw
  To: ngupta, akpm, gregkh, greg, linux-kernel, penberg


This is a note to let you know that I've just added the patch titled

    Subject: Staging: ramzswap: remove ARM specific d-cache hack

to my gregkh-2.6 tree.  Its filename is

    staging-ramzswap-remove-arm-specific-d-cache-hack.patch

This tree can be found at 
    http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/


>From ngupta@vflare.org  Fri Dec 18 10:22:00 2009
From: Nitin Gupta <ngupta@vflare.org>
Date: Sat, 12 Dec 2009 11:44:46 +0530
Subject: Staging: ramzswap: remove ARM specific d-cache hack
To: Greg KH <greg@kroah.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel <linux-kernel@vger.kernel.org>
Message-ID: <1260598486-12623-1-git-send-email-ngupta@vflare.org>


Remove d-cache hack in ramzswap driver that was needed
to workaround a bug in ARM version of update_mmu_cache()
which caused stale data in d-cache to be transferred to
userspace. This bug was fixed by git commit:
	787b2faadc4356b6c2c71feb42fb944fece9a12f
This also brings down one entry in TODO file.

Signed-off-by: Nitin Gupta <ngupta@vflare.org>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/staging/ramzswap/TODO           |    1 -
 drivers/staging/ramzswap/ramzswap_drv.c |   28 +++-------------------------
 2 files changed, 3 insertions(+), 26 deletions(-)

--- a/drivers/staging/ramzswap/ramzswap_drv.c
+++ b/drivers/staging/ramzswap/ramzswap_drv.c
@@ -222,28 +222,6 @@ out:
 	return ret;
 }
 
-static void ramzswap_flush_dcache_page(struct page *page)
-{
-#ifdef CONFIG_ARM
-	int flag = 0;
-	/*
-	 * Ugly hack to get flush_dcache_page() work on ARM.
-	 * page_mapping(page) == NULL after clearing this swap cache flag.
-	 * Without clearing this flag, flush_dcache_page() will simply set
-	 * "PG_dcache_dirty" bit and return.
-	 */
-	if (PageSwapCache(page)) {
-		flag = 1;
-		ClearPageSwapCache(page);
-	}
-#endif
-	flush_dcache_page(page);
-#ifdef CONFIG_ARM
-	if (flag)
-		SetPageSwapCache(page);
-#endif
-}
-
 void ramzswap_ioctl_get_stats(struct ramzswap *rzs,
 			struct ramzswap_ioctl_stats *s)
 {
@@ -655,7 +633,7 @@ static int handle_zero_page(struct bio *
 	memset(user_mem, 0, PAGE_SIZE);
 	kunmap_atomic(user_mem, KM_USER0);
 
-	ramzswap_flush_dcache_page(page);
+	flush_dcache_page(page);
 
 	set_bit(BIO_UPTODATE, &bio->bi_flags);
 	bio_endio(bio, 0);
@@ -679,7 +657,7 @@ static int handle_uncompressed_page(stru
 	kunmap_atomic(user_mem, KM_USER0);
 	kunmap_atomic(cmem, KM_USER1);
 
-	ramzswap_flush_dcache_page(page);
+	flush_dcache_page(page);
 
 	set_bit(BIO_UPTODATE, &bio->bi_flags);
 	bio_endio(bio, 0);
@@ -779,7 +757,7 @@ static int ramzswap_read(struct ramzswap
 		goto out;
 	}
 
-	ramzswap_flush_dcache_page(page);
+	flush_dcache_page(page);
 
 	set_bit(BIO_UPTODATE, &bio->bi_flags);
 	bio_endio(bio, 0);
--- a/drivers/staging/ramzswap/TODO
+++ b/drivers/staging/ramzswap/TODO
@@ -1,6 +1,5 @@
 TODO:
 	- Add support for swap notifiers
-	- Remove CONFIG_ARM hack
 
 Please send patches to Greg Kroah-Hartman <greg@kroah.com> and
 Nitin Gupta <ngupta@vflare.org>


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

end of thread, other threads:[~2009-12-18 19:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-12  6:14 [PATCH] ramzswap: remove ARM specific d-cache hack Nitin Gupta
2009-12-12  7:41 ` Pekka Enberg
2009-12-13  1:21   ` Nitin Gupta
2009-12-13 20:36     ` Pekka Enberg
2009-12-14 15:18       ` Greg KH
2009-12-18 19:33 ` patch staging-ramzswap-remove-arm-specific-d-cache-hack.patch added to gregkh-2.6 tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.