Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756319AbdCTSgc (ORCPT ); Mon, 20 Mar 2017 14:36:32 -0400 Received: from mail-qk0-f179.google.com ([209.85.220.179]:35817 "EHLO mail-qk0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756938AbdCTSfs (ORCPT ); Mon, 20 Mar 2017 14:35:48 -0400 MIME-Version: 1.0 In-Reply-To: References: <1489105090-4996-1-git-send-email-yi1.li@linux.intel.com> <1489105090-4996-2-git-send-email-yi1.li@linux.intel.com> From: Alan Tull Date: Mon, 20 Mar 2017 13:34:58 -0500 Message-ID: Subject: Re: [RFC 1/2] firmware class: Add stream_firmware API. To: "Li, Yi" , Greg Kroah-Hartman Cc: ming.lei@canonical.com, mcgrof@kernel.org, atull , Moritz Fischer , linux-kernel , linux-fpga@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 990 Lines: 25 On Mon, Mar 20, 2017 at 1:00 PM, Alan Tull 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(). 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. Alan Tull