Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1607057

Re: [RFC 1/2] firmware class: Add stream_firmware API.

From "Li, Yi" <yi1.li@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [RFC 1/2] firmware class: Add stream_firmware API.
Date 2017-03-22 23:10 +0100
Message-ID <tnWC5-Yx-9@gated-at.bofh.it> (permalink)
References <tjgBr-4eD-3@gated-at.bofh.it> <tjgBr-4eD-13@gated-at.bofh.it> <tn9UK-8sD-47@gated-at.bofh.it> <tnanO-iT-81@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Alan


On 3/20/2017 1:34 PM, Alan Tull wrote:
> On Mon, Mar 20, 2017 at 1:00 PM, Alan Tull <delicious.quinoa@gmail.com> wrote:
>
>>> +int
>>> +stream_firmware(const struct firmware **firmware_p, const char *name,
>>> +                struct device *device, size_t offset, size_t length)
>>> +{
>>> +       size_t ret;
>>> +
>>> +       /* Need to pin this module until return */
>>> +       __module_get(THIS_MODULE);
>>> +       ret = _stream_firmware(firmware_p, name, device, NULL, 0,
>>> +                               FW_OPT_UEVENT | FW_OPT_NO_WARN, offset, length);
> IIUC, here you are setting size == 0 and buf == NULL  to prevent
> _request_firmware_prepare from attempting to load from built in
> firmware.
>
> So three of the parameters buf, size, and opt_flags are fixed and
> don't need to be passed to _stream_firmware().

Sure.

> Alternatively, I wonder how hard it would be to code this so that the
> streaming interface will fall back and successfully get the built in
> or cached firmware if it exists and stream it out in PAGE_SIZE chunks.

That's an interesting idea, I will try it out and submit patch for 
review later. On another hand, if the kernel already cache the whole 
firmware image, why should we use streaming instead of regular 
request_firmware?

>
> Alan Tull
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [RFC 1/2] firmware class: Add stream_firmware API. Alan Tull <delicious.quinoa@gmail.com> - 2017-03-20 19:10 +0100
  Re: [RFC 1/2] firmware class: Add stream_firmware API. Alan Tull <delicious.quinoa@gmail.com> - 2017-03-20 19:40 +0100
    Re: [RFC 1/2] firmware class: Add stream_firmware API. "Li, Yi" <yi1.li@linux.intel.com> - 2017-03-22 23:10 +0100
      Re: [RFC 1/2] firmware class: Add stream_firmware API. Alan Tull <delicious.quinoa@gmail.com> - 2017-03-23 01:40 +0100

csiph-web