linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@canonical.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] firmware: Refactoring for splitting user-mode helper code
Date: Wed, 30 Jan 2013 19:48:15 +0800	[thread overview]
Message-ID: <CACVXFVMqxrjBKSnRENHYhd5=pfp3L2LchOzo8cLbp4eo1ph6FA@mail.gmail.com> (raw)
In-Reply-To: <s5h8v7brkqe.wl%tiwai@suse.de>

On Wed, Jan 30, 2013 at 7:08 PM, Takashi Iwai <tiwai@suse.de> wrote:
> At Wed, 30 Jan 2013 11:53:14 +0100,
> Takashi Iwai wrote:
>>
>> At Wed, 30 Jan 2013 18:50:05 +0800,
>> Ming Lei wrote:
>> >
>> > On Wed, Jan 30, 2013 at 6:31 PM, Takashi Iwai <tiwai@suse.de> wrote:
>> > >
>> > > But it's supposed to be cached, no?
>> >
>> > Generally it will be cached, but some crazy devices might come as new
>> > device during resume, so we still need to handle the situation.
>>
>> In that case, shouldn't we simply return an error instead of
>> usermodehelper lock (at least for direct loading)?
>
> The patch below is what I have in my mind...
>
>
> Takashi
>
> ---
> From: Takashi Iwai <tiwai@suse.de>
> Subject: [PATCH] firmware: Skip usermodehelper_lock for direct loading
>
> We don't need a user mode helper lock for the direct fw loading.
> This also reduces the use of timeout when user mode helper is
> disabled, thus we can move the code into ifdef block, too.
>
> For avoiding the possible call of request_firmware() without caching,
> add a check of suspend state for the direct loading case, and returns
> immediately if it's called during suspend/resume.  Then it proceeds to
> the user mode helper if enabled, or returns the error.
>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>  drivers/base/firmware_class.c | 97 ++++++++++++++++++++++++-------------------
>  1 file changed, 54 insertions(+), 43 deletions(-)
>
> diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
> index f1caad7..c973bb0 100644
> --- a/drivers/base/firmware_class.c
> +++ b/drivers/base/firmware_class.c
> @@ -88,13 +88,6 @@ enum {
>         FW_STATUS_ABORT,
>  };
>
> -static int loading_timeout = 60;       /* In seconds */
> -
> -static inline long firmware_loading_timeout(void)
> -{
> -       return loading_timeout > 0 ? loading_timeout * HZ : MAX_SCHEDULE_TIMEOUT;
> -}
> -
>  struct firmware_cache {
>         /* firmware_buf instance will be added into the below list */
>         spinlock_t lock;
> @@ -315,6 +308,9 @@ static bool fw_get_filesystem_firmware(struct device *device,
>         bool success = false;
>         char *path = __getname();
>
> +       if (device->power.is_suspended)
> +               return false;

The device which is requesting firmware is resumed  does not mean the
storage device has been resumed, so this check isn't enough.

Thanks,
--
Ming Lei

  reply	other threads:[~2013-01-30 11:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-29 14:46 [PATCH 0/4] firmware: Make user-mode helper optional (v3) Takashi Iwai
2013-01-29 14:46 ` [PATCH 1/4] firmware: Refactoring for splitting user-mode helper code Takashi Iwai
2013-01-30  3:37   ` Ming Lei
2013-01-30  7:17     ` Takashi Iwai
2013-01-30 10:25       ` Ming Lei
2013-01-30 10:31         ` Takashi Iwai
2013-01-30 10:50           ` Ming Lei
2013-01-30 10:53             ` Takashi Iwai
2013-01-30 11:08               ` Ming Lei
2013-01-30 11:08               ` Takashi Iwai
2013-01-30 11:48                 ` Ming Lei [this message]
2013-01-30 12:04                   ` Takashi Iwai
2013-01-29 14:46 ` [PATCH 2/4] firmware: Make user-mode helper optional Takashi Iwai
2013-01-29 14:46 ` [PATCH 3/4] firmware: Reduce ifdef CONFIG_FW_LOADER_USER_HELPER Takashi Iwai
2013-01-29 14:46 ` [PATCH 4/4] firmware: Ignore abort check when no user-helper is used Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2013-01-31 10:13 [PATCH 0/4] firmware: Make user-mode helper optional (v5) Takashi Iwai
2013-01-31 10:13 ` [PATCH 1/4] firmware: Refactoring for splitting user-mode helper code Takashi Iwai
2013-01-30 10:35 [PATCH 0/4] firmware: Make user-mode helper optional (v4) Takashi Iwai
2013-01-30 10:35 ` [PATCH 1/4] firmware: Refactoring for splitting user-mode helper code Takashi Iwai
2013-01-31  9:48   ` Ming Lei
2013-01-31  9:55     ` Takashi Iwai
2013-01-25 16:05 [PATCH 0/4] firmware: Make user-mode helper optional (v2) Takashi Iwai
2013-01-25 16:05 ` [PATCH 1/4] firmware: Refactoring for splitting user-mode helper code Takashi Iwai
2013-01-29 10:24   ` Ming Lei
2013-01-29 10:59     ` Takashi Iwai

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='CACVXFVMqxrjBKSnRENHYhd5=pfp3L2LchOzo8cLbp4eo1ph6FA@mail.gmail.com' \
    --to=ming.lei@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.de \
    /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).