In isp1760-hcd driver, flush_dcache_page() is introduced in commit
db8516f61b4(USB: isp1760: Flush the D-cache for the pipe-in transfer buffers)
to fix cache incoherency problem when PIO reading from USB mass storage
device to mapped page, so the flush should not need for slab pages which
won't be mapped to userspace.

This patch fixes one kernel panic when CONFIG_DEBUG_VM is set.

Cc: Catalin Marinas <catalin.mari...@arm.com>
Tested-by: Christoffer Dall <christoffer.d...@linaro.org>
Signed-off-by: Ming Lei <ming....@canonical.com>
---
 drivers/usb/host/isp1760-hcd.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c
index 2facee5..c370e7d 100644
--- a/drivers/usb/host/isp1760-hcd.c
+++ b/drivers/usb/host/isp1760-hcd.c
@@ -703,7 +703,9 @@ __acquires(priv->lock)
                        urb->status = 0;
        }
 
-       if (usb_pipein(urb->pipe) && usb_pipetype(urb->pipe) != PIPE_CONTROL) {
+       if (usb_pipein(urb->pipe) &&
+                       usb_pipetype(urb->pipe) != PIPE_CONTROL &&
+                       !PageSlab(virt_to_page(urb->transfer_buffer))) {
                void *ptr;
                for (ptr = urb->transfer_buffer;
                     ptr < urb->transfer_buffer + urb->transfer_buffer_length;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to