Right now, ZONE_DEVICE memory is always set PG_reserved. We want to
change that.

The pages are obtained via get_user_pages_fast(). I assume, these
could be ZONE_DEVICE pages. Let's just exclude them as well explicitly.

Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
Cc: Vandana BN <bnvand...@gmail.com>
Cc: "Simon Sandström" <si...@nikanor.nu>
Cc: Dan Carpenter <dan.carpen...@oracle.com>
Cc: Nishka Dasgupta <nishkadg.li...@gmail.com>
Cc: Madhumitha Prabakaran <madhumitha...@gmail.com>
Cc: Fabio Estevam <feste...@gmail.com>
Cc: Matt Sickler <matt.sick...@daktronics.com>
Cc: Jeremy Sowden <jer...@azazel.net>
Signed-off-by: David Hildenbrand <da...@redhat.com>
---
 drivers/staging/kpc2000/kpc_dma/fileops.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/kpc2000/kpc_dma/fileops.c 
b/drivers/staging/kpc2000/kpc_dma/fileops.c
index cb52bd9a6d2f..457adcc81fe6 100644
--- a/drivers/staging/kpc2000/kpc_dma/fileops.c
+++ b/drivers/staging/kpc2000/kpc_dma/fileops.c
@@ -212,7 +212,8 @@ void  transfer_complete_cb(struct aio_cb_data *acd, size_t 
xfr_count, u32 flags)
        BUG_ON(acd->ldev->pldev == NULL);
 
        for (i = 0 ; i < acd->page_count ; i++) {
-               if (!PageReserved(acd->user_pages[i])) {
+               if (!PageReserved(acd->user_pages[i]) &&
+                   !is_zone_device_page(acd->user_pages[i])) {
                        set_page_dirty(acd->user_pages[i]);
                }
        }
-- 
2.21.0

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to