Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]:60436 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937AbdHCFXM (ORCPT ); Thu, 3 Aug 2017 01:23:12 -0400 From: Kalle Valo To: "Luis R. Rodriguez" Cc: =?utf-8?Q?Rafa=C5=82_Mi=C5=82ecki?= , Greg Kroah-Hartman , Bjorn Andersson , Daniel Wagner , David Woodhouse , Arend van Spriel , "Rafael J . Wysocki" , yi1.li@linux.intel.com, atull@kernel.org, Moritz Fischer , pmladek@suse.com, Johannes Berg , emmanuel.grumbach@intel.com, luciano.coelho@intel.com, luto@kernel.org, Linus Torvalds , Kees Cook , AKASHI Takahiro , David Howells , pjones@redhat.com, Hans de Goede , alan@linux.intel.com, tytso@mit.edu, lkml , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , Pieter-Paul Giesberts , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, =?utf-8?Q?Rafa?= =?utf-8?Q?=C5=82_Mi=C5=82ecki?= Subject: Re: [PATCH V5 1/2] firmware: add more flexible request_firmware_async function References: <20170731150945.8925-1-zajec5@gmail.com> <20170802213010.GM18884@wotan.suse.de> Date: Thu, 03 Aug 2017 08:23:00 +0300 In-Reply-To: <20170802213010.GM18884@wotan.suse.de> (Luis R. Rodriguez's message of "Wed, 2 Aug 2017 23:30:10 +0200") Message-ID: <878tj1ql6z.fsf@kamboji.qca.qualcomm.com> (sfid-20170803_072327_915135_A80D3AD3) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-wireless-owner@vger.kernel.org List-ID: "Luis R. Rodriguez" writes: >> +int request_firmware_nowait(struct module *module, bool uevent, >> + const char *name, struct device *device, gfp_t gfp, >> + void *context, >> + void (*cont)(const struct firmware *fw, void *context)) >> +{ >> + unsigned int opt_flags = FW_OPT_FALLBACK | >> + (uevent ? FW_OPT_UEVENT : FW_OPT_USERHELPER); >> + >> + return __request_firmware_nowait(module, opt_flags, name, device, gfp, >> + context, cont); >> +} >> EXPORT_SYMBOL(request_firmware_nowait); >> >> +int __request_firmware_async(struct module *module, const char *name, >> + struct firmware_opts *fw_opts, struct device *dev, >> + void *context, >> + void (*cont)(const struct firmware *fw, void *context)) >> +{ >> + unsigned int opt_flags = FW_OPT_UEVENT; > > This exposes a long issue. Think -- why do we want this enabled by default? Its > actually because even though the fallback stuff is optional and can be, the uevent > internal flag *also* provides caching support as a side consequence only. We > don't want to add a new API without first cleaning up that mess. > > This is a slipery slope and best to clean that up before adding any new API. > > That and also Greg recently stated he would like to see at least 3 users of > a feature before adding it. Although I think that's pretty arbitrary, and > considering that request_firmware_into_buf() only has *one* user -- its what > he wishes. ath10k at least needs a way to silence the warning for missing firmware and I think iwlwifi also. -- Kalle Valo