On Fri, Aug 09, 2013 at 02:26:40AM +0100, Ming Lei wrote:
> 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 <[email protected]>
> Tested-by: Christoffer Dall <[email protected]>
> Signed-off-by: Ming Lei <[email protected]>
> ---
>  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;

I think from the arm port perspective we can even revert the original
patch. Rather than adding flush_dcache_page() in several drivers we
moved to making the page cache pages dirty by default (and PG_arch_1
means 'clean') so that they are automatically flushed when first mapped
into user space.

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

Reply via email to