public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v4 0/3] dwc3: gadget: properly fix cache operations
@ 2024-10-11 14:38 Neil Armstrong
  2024-10-11 14:38 ` [PATCH v4 1/3] usb: dwc3: allocate setup_buf with dma_alloc_coherent() Neil Armstrong
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Neil Armstrong @ 2024-10-11 14:38 UTC (permalink / raw)
  To: Marek Vasut, Tom Rini, Lukasz Majewski, Mattijs Korpershoek,
	Bin Meng
  Cc: Caleb Connolly, u-boot-qcom, u-boot, Neil Armstrong

We experience huge problems with cache handling on Qualcomm
systems, and it appears the dcache handling in the DWC3 gadget
code is quite wrong and causes operational issues.

This serie fixes the dcache operations on unaligned data,
and properly invalidate buffers when reading back data from
hardware.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
Changes in v4:
- Go back to CACHELINE_SIZE, and do not use DMA_MINALIGN since it's not valid for all platforms
- Link to v3: https://lore.kernel.org/r/20241002-u-boot-dwc3-gadget-dcache-fixup-v3-0-5398088ef93c@linaro.org

Changes in v3:
- Cast addresses to (unsigned long) when calling invalidate_dcache_range()
- Drop unused CACHELINE_SIZE
- Fix warning by casting ctrl to uintptr_r when calling dwc3_invalidate_cache()
- Link to v2: https://lore.kernel.org/r/20240724-u-boot-dwc3-gadget-dcache-fixup-v2-0-65836d699a71@linaro.org

Changes in v2:
- Fix typo in drivers/usb/dwc3/core.h and rewrite patch 1 commit message
- Link to v1: https://lore.kernel.org/r/20240719-u-boot-dwc3-gadget-dcache-fixup-v1-0-58a5f026ea8e@linaro.org

---
Neil Armstrong (3):
      usb: dwc3: allocate setup_buf with dma_alloc_coherent()
      usb: dwc3: fix dcache flush range calculation
      usb: dwc3: invalidate dcache on buffer used in interrupt handling

 drivers/usb/dwc3/core.h   |  2 ++
 drivers/usb/dwc3/ep0.c    |  6 ++++--
 drivers/usb/dwc3/gadget.c | 10 ++++++----
 drivers/usb/dwc3/io.h     | 13 ++++++++++++-
 4 files changed, 24 insertions(+), 7 deletions(-)
---
base-commit: ddbcafeb53e7093c58488596bfce6d8823777c3a
change-id: 20240719-u-boot-dwc3-gadget-dcache-fixup-ea1e92758663

Best regards,
-- 
Neil Armstrong <neil.armstrong@linaro.org>


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-12-30 18:49 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11 14:38 [PATCH v4 0/3] dwc3: gadget: properly fix cache operations Neil Armstrong
2024-10-11 14:38 ` [PATCH v4 1/3] usb: dwc3: allocate setup_buf with dma_alloc_coherent() Neil Armstrong
2024-10-11 14:38 ` [PATCH v4 2/3] usb: dwc3: fix dcache flush range calculation Neil Armstrong
2024-10-12  3:37   ` Marek Vasut
2024-10-13 16:35     ` Neil Armstrong
2024-10-13 20:37       ` Marek Vasut
2024-10-11 14:38 ` [PATCH v4 3/3] usb: dwc3: invalidate dcache on buffer used in interrupt handling Neil Armstrong
2024-10-13 20:38   ` Marek Vasut
2024-12-28 13:46   ` Ahmad Fatoum
2024-12-30 10:35     ` Neil Armstrong
2024-12-30 18:49       ` Ahmad Fatoum
2024-10-15  9:06 ` [PATCH v4 0/3] dwc3: gadget: properly fix cache operations Mattijs Korpershoek
2024-10-21 23:31 ` Tom Rini
2024-10-22  9:10   ` Mattijs Korpershoek
2024-10-22 14:19     ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox