[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <86524ed0e12cbb76a8d746447b24f90f0aca55fa.camel@nxp.com>
Date: Tue, 9 Aug 2022 13:38:58 +0000
From: Olivier Masse <olivier.masse@....com>
To: "brian.starkey@....com" <brian.starkey@....com>
CC: "sumit.semwal@...aro.org" <sumit.semwal@...aro.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linaro-mm-sig@...ts.linaro.org" <linaro-mm-sig@...ts.linaro.org>,
"christian.koenig@....com" <christian.koenig@....com>,
"linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
"nd@....com" <nd@....com>,
Clément Faure <clement.faure@....com>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"benjamin.gaignard@...labora.com" <benjamin.gaignard@...labora.com>
Subject: Re: [EXT] Re: [PATCH 1/3] dma-buf: heaps: add Linaro secure dmabuf
heap support
Hi Brian,
> > +
> > + rmem->ops = &rmem_dma_ops;
> > + pr_info("Reserved memory: DMA buf secure pool %s at
> > %pa, size %ld MiB\n",
> > + secure_data[secure_data_count].name,
> > + &rmem->base, (unsigned long)rmem->size /
> > SZ_1M);
>
> nit: What if rmem->size < SZ_1M, or not 1M-aligned
>
Let's assume that size is 1K-aligned, maybe something like that could
be better ?
unsigned long mb = rmem->size >> 20;
unsigned long kb = (rmem->size & (SZ_1M - 1)) >> 10;
pr_info("Reserved memory: DMA buf secure pool %s at %pa, size %ld MiB and %ld KiB",
secure_data[secure_data_count].name,
&rmem->base, mb, kb);
Cheers,
Olivier
Powered by blists - more mailing lists