[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72kQA45ekbSruh-zTsc9B-9EOxZna=cOgOcM7--owxrWsA@mail.gmail.com>
Date: Thu, 20 Sep 2018 23:26:16 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Souptick Joarder <jrdr.linux@...il.com>
Cc: willy@...radead.org, linux-kernel <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] auxdisplay/cfag12864bfb.c: Replace vm_insert_page
On Thu, Sep 20, 2018 at 10:23 PM, Souptick Joarder <jrdr.linux@...il.com> wrote:
> There is a plan to remove vm_insert_page permanently
> and replace it with new API vmf_insert_page which will
> return vm_fault_t type. As part of it vm_insert_page
> is removed from this driver.
A link to the discussion/plan would be nice. The commit 1c8f422059ae5
("mm: change return type to vm_fault_t") explains a bit, but has a
broken link :( Googling for the stuff returns many of the patches, but
not the actual discussion...
> static int cfag12864bfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
> {
> - return vm_insert_page(vma, vma->vm_start,
> - virt_to_page(cfag12864b_buffer));
> + struct page *page;
> + unsigned long size = vma->vm_end - vma->vm_start;
> +
> + page = virt_to_page(cfag12864b_buffer);
> + return remap_pfn_range(vma, vma->vm_start, page_to_pfn(page),
> + size, vma->vm_page_prot);
I am out of the loop on these mm changes, so please indulge me, but:
* Why is there no documentation on vmf_insert_page() while
vm_insert_page() had it? (specially since it seems you want to remove
vm_insert_page()).
* Shouldn't we have a simple remap_page() or remap_kernel_page() to
fit this use case and avoid that dance? (another driver in auxdisplay
will require the same change, and I guess others in the kernel as
well).
Thanks!
Cheers,
Miguel
Powered by blists - more mailing lists