mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Ming Lei <ming.lei@canonical.com>
Cc: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"Luis R. Rodriguez" <mcgrof@suse.com>,
	Tom Gundersen <teg@jklm.no>,
	Abhay Salunke <Abhay_Salunke@dell.com>, Stefan Roese <sr@denx.de>,
	Arnd Bergmann <arnd@arndb.de>, Kay Sievers <kay@vrfy.org>
Subject: Re: [PATCH v2] firmware loader: inform direct failure when udev loader is disabled
Date: Wed, 02 Jul 2014 14:14:34 +0200	[thread overview]
Message-ID: <s5hegy4555h.wl%tiwai@suse.de> (raw)
In-Reply-To: <CACVXFVOSLVPFanNavDVoPLM9YBrxxNm_PCuZwBahVY74+1=niw@mail.gmail.com>

At Wed, 2 Jul 2014 19:21:07 +0800,
Ming Lei wrote:
> 
> On Wed, Jul 2, 2014 at 7:01 PM, Takashi Iwai <tiwai@suse.de> wrote:
> > At Tue,  1 Jul 2014 20:07:53 -0700,
> > Luis R. Rodriguez wrote:
> >>
> >> From: "Luis R. Rodriguez" <mcgrof@suse.com>
> >>
> >> Now that the udev firmware loader is optional request_firmware()
> >> will not provide any information on the kernel ring buffer if
> >> direct firmware loading failed and udev firmware loading is disabled.
> >> If no information is needed request_firmware_direct() should be used
> >> for optional firmware, at which point drivers can take on the onus
> >> over informing of any failures, if udev firmware loading is disabled
> >> though we should at the very least provide some sort of information
> >> as when the udev loader was enabled by default back in the days.
> >>
> >> With this change with a simple firmware load test module [0]:
> >>
> >> Example output without FW_LOADER_USER_HELPER_FALLBACK
> >>
> >> platform fake-dev.0: Direct firmware load for fake.bin failed
> >> with error -2
> >>
> >> Example with FW_LOADER_USER_HELPER_FALLBACK
> >>
> >> platform fake-dev.0: Direct firmware load for fake.bin failed with error -2
> >> platform fake-dev.0: Falling back to user helper
> >>
> >> Without this change without FW_LOADER_USER_HELPER_FALLBACK we
> >> get no output logged upon failure.
> >>
> >> Cc: Tom Gundersen <teg@jklm.no>
> >> Cc: Ming Lei <ming.lei@canonical.com>
> >> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >> Cc: Abhay Salunke <Abhay_Salunke@dell.com>
> >> Cc: Stefan Roese <sr@denx.de>
> >> Cc: Arnd Bergmann <arnd@arndb.de>
> >> Cc: Kay Sievers <kay@vrfy.org>
> >> Cc: Takashi Iwai <tiwai@suse.de>
> >> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
> >> ---
> >>
> >> This v2 modifies the error to always be called and only in the
> >> request_firmware_direct case do we not send smoke signals.
> >>
> >>  drivers/base/firmware_class.c | 13 +++++++------
> >>  include/linux/firmware.h      | 15 ++++++++-------
> >>  2 files changed, 15 insertions(+), 13 deletions(-)
> >>
> >> diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
> >> index 46ea5f4..60d0e53 100644
> >> --- a/drivers/base/firmware_class.c
> >> +++ b/drivers/base/firmware_class.c
> >> @@ -109,6 +109,7 @@ static inline long firmware_loading_timeout(void)
> >>  #else
> >>  #define FW_OPT_FALLBACK              0
> >>  #endif
> >> +#define FW_OPT_DIRECT_ONLY (1U << 3)
> >
> > I'd name it like FW_OPT_NO_WARN or such.
> > Other than that, looks good to me.
> 
> IMO, DIRECT_ONLY is better because it can be
> extend to other usages in future.

Well, do we need any more extension to this function?  I thought we're
going rather to remove *_direct().

If we need any more extension, a better way would be to expose the bit
flag directly as __request_firmware() instead of hacking more on
*_direct() or introduce more variants.  Then the existing
request_firmware() and request_firmware_direct() can be static
inline.

In anyway, the flag should indicate each functionality, and if the
current purpose is to suppress warning, it should be named so.


Takashi

      reply	other threads:[~2014-07-02 12:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-02  3:07 Luis R. Rodriguez
2014-07-02  3:21 ` Ming Lei
2014-07-02 11:01 ` Takashi Iwai
2014-07-02 11:21   ` Ming Lei
2014-07-02 12:14     ` Takashi Iwai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hegy4555h.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=Abhay_Salunke@dell.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=kay@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@do-not-panic.com \
    --cc=mcgrof@suse.com \
    --cc=ming.lei@canonical.com \
    --cc=sr@denx.de \
    --cc=teg@jklm.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®