usb: cdns2: don't use GFP_DMA when calling dma_alloc_coherent()

dma_alloc_coherent() allocates the DMA buffer with the device's
addressing limitation in mind; the DMA core picks the zone from the
device's coherent DMA mask and ignores GFP_DMA passed by the caller.
Use GFP_KERNEL instead so the allocation may reclaim as usual for
probe-time allocations.

Link: https://lore.kernel.org/20260903111836.1777265-14-hebaoquan@kylinos.cn
Signed-off-by: Baoquan He <hebaoquan@kylinos.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Harry Yoo <harry@kernel.org>
This commit is contained in:
Baoquan He 2026-09-03 19:18:36 +08:00 committed by Andrew Morton
parent 4d7507b166
commit 1528ed9f96

View File

@ -2341,7 +2341,7 @@ static int cdns2_gadget_start(struct cdns2_device *pdev)
/* Allocate memory for setup packet buffer. */
buf = dma_alloc_coherent(pdev->dev, 8, &pdev->ep0_preq.request.dma,
GFP_DMA);
GFP_KERNEL);
pdev->ep0_preq.request.buf = buf;
if (!pdev->ep0_preq.request.buf) {