lkml.org 
[lkml]   [2022]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/9] nvme-apple: Add initial Apple SoC NVMe driver
On 2022-04-02 15:34:55 +0200, Sven Peter wrote:
>
>
> On Tue, Mar 22, 2022, at 14:38, Arnd Bergmann wrote:
> > On Mon, Mar 21, 2022 at 5:50 PM Sven Peter <sven@svenpeter.dev> wrote:
> >
> >> +static int apple_nvme_sart_dma_setup(void *cookie, struct apple_rtkit_shmem *bfr,
> >> + dma_addr_t iova, size_t size)
> >> +{
> >> + struct apple_nvme *anv = cookie;
> >> + int ret;
> >> +
> >> + if (iova)
> >> + return -EINVAL;
> >> +
> >> + bfr->buffer = dma_alloc_coherent(anv->dev, size, &iova, GFP_KERNEL);
> >> + if (!bfr->buffer)
> >> + return -ENOMEM;
> >
> > You pass 'iova' as an argument, but then replace it with the address
> > returned by dma_alloc_coherent(). Can you remove the function
> > argument?
>
> Yup, will remove it.

You can remove it but we will have to add it back once we submit the dcp
driver (display co-processor). dcp is initialized during boot and uses a
single pre-allocated buffer which needs to be mapped instead of
allocated. It seemed easier to make apple_rtkit_ops.shmem_setup()
omnipotent than adding a different function pointer for this case.

Janne

\
 
 \ /
  Last update: 2022-04-02 16:08    [W:0.082 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site