Re: [PATCH v4 5/6] spi: spi-fsl-dspi: Increase DMA buffer size
From: Arnd Bergmann
Date: Tue Jul 01 2025 - 11:13:24 EST
On Tue, Jul 1, 2025, at 16:47, Vladimir Oltean wrote:
> On Fri, Jun 27, 2025 at 11:21:41AM +0100, James Clark wrote:
>> + }
>> +
>> + return PAGE_SIZE;
>> +}
>
> The other question is: what's fundamentally different between the host
> and target operating modes, such that we return different values? Why
> not the same?
In host mode, the driver is able to split up a transfer into smaller
chunks, while in target mode the length of the transfer is determined
by the remote host and can be larger than whatever default buffer
size we pick.
Using PAGE_SIZE as the default host buffer makes sense since that
is the smallest underlying size for dma_alloc_noncoherent, and
larger buffers would be fairly wasteful.
Endpoint mode should only be enabled if it's actually being used
and in that case the allocation is as large as possible.
Arnd