lkml.org 
[lkml]   [2018]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] firmware: make sure builtin firmware is page alignment
Date
在 2018-08-03五的 07:39 +0200,Greg KH写道:
> On Fri, Aug 03, 2018 at 09:45:21AM +0800, Zhang Ning wrote:
> > when firmware is in filesystem, request_firmware will load it,
> > and copy it to vmalloc memory, that is page align memory.
> >
> > but when firmware is builtin, it is 8 bytes or 4 bytes alignment.
> >
> > make sure builtin firmware is page algnment, that can simplify
> > algorithm
> > to handle firmware.
>
> How is it simplified?  I don't see any such change like that here :(
>
Thank you for review this patch.

When driver handles its firmware based on page, like below:

struct page *p;
p = vmalloc_to_page(fw->data);  // for filesystem firmware
p = virt_to_page(fw->data); // for builtin firmware

but if builtin firmware is not page alignment, page pointer for builtin
firmware is wrong, it contains memory not belong to firmware. drivers
has to use additional code to handle this.

if builtin firmware is also page alignment, no need additional code to
handle builtin firmware. simplified.

BR.
Ning.
\
 
 \ /
  Last update: 2018-08-03 10:43    [W:0.066 / U:2.960 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site