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 <[email protected]>
Cc: Vandana BN <[email protected]>
Cc: "Simon Sandström" <[email protected]>
Cc: Dan Carpenter <[email protected]>
Cc: Nishka Dasgupta <[email protected]>
Cc: Madhumitha Prabakaran <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Matt Sickler <[email protected]>
Cc: Jeremy Sowden <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
---
 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
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to