Received: by 10.223.164.202 with SMTP id h10csp877290wrb; Fri, 10 Nov 2017 17:27:11 -0800 (PST) X-Google-Smtp-Source: AGs4zMYBpq++bcpC2bi/B6LLs1zdwn9XZ9Q6YEBCzkx4sjuRDJI7EB/4B+E1SyjCnoStCGCKFJ5H X-Received: by 10.84.175.3 with SMTP id s3mr2162492plb.440.1510363630931; Fri, 10 Nov 2017 17:27:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510363630; cv=none; d=google.com; s=arc-20160816; b=dE47XBT4wnipDfXzVnpW/IH33+riRxRn9QH54/3ImDZSgr7LcD9GNjJ5BggJd6twdP YjEVq76Ti8fuCEIy6/C6aA4ns2Phu5MuIxLLaOM0063D4XeIqVOfCicZigB+dkJZGb7N TXRN4LqoKpufPzC907iyBu2dV0tDnqpqUcdrNY1O33upk2AxatfG4SfjXMDlnwvvuBTB +77IzxGSpqdl64kik3NRbMWFVbwjuuBZPNOZRyXML4Mp+qBT/9fJK/TuJ7UWNtUmxq09 tySSSggNAuW4EZ4s1d9OLtyK7zw4sMihiwIby+K34SE25Vs9fge+5vGfv/i+l75I9Lfh GHtw== 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=SIh7yYIeKEKmfFSO6RTaHsxLn3zjSVYZJovjKdlNT7A=; b=h1kA++kRX7QYILRkxqoppzpYcE5xHgnip3EcD5XN60E/NzwZ0xDEOYFxPBqbjgqrFj M7aBFrn6FUmdPunqfjDYAl9S5K9RZUHDxupD+ZBhIzgiZSyfv0PuGihAL49IaJkgoEnL ThPa1jlOmkHk+p/tZ9psWgt/x83eZjTdMOdnt/gJFwsALz8g023QFbC1jurJngEo9MKH E2+g5wuQfB06++uzI0niJLvqo2Bigzgz/AhOqfAwjzItIXPC6NgRHxETseWN6hQV6Q7J EH8IaRz6yPHIYpU5NcndOPwNqmrw+kV73B4gGi4Ntnt+6LOWMrlyEPmBcy01nWPUOrCE 4BPw== 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 h1si6972271pld.137.2017.11.10.17.26.58; Fri, 10 Nov 2017 17:27:10 -0800 (PST) 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 S1754387AbdKKB0Q (ORCPT + 83 others); Fri, 10 Nov 2017 20:26:16 -0500 Received: from mx2.suse.de ([195.135.220.15]:48415 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750971AbdKKB0P (ORCPT ); Fri, 10 Nov 2017 20:26:15 -0500 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 C4519ADF4; Sat, 11 Nov 2017 01:26:12 +0000 (UTC) Date: Sat, 11 Nov 2017 02:26:09 +0100 From: "Luis R. Rodriguez" To: Martin Fuzzey Cc: "Luis R. Rodriguez" , gregkh@linuxfoundation.org, wagi@monom.org, yi1.li@linux.intel.com, takahiro.akashi@linaro.org, bjorn.andersson@linaro.org, luto@kernel.org, ebiederm@xmission.com, dmitry.torokhov@gmail.com, arend.vanspriel@broadcom.com, dwmw2@infradead.org, rjw@rjwysocki.net, atull@kernel.org, moritz.fischer@ettus.com, pmladek@suse.com, johannes.berg@intel.com, emmanuel.grumbach@intel.com, luciano.coelho@intel.com, kvalo@codeaurora.org, torvalds@linux-foundation.org, keescook@chromium.org, dhowells@redhat.com, pjones@redhat.com, hdegoede@redhat.com, alan@linux.intel.com, tytso@mit.edu, dave@stgolabs.net, mawilcox@microsoft.com, tglx@linutronix.de, peterz@infradead.org, jakub.kicinski@netronome.com, nbroeking@me.com, jewalt@lgsinnovations.com, Pali =?iso-8859-1?Q?Roh=E1r?= , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] firmware: cleanup - group and document up private firmware parameters Message-ID: <20171111012609.GY22894@wotan.suse.de> References: <20170914225422.31034-1-mcgrof@kernel.org> <59BB8FB6.2040502@parkeon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <59BB8FB6.2040502@parkeon.com> 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 Fri, Sep 15, 2017 at 10:30:46AM +0200, Martin Fuzzey wrote: > On 15/09/17 00:54, Luis R. Rodriguez wrote: > > The above benefits makes the code much easier to understand and maintain. > > Yes I agree it is much cleaner that way. > > A couple of nitpicks below. > > > +/** > > + * enum fw_priv_reqs - private features only used internally > > + * > > + * @FW_PRIV_REQ_FALLBACK: specifies that the firmware request > > + * will use a fallback mechanism if the kernel's direct filesystem > > + * lookup failed to find the requested firmware. If the flag > > + * %FW_PRIV_REQ_FALLBACK is set but the flag > > + * %FW_PRIV_REQ_FALLBACK_UEVENT is not set, it means the caller > > + * is relying on a custom fallback mechanism for firmwarwe lookup as a > > + * fallback mechanism. The custom fallback mechanism is expected to find > > + * any found firmware using the exposed sysfs interface of the > > + * firmware_class. Since the custom fallback mechanism is not compatible > > + * with the internal caching mechanism for firmware lookups at resume, > > + * caching will be disabled when the custom fallback mechanism is used. > > + * @FW_PRIV_REQ_FALLBACK_UEVENT: indicates that the fallback mechanism > > + * this firmware request will rely on will be that of having the kernel > > + * issue a uevent to userspace. Userspace in turn is expected to be > > + * monitoring for uevents for the firmware_class and will use the > > + * exposted sysfs interface to upload the firmware for the caller. > > + * @FW_PRIV_REQ_NO_CACHE: indicates that the firmware request > > + * should not set up and use the internal caching mechanism to assist > > + * drivers from fetching firmware at resume time after suspend. > > + * @FW_PRIV_REQ_OPTIONAL: if set it is not a hard requirement by the > > + * caller that the file requested be present. An error will not be recorded > > + * if the file is not found. > > + */ > > +enum fw_priv_reqs { > > + FW_PRIV_REQ_FALLBACK = 1 << 0, > > + FW_PRIV_REQ_FALLBACK_UEVENT = 1 << 1, > > + FW_PRIV_REQ_NO_CACHE = 1 << 2, > > + FW_PRIV_REQ_OPTIONAL = 1 << 3, > > +}; > > + > > Why REQ ? > Looks more like a set of flags to me. > Wouldn't FW_PRIV_FLAG_XXX be better? Sure, its much better without anything so will just go with FW_PRIV_ as the prefix. > > +/** > > + * struct fw_priv_params - private firmware parameters > > + * @mode: mode of operation > > + * @priv_reqs: private set of &enum fw_priv_reqs, private requirements for > > + * the firmware request > > + * @alloc_buf: buffer area allocated by the caller so we can place the > > + * respective firmware > > + * @alloc_buf_size: size of the @alloc_buf > > + */ > > +struct fw_priv_params { > > + enum fw_api_mode mode; > > + u64 priv_reqs; > > Not sure the priv_ prefix in the priv_reqs is necessary since the whole > structure is private. > I'd have named it just flags. Went with priv_flags. Thanks for the feedback! Luis From 1578892514428336720@xxx Mon Sep 18 15:40:39 +0000 2017 X-GM-THRID: 1578557473088358418 X-Gmail-Labels: Inbox,Category Forums