diff mbox series

[v1,01/10] usb: xhci: Add missing cache flush in the scratchpad array initialization

Message ID 20200424165012.31915-2-s.nawrocki@samsung.com
State Superseded
Headers show
Series USB host support for Raspberry Pi 4 board | expand

Commit Message

In current code there is no cache flush after initializing the scratchpad
buffer array with the scratchpad buffer pointers. This leads to a failure
of the "slot enable" command on the rpi4 board (Broadcom STB PCIe
controller + VL805 USB hub) - the very first TRB transfer on the command
ring fails and there is a timeout while waiting for the command completion
event. After adding the missing cache flush everything seems to be working
as expected.

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki at samsung.com>
---
Changes since RFC:
 - none.
---
 drivers/usb/host/xhci-mem.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Nicolas Saenz Julienne April 27, 2020, 10:16 a.m. UTC | #1
On Fri, 2020-04-24 at 18:50 +0200, Sylwester Nawrocki wrote:
> In current code there is no cache flush after initializing the scratchpad
> buffer array with the scratchpad buffer pointers. This leads to a failure
> of the "slot enable" command on the rpi4 board (Broadcom STB PCIe
> controller + VL805 USB hub) - the very first TRB transfer on the command
> ring fails and there is a timeout while waiting for the command completion
> event. After adding the missing cache flush everything seems to be working
> as expected.
> 
> Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
> Signed-off-by: Sylwester Nawrocki <s.nawrocki at samsung.com>

Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne at suse.de>

Regards,
Nicolas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200427/9f7302dd/attachment.sig>
diff mbox series

Patch

diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 93450ee..729bdc3 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -393,6 +393,9 @@  static int xhci_scratchpad_alloc(struct xhci_ctrl *ctrl)
 		scratchpad->sp_array[i] = cpu_to_le64(ptr);
 	}
 
+	xhci_flush_cache((uintptr_t)scratchpad->sp_array,
+			 sizeof(u64) * num_sp);
+
 	return 0;
 
 fail_sp3: