[U-Boot] [PATCH 01/10] usb:udc:s3c: Reduce dcache invalidate range for UDC receive buffer

Marek Vasut marex at denx.de
Thu Oct 3 17:21:20 CEST 2013


Dear Lukasz Majewski,

> The s3c udc driver sends data in a max packet size. Therefore the dcache
> invalidate range shall be equal to max packet, not the entire
> DMA_BUFFER_SIZE.
> 
> Signed-off-by: Lukasz Majewski <l.majewski at samsung.com>
> Cc: Marek Vasut <marex at denx.de>
> ---
>  drivers/usb/gadget/s3c_udc_otg_xfer_dma.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
> b/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c index d7af5e9..5e3ba76 100644
> --- a/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
> +++ b/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
> @@ -117,7 +117,7 @@ static int setdma_rx(struct s3c_ep *ep, struct
> s3c_request *req)
> 
>  	invalidate_dcache_range((unsigned long) ep->dev->dma_buf[ep_num],
>  				(unsigned long) ep->dev->dma_buf[ep_num]
> -				+ DMA_BUFFER_SIZE);
> +				+ ep->ep.maxpacket);

Is this maxpacket _always_ multiple of cacheline big or will you need some 
ROUND_UP() call here ?

Best regards,
Marek Vasut


More information about the U-Boot mailing list