linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Laura Abbott <labbott@redhat.com>
Cc: Marcel Holtmann <marcel@holtmann.org>,
	Oliver Neukum <oneukum@suse.com>,
	Ming Lei <ming.lei@canonical.com>,
	"David S. Miller" <davem@davemloft.net>,
	Laura Abbott <labbott@fedoraproject.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	"Gustavo F. Padovan" <gustavo@padovan.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	"bluez mailin list (linux-bluetooth@vger.kernel.org)" 
	<linux-bluetooth@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	USB list <linux-usb@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [RESEND][PATCH] Bluetooth: Make request workqueue freezable
Date: Thu, 21 May 2015 06:21:01 +0200	[thread overview]
Message-ID: <s5hiobm5zo2.wl-tiwai@suse.de> (raw)
In-Reply-To: <555D1BF4.8020600@redhat.com>

At Wed, 20 May 2015 16:42:44 -0700,
Laura Abbott wrote:
> 
> On 05/20/2015 05:44 AM, Takashi Iwai wrote:
> > At Wed, 20 May 2015 11:46:31 +0200,
> > Marcel Holtmann wrote:
> >>
> >> Hi Oliver,
> >>
> >>>> The data is cached in RAM.  More specifically, the former loaded
> >>>> firmware files are reloaded and saved at suspend for each device
> >>>> object.  See fw_pm_notify() in firmware_class.c.
> >>>
> >>> OK, this may be a stupid idea, but do we know the firmware
> >>> was successfully loaded in the first place?
> >>> Also btusb is in the habit of falling back to a generic
> >>> firmware in some places. It seems to me that caching
> >>> firmware is conceptually not enough, but we'd also need
> >>> to record the absence of firmware images.
> >>
> >> in a lot of cases the firmware is optional. The device will operate fine without the firmware. There are a few devices where the firmware is required, but for many it just contains patches.
> >>
> >> It would be nice if we could tell request_firmware() if it is optional or mandatory firmware. Or if it should just cache the status of a missing firmware as well.
> >
> > OK, below is a quick hack to record the failed f/w files, too.
> > Not sure whether this helps, though.  Proper tests are appreciated.
> >
> >
> 
> This doesn't quite work. We end up with the name on fw_names but
> the firmware isn't actually on the firmware cache list.
> 
> If request_firmware fails to get the firmware from the filesystem,
> release firmware will be called which is going to free the
> firmware_buf which has been marked as failed anyway. The only
> way to make this work would be to always piggy back and increase
> the ref so it always stays around. But this also marks the firmware
> as a permanent failure. There would need to be a hook somewhere
> to force a cache drop, else there would be no way to add new
> firmware to a running system without a reboot.
> 
> Perhaps we split the difference: keep a list of firmware images
> that failed to load in the past and if one is requested during
> a time when usermodehelper isn't available, silently return an
> error? This way, if correct firmware is loaded at a regular time
> the item can be removed from the list.

Well, IMO, it's way too much expectation for the generic f/w loader.
The driver itself must know already which should be really loaded.
The fact is that it's the driver who calls the function that might not
work in the resume path.  So the driver can deal with such exceptions
at best.

This can be either delaying the f/w loading via proper UMH lock (like
my former patch or your patch) or avoiding the f/w request of
non-existing files that the driver already knows of.


Takashi

  reply	other threads:[~2015-05-21  4:21 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12  0:52 [RESEND][PATCH] Bluetooth: Make request workqueue freezable Laura Abbott
2015-05-12  1:07 ` Marcel Holtmann
2015-05-12  1:46   ` Laura Abbott
2015-05-12 15:14     ` Marcel Holtmann
2015-05-13  1:18       ` Laura Abbott
2015-05-19  9:46         ` Takashi Iwai
2015-05-19 14:26           ` Alan Stern
2015-05-19 14:52             ` Oliver Neukum
2015-05-19 15:22             ` Marcel Holtmann
2015-05-19 17:17               ` Alan Stern
2015-05-19 17:13             ` Takashi Iwai
2015-05-19 17:42               ` Oliver Neukum
2015-05-20  6:29                 ` Takashi Iwai
2015-05-20  8:40                   ` Oliver Neukum
2015-05-20  9:46                     ` Marcel Holtmann
2015-05-20 12:44                       ` Takashi Iwai
2015-05-20 23:42                         ` Laura Abbott
2015-05-21  4:21                           ` Takashi Iwai [this message]
2015-05-21 12:07                             ` Marcel Holtmann
2015-05-21 12:36                               ` Takashi Iwai
2015-05-21 14:18                                 ` Alan Stern
2015-05-21 14:39                                   ` Marcel Holtmann
2015-05-21 15:26                                     ` Alan Stern
2015-05-21 15:35                                       ` Takashi Iwai
2015-05-21 17:27                                         ` Arend van Spriel
2015-05-21 17:32                                           ` Takashi Iwai
2015-05-21 20:46                                             ` Arend van Spriel
2015-05-22 11:30                                               ` Oliver Neukum
2015-05-21 17:37                                         ` Alan Stern
2015-05-21 18:11                                           ` Takashi Iwai
2015-05-21 18:17                                             ` Laura Abbott
2015-05-22  0:21                                       ` Laura Abbott
2015-05-22  3:13                                         ` Marcel Holtmann
2015-05-28  0:47                                           ` Laura Abbott
2015-06-02  1:14                                           ` [PATCH 1/2] Bluetooth: Add reset_resume function Laura Abbott
2015-06-02  1:28                                             ` Marcel Holtmann
2015-06-02 14:17                                               ` Josh Boyer
2015-06-02 15:07                                                 ` Marcel Holtmann
2015-06-02  7:47                                             ` Oliver Neukum
2015-06-02  1:14                                           ` [PATCH 2/2] Bluetooth: btusb: " Laura Abbott
2015-06-02  1:32                                             ` Marcel Holtmann
2015-05-22  7:37                                         ` [RESEND][PATCH] Bluetooth: Make request workqueue freezable Arend van Spriel
2015-05-22  7:41                                           ` Arend van Spriel
2015-05-21 15:04                                   ` Takashi Iwai
2015-05-20 10:02                     ` Ming Lei

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=s5hiobm5zo2.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=davem@davemloft.net \
    --cc=gustavo@padovan.org \
    --cc=johan.hedberg@gmail.com \
    --cc=labbott@fedoraproject.org \
    --cc=labbott@redhat.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=ming.lei@canonical.com \
    --cc=netdev@vger.kernel.org \
    --cc=oneukum@suse.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=stern@rowland.harvard.edu \
    /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;
as well as URLs for NNTP newsgroup(s).