Received: by 10.192.165.148 with SMTP id m20csp1555427imm; Sat, 21 Apr 2018 10:38:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx48fWbnL5XQmotqf43BvjOv9FI4Ms0v2+b3CGPQsMLuBGWpeFUk3fTTC7L1s41uN2iE5LWct X-Received: by 2002:a17:902:a704:: with SMTP id w4-v6mr14325189plq.5.1524332298910; Sat, 21 Apr 2018 10:38:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524332298; cv=none; d=google.com; s=arc-20160816; b=ulAkZzOzIlK9OaaoEsybLqeeZOncOpSdwlx+6ydgKayMRa+tGkd3rrC8KTa/h50E5k 6AcYV6AaikLpMh87q6/gSYAr1hFoToNP0pHcr3aEgg2IjxI42enaPnFmjXCceFKhZpw7 LKi3qPJEXB0IWvF5LBdn9j3NDR3B0j7ec8qIGcbieos0hhuYxkGY0FEE4jMoxrATxt9Q oD67CfOBbu3UvoxEaMZoWe0x75rvErzt4TAGFNnNjAZvcYJGiWj0Izg5X406exa41MfH whsAiIghtbdLQIe6CwY1ZDsRUcNbUSJ5xJQAKPMVkfAilrq9o/OtU58r5IDG6TjPGMXB qdNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=jo8AprrE0cq3dOQcK08EwvpIs9dtbvF1+FrJtyUtHSE=; b=gEO4Xq63087TakzJWgWFj0/yJlGEjBbU3A/9cU2IMZwE7FyHt9pBXWiVH8VEoNLyR3 HOBTUHyiNDw4a9BYYZJQuINmLFWFRHCSjEz9JXXj8BjOOm4IiaHOnsJ8XeiOvD6JTkdD WpQ3vVTLLPiAITLrLxY9QbXiNbN3brNdQSIG1XA6PXAMw7XvXiWFHeX8jtY0MIA5xfmj NvOu+iR7vIa3HKkS2dLtG4HLsRs7fEq5PMPpMmOKRQCwmS3iDtQuhEhJnTlTifaL1u5k hXNLIwqg6zZT679jtr8setA0EdK+exHJm9GSEPbCZ30gu1U3en6yISJppMNwOQE+kaWb JuTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i4si2253582pgq.664.2018.04.21.10.38.02; Sat, 21 Apr 2018 10:38:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753179AbeDURgz (ORCPT + 99 others); Sat, 21 Apr 2018 13:36:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:57985 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752907AbeDURgy (ORCPT ); Sat, 21 Apr 2018 13:36:54 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 5D0F1ADBD; Sat, 21 Apr 2018 17:36:52 +0000 (UTC) Date: Sat, 21 Apr 2018 19:36:50 +0200 From: "Luis R. Rodriguez" To: Linus Torvalds Cc: Kees Cook , "Luis R. Rodriguez" , Andres Rodriguez , Greg Kroah-Hartman , Hans de Goede , David Woodhouse , LKML , Alex Deucher , ckoenig.leichtzumerken@gmail.com, Kalle Valo , Arend van Spriel Subject: Re: [PATCH 5/9] firmware: add functions to load firmware without warnings v4 Message-ID: <20180421173650.GW14440@wotan.suse.de> References: <20180417153307.3693-1-andresx7@gmail.com> <20180417153307.3693-6-andresx7@gmail.com> <20180421143206.GQ14440@wotan.suse.de> <20180421144911.GV14440@wotan.suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 21, 2018 at 08:32:00AM -0700, Linus Torvalds wrote: > On Sat, Apr 21, 2018 at 8:11 AM, Kees Cook wrote: > > > > What was the objection to using parameters for this? i.e. something > > like the gfp flags, but have a behavior flag FW_RQ_NOWAIT, > > FW_RQ_NOWARN, etc? > > The objection was that the patches that I think Luis refers to There were different topics of discussion, people can conflate the topics discussed easily as all these topics were discussed around the same time so best to recap and split them up: a) bikeshedding on the name: I suggested long ago we've already passed usage of the fw API to things which are *not firmware*, so suggested we use a new naming scheme, the last one I recommended was a driver_data_*() prefix. Greg last suggested a firmware_*() prefix -- and to rename *all* existing callers with this new prefix as well long term... I am done with bikeshedding and frankly don't care anymore. Whatever you folks decide, I just want to move on with life, so I am moving along with the firmware_*() prefix. b) evolving the API: data driven Vs functional -- where to draw the fine line -- this is the topic we are discussing now again -- c) firmware signing: we've decided against it for now and folks who need it can open code it, mainly due to most hw supporting FW signing already > (a) passed in a union of random arguments It split the API into two main routine calls, a sync and an async call, and also accepted a *structure of parameters* which describe the request requirements [0]. It turned out this approach was *too data driven*, and Greg advised against it, asking for a new call *per new functionality*, as is typically done... [0] https://lkml.kernel.org/r/20170605213937.26215-2-mcgrof@kernel.org > (b) changed all the users, even the ones that didn't want to be changed. That *never happened* actually. The SmPL grammar I provided long ago was for those who *did* want to change the new API if they had a new *feature* they wanted to take advantage of. The patches you may have seen were *examples* of *two drivers* which were converted over just an example with the grammar. On the last iteration of my series I skipped adding the SmPL helpers, and only converted *one* driver for *new functionality*. In the last driver data patch series I only converted iwlwifi as I was changing it to use the new functionality to replace its own internal recursion set of calls with an internal deterministic solution which lets drivers call for a range of API files and lets it use the first one in a range it finds [1], with this diff stat: drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 91 ++++++++++------------------ 1 file changed, 31 insertions(+), 60 deletions(-) [1] https://lkml.kernel.org/r/20170605213937.26215-6-mcgrof@kernel.org > they were nasty and illegible and pointless. Clearly request_firmware_nowait2() is *not* much better... right? So it illustrates the problem I was hinting which we'd eventually cross... > Using some single flag field for an extended function, and leaving the > existing functions alone so that you don't have to convert existing > users - that would have been fine. That's not what was tried and > rejected. Actually it was tried, however the divide was perhaps *too broad* and split all possible *new* functionality into two calls, a sync and a async call. A flag based mechanism *is* reasonable to me given I have been an advocate of such type of mechanism for a long while. It however is against what Greg requested -- to have a new call *per functionality*. So feel free to advise... I really just want us to move on. Luis