lkml.org 
[lkml]   [2019]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RESEND][PATCH v8 4/5] dma-buf: heaps: Add CMA heap to dmabuf heaps
On Mon, Sep 30, 2019 at 1:14 AM Hillf Danton <hdanton@sina.com> wrote:
> On Fri, 6 Sep 2019 18:47:09 +0000 John Stultz wrote:
> >
> > + cma_pages = cma_alloc(cma_heap->cma, nr_pages, align, false);
> > + if (!cma_pages)
> > + goto free_buf;
> > +
> > + if (PageHighMem(cma_pages)) {
> > + unsigned long nr_clear_pages = nr_pages;
> > + struct page *page = cma_pages;
> > +
> > + while (nr_clear_pages > 0) {
> > + void *vaddr = kmap_atomic(page);
> > +
> > + memset(vaddr, 0, PAGE_SIZE);
> > + kunmap_atomic(vaddr);
> > + page++;
> > + nr_clear_pages--;
> > + }
> > + } else {
> > + memset(page_address(cma_pages), 0, size);
> > + }
>
> Take a breath after zeroing a page, and a peep at pending signal.

Ok. Took a swing at this. It will be in the next revision.

Thanks again for the review!
-john

\
 
 \ /
  Last update: 2019-10-02 18:15    [W:0.237 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site