lkml.org 
[lkml]   [2019]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [EXT] Re: [PATCH 1/3] spi: spi-nxp-fspi: dynamically alloc AHB memory for FSPI
Date


> -----Original Message-----
> From: Mark Brown <broonie@kernel.org>
> Sent: Thursday, July 11, 2019 7:41 AM
> To: Han Xu <han.xu@nxp.com>
> Cc: Ashish Kumar <ashish.kumar@nxp.com>; linux-spi@vger.kernel.org; linux-
> kernel@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>
> Subject: Re: [EXT] Re: [PATCH 1/3] spi: spi-nxp-fspi: dynamically alloc AHB memory
> for FSPI
>
> On Wed, Jul 10, 2019 at 03:35:46PM +0000, Han Xu wrote:
>
> > > > dynamically alloc AHB memory for FSPI controller
>
> > > Why? This is currently done at probe which is what you'd expect to
> > > happen here, there's no explanation as to why this change is being made.
>
> > Explained in cover letter, It failed to alloc the whole memory mapping
> > area during probe on some platforms, since the AHB memory area could
> > be pretty large. The error may look like:
>
> > [ 1.129404] fsl-quadspi 1550000.spi: ioremap failed for resource [mem
> 0x40000000-0x7fffffff]
>
> The commit itself needs to have some explanation of what it's doing so it's in the
> git log, particularly for something odd like this. More generally this just doesn't feel
> like it's solving the problem - essentially we're just deferring the mapping and then
> keep on failing operations until the allocation succeeds for some reason. That's
> going to be disruptive for users of the device and it doesn't seem like it's going to
> be a robust solution. Why does the allocation not work initially and why is it more
> likely to work later on?

Yes, I will explain the reason in next version. To allocate the whole 256MB memory at one time exceed the vmalloc limit, so we dynamically allocate small amount of memory just as needed. There is no failing operation, just deferring and re-allocate if new access area beyond the previous allocate area.

\
 
 \ /
  Last update: 2019-07-11 21:45    [W:0.099 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site