From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751744AbdCVWFM (ORCPT ); Wed, 22 Mar 2017 18:05:12 -0400 Received: from mga06.intel.com ([134.134.136.31]:54107 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750867AbdCVWFE (ORCPT ); Wed, 22 Mar 2017 18:05:04 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,206,1486454400"; d="scan'208";a="69817207" Subject: Re: [RFC 1/2] firmware class: Add stream_firmware API. To: Alan Tull , Greg Kroah-Hartman References: <1489105090-4996-1-git-send-email-yi1.li@linux.intel.com> <1489105090-4996-2-git-send-email-yi1.li@linux.intel.com> Cc: ming.lei@canonical.com, mcgrof@kernel.org, atull , Moritz Fischer , linux-kernel , linux-fpga@vger.kernel.org From: "Li, Yi" Message-ID: <130097e7-fe9b-dce5-8bda-f22f352f7a44@linux.intel.com> Date: Wed, 22 Mar 2017 17:05:00 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alan On 3/20/2017 1:34 PM, Alan Tull wrote: > 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(). 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