lkml.org 
[lkml]   [2022]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] spi: spi-mem: check if data buffers are on stack
On 31/01/22 01:55PM, Mark Brown wrote:
> On Mon, Jan 31, 2022 at 05:15:08PM +0530, Pratyush Yadav wrote:
> > The buffers passed in the data phase must be DMA-able. Programmers often
> > don't realise this requirement and pass in buffers that reside on the
> > stack. This can be hard to spot when reviewing code. Reject ops if their
> > data buffer is on the stack to avoid this.
>
> Acked-by: Mark Brown <broonie@kernel.org>

Thanks. But seems like this is breaking build on arm-socfpga_defconfig.
Let me take a look into it.

>
> > + /* Buffers must be DMA-able. */
> > + if (op->data.dir == SPI_MEM_DATA_IN &&
> > + object_is_on_stack(op->data.buf.in))
>
> Might be worth a WARN_ON_ONCE() for debuggability?

Okay, I'll add it.

--
Regards,
Pratyush Yadav
Texas Instruments Inc.

\
 
 \ /
  Last update: 2022-01-31 18:08    [W:0.106 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site