Commit b6d13bd9 authored by Souptick Joarder's avatar Souptick Joarder Committed by Greg Kroah-Hartman

staging: kpc2000: kpc_dma: Convert set_page_dirty() --> set_page_dirty_lock()

First, convert set_page_dirty() to set_page_dirty_lock()

Second, there is an interval in there after set_page_dirty() and
before put_page(), in which the device could be running and setting
pages dirty. Moving set_page_dirty_lock() after dma_unmap_sg().
Signed-off-by: default avatarSouptick Joarder <jrdr.linux@gmail.com>
Suggested-by: default avatarJohn Hubbard <jhubbard@nvidia.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Bharath Vedartham <linux.bhar@gmail.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/1593584264-16982-3-git-send-email-jrdr.linux@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 63ed1e02
......@@ -215,13 +215,13 @@ void transfer_complete_cb(struct aio_cb_data *acd, size_t xfr_count, u32 flags)
BUG_ON(!acd->ldev);
BUG_ON(!acd->ldev->pldev);
dma_unmap_sg(&acd->ldev->pldev->dev, acd->sgt.sgl, acd->sgt.nents, acd->ldev->dir);
for (i = 0 ; i < acd->page_count ; i++) {
if (!PageReserved(acd->user_pages[i]))
set_page_dirty(acd->user_pages[i]);
set_page_dirty_lock(acd->user_pages[i]);
}
dma_unmap_sg(&acd->ldev->pldev->dev, acd->sgt.sgl, acd->sgt.nents, acd->ldev->dir);
for (i = 0 ; i < acd->page_count ; i++)
put_page(acd->user_pages[i]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment