usb: cdns3: ep0: Invalidate cache before reading Setup Packet
Subsystems (3)
PATCH 1/1 usb: cdns3: ep0: Invalidate cache before reading Setup Packet
Invalidate dcache line before accessing Setup Packet contents. Otherwise driver will see stale content on non coherent architecture.
Signed-off-by Vignesh Raghavendra <[email protected]>
--- drivers/usb/cdns3/ep0.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/cdns3/ep0.c +4 -0
@@ -562,6 +562,10 @@ static void cdns3_ep0_setup_phase(struct cdns3_device *priv_dev)struct cdns3_endpoint *priv_ep = priv_dev->eps[0 ];int result; +/* Invalidate Setup Packet received */ +invalidate_dcache_range (priv_dev->setup_dma, + priv_dev->setup_dma +ARCH_DMA_MINALIGN ); + priv_dev->ep0_data_dir = ctrl->bRequestType &USB_DIR_IN ;trace_cdns3_ctrl_req (ctrl);
Signature · 1 line
2.25.0
Marek Vasut
AppliedPATCH 1/1 usb: cdns3: ep0: Invalidate cache before reading Setup Packet
Quoted 14 lines · Vignesh Raghavendra
Invalidate dcache line before accessing Setup Packet contents. Otherwise driver will see stale content on non coherent architecture.
Signed-off-by Vignesh Raghavendra <[email protected]>--- drivers/usb/cdns3/ep0.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/usb/cdns3/ep0.c +0
-0
drivers/usb/cdns3/ep0.c static void cdns3_ep0_setup_phase(struct cdns3_device *priv_dev) · line 571
Quoted 10 lines
drivers/usb/cdns3/ep0.c +4
-0@@ -562,6 +562,10 @@ static void cdns3_ep0_setup_phase(struct cdns3_device *priv_dev)struct cdns3_endpoint *priv_ep = priv_dev->eps[0 ];int result; +/* Invalidate Setup Packet received */ +invalidate_dcache_range (priv_dev->setup_dma, + priv_dev->setup_dma +ARCH_DMA_MINALIGN ); + priv_dev->ep0_data_dir = ctrl->bRequestType &USB_DIR_IN ;trace_cdns3_ctrl_req (ctrl);
Applied, thanks.