Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754789AbdFWXJc (ORCPT ); Fri, 23 Jun 2017 19:09:32 -0400 Received: from mail-io0-f182.google.com ([209.85.223.182]:36005 "EHLO mail-io0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754510AbdFWXJa (ORCPT ); Fri, 23 Jun 2017 19:09:30 -0400 MIME-Version: 1.0 In-Reply-To: <20170623224338.GX21846@wotan.suse.de> References: <20170605213314.GR8951@wotan.suse.de> <20170605213937.26215-1-mcgrof@kernel.org> <20170605213937.26215-2-mcgrof@kernel.org> <20170613090548.GA31421@kroah.com> <20170613194011.GI27288@wotan.suse.de> <20170617193815.GI2974@kroah.com> <20170619193522.GH21846@wotan.suse.de> <20170623155123.GB3565@kroah.com> <20170623224338.GX21846@wotan.suse.de> From: Linus Torvalds Date: Fri, 23 Jun 2017 16:09:29 -0700 X-Google-Sender-Auth: ueWkA1CQTSbCDnUYxgU9L8a-xBk Message-ID: Subject: Re: [PATCH v9 1/5] firmware: add extensible driver data params To: "Luis R. Rodriguez" Cc: Greg KH , Julia Lawall , Daniel Wagner , David Woodhouse , rafal@milecki.pl, Arend Van Spriel , "Rafael J. Wysocki" , "Li, Yi" , atull@opensource.altera.com, Moritz Fischer , Petr Mladek , Johannes Berg , Emmanuel Grumbach , "Coelho, Luciano" , Kalle Valo , Andrew Lutomirski , Jiri Kosina , Kees Cook , "AKASHI, Takahiro" , David Howells , Peter Jones , Hans de Goede , Alan Cox , "Theodore Ts'o" , NeilBrown , Christoph Hellwig , Linux Kernel Mailing List 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: 1774 Lines: 40 On Fri, Jun 23, 2017 at 3:43 PM, Luis R. Rodriguez wrote: > > Ah, yes! Here is what I believe seems to be the *crux* issue of these patch > series and I'm happy we have finally landed on it. Yes, indeed the new API > proposed here provides more flexibility, and it does so by embracing a > "data driven" API Vs the traditional procedural APIs we have seen for > *the firmware API*. This has been going on forever. Everybody hates your data-driven one. It's too indirect, it adds all those nasty "descriptors" of what to do, and it doesn't match what the current model does at all. Things like that may be ok as an internal implementation, but even there it's questionable if it then means a big disconnect between what people actually use (the normal functional model) and the implementation. The thing is, it's much better to just have functions that load the firmware data. Have them named that way ("load_firmware()"), and act that way ("just load the damn firmware file") instead of having odd descriptors that describe what is goign to be done and some state for it, and then get passed around. Don't add this kind of crazy abstraction complexity. If somebody wants to veryify a signature on a firmware file, they should *NOT* fill in a descriptor that says "check signature when loading". Thats' complete BS. They should just do "load_firmware()" and then "check_signature()" or whatever. Would such a "load firmware file, then check signature" take a few lines (with error handling)? Yes. But it is a *simple* interface. It doesn't have some stupid "struct driver_data_params" that needs to be filled in with random details (or has magic macros in a header file that fill in default values). It's _straightforward_. Linus