Skip to content

Commit 30fb8a7

Browse files
Nitin Guptagregkh
authored andcommitted
Staging: ramzswap: remove ARM specific d-cache hack
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: 787b2fa 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>
1 parent 3d8affc commit 30fb8a7

2 files changed

Lines changed: 3 additions & 26 deletions

File tree

‎drivers/staging/ramzswap/TODO‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
TODO:
22
- Add support for swap notifiers
3-
- Remove CONFIG_ARM hack
43

54
Please send patches to Greg Kroah-Hartman <greg@kroah.com> and
65
Nitin Gupta <ngupta@vflare.org>

‎drivers/staging/ramzswap/ramzswap_drv.c‎

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -222,28 +222,6 @@ static int setup_swap_header(struct ramzswap *rzs, union swap_header *s)
222222
return ret;
223223
}
224224

225-
static void ramzswap_flush_dcache_page(struct page *page)
226-
{
227-
#ifdef CONFIG_ARM
228-
int flag = 0;
229-
/*
230-
* Ugly hack to get flush_dcache_page() work on ARM.
231-
* page_mapping(page) == NULL after clearing this swap cache flag.
232-
* Without clearing this flag, flush_dcache_page() will simply set
233-
* "PG_dcache_dirty" bit and return.
234-
*/
235-
if (PageSwapCache(page)) {
236-
flag = 1;
237-
ClearPageSwapCache(page);
238-
}
239-
#endif
240-
flush_dcache_page(page);
241-
#ifdef CONFIG_ARM
242-
if (flag)
243-
SetPageSwapCache(page);
244-
#endif
245-
}
246-
247225
void ramzswap_ioctl_get_stats(struct ramzswap *rzs,
248226
struct ramzswap_ioctl_stats *s)
249227
{
@@ -655,7 +633,7 @@ static int handle_zero_page(struct bio *bio)
655633
memset(user_mem, 0, PAGE_SIZE);
656634
kunmap_atomic(user_mem, KM_USER0);
657635

658-
ramzswap_flush_dcache_page(page);
636+
flush_dcache_page(page);
659637

660638
set_bit(BIO_UPTODATE, &bio->bi_flags);
661639
bio_endio(bio, 0);
@@ -679,7 +657,7 @@ static int handle_uncompressed_page(struct ramzswap *rzs, struct bio *bio)
679657
kunmap_atomic(user_mem, KM_USER0);
680658
kunmap_atomic(cmem, KM_USER1);
681659

682-
ramzswap_flush_dcache_page(page);
660+
flush_dcache_page(page);
683661

684662
set_bit(BIO_UPTODATE, &bio->bi_flags);
685663
bio_endio(bio, 0);
@@ -779,7 +757,7 @@ static int ramzswap_read(struct ramzswap *rzs, struct bio *bio)
779757
goto out;
780758
}
781759

782-
ramzswap_flush_dcache_page(page);
760+
flush_dcache_page(page);
783761

784762
set_bit(BIO_UPTODATE, &bio->bi_flags);
785763
bio_endio(bio, 0);

0 commit comments

Comments
 (0)