From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Subject: Re: [PATCH v7 3/8] firmware: Rename FW_OPT_NOFALLBACK to FW_OPT_NOFALLBACK_SYSFS Date: Thu, 14 Nov 2019 21:22:16 +0100 Message-ID: References: <20191004145056.43267-1-hdegoede@redhat.com> <20191004145056.43267-4-hdegoede@redhat.com> <20191011150227.GO16384@42.do-not-panic.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20191011150227.GO16384@42.do-not-panic.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Luis Chamberlain Cc: Ard Biesheuvel , Scott Branden , Darren Hart , Andy Shevchenko , Greg Kroah-Hartman , "Rafael J . Wysocki" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Jonathan Corbet , Dmitry Torokhov , Peter Jones , Dave Olsthoorn , x86@kernel.org, platform-driver-x86@vger.kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-input@vger.kernel.org List-Id: platform-driver-x86.vger.kernel.org Hi, On 11-10-2019 17:02, Luis Chamberlain wrote: > On Fri, Oct 04, 2019 at 04:50:51PM +0200, Hans de Goede wrote: >> diff --git a/drivers/base/firmware_loader/fallback.c b/drivers/base/firm= ware_loader/fallback.c >> index 62ee90b4db56..665b350419cb 100644 >> --- a/drivers/base/firmware_loader/fallback.c >> +++ b/drivers/base/firmware_loader/fallback.c >> @@ -606,7 +606,7 @@ static bool fw_run_sysfs_fallback(enum fw_opt opt_fl= ags) >> =09=09return false; >> =09} >> =20 >> -=09if ((opt_flags & FW_OPT_NOFALLBACK)) >> +=09if ((opt_flags & FW_OPT_NOFALLBACK_SYSFS)) >> =09=09return false; >> =20 >> =09/* Also permit LSMs and IMA to fail firmware sysfs fallback */ >> @@ -630,10 +630,11 @@ static bool fw_run_sysfs_fallback(enum fw_opt opt_= flags) >> * interface. Userspace is in charge of loading the firmware through t= he sysfs >> * loading interface. This sysfs fallback mechanism may be disabled co= mpletely >> * on a system by setting the proc sysctl value ignore_sysfs_fallback = to true. >> - * If this false we check if the internal API caller set the @FW_OPT_NO= FALLBACK >> - * flag, if so it would also disable the fallback mechanism. A system m= ay want >> - * to enfoce the sysfs fallback mechanism at all times, it can do this = by >> - * setting ignore_sysfs_fallback to false and force_sysfs_fallback to t= rue. >> + * If this false we check if the internal API caller set the > ignore_sysfs_fallback set to true or force_sysfs_fallback is > =09 set to false I do not think that that is correct, looking at the code the order of checks is: =09if (fw_fallback_config.ignore_sysfs_fallback) =09=09BAIL =09if (opt_flags & FW_OPT_NOFALLBACK_SYSFS) =09=09BAIL =09if (fw_fallback_config.force_sysfs_fallback) =09=09DO_FALLBACK (and return) =09if (!(opt_flags & FW_OPT_USERHELPER)) =09=09BAIL =09DO_FALLBACK So the original comment seems correct as FW_OPT_NOFALLBACK trumps / has higher prio then force_sysfs_fallback. Anyways I do not believe that fixing up/rewording this comment (if it needs fixing) belongs in the commit/patch. This patch is purely about renaming FW_OPT_NOFALLBACK to FW_OPT_NOFALLBACK_SYSFS, the lines changed in this chunk are not changed, they are merely re-word/line-wrapped with the exception of fixing the enfoce typo to enforce, as mentioned in the commit message. Regards, Hans