All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "Geoffrey D. Bennett" <g@b4.vu>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH V5] ALSA: usb-audio: Scarlett Gen 2 mixer interface
Date: Wed, 10 Jul 2019 12:04:07 +0200	[thread overview]
Message-ID: <s5hef2yryso.wl-tiwai@suse.de> (raw)
In-Reply-To: <20190709164743.GA26161@b4.vu>

On Tue, 09 Jul 2019 18:47:43 +0200,
Geoffrey D. Bennett wrote:
> 
> +static void snd_scarlett_gen2_private_suspend(struct usb_mixer_interface *mixer)
> +{
> +	struct scarlett2_mixer_data *private = mixer->private_data;
> +
> +	cancel_delayed_work_sync(&private->work);
> +}

Canceling the pending work is the right thing for suspend, but we need
reconsidering the side effect.  For example, the device might be
removed while the machine is in sleep.  And the purpose of the
scheduled work is to sync the config to NVRAM.  That is, it should
have been done before going to suspend.  Then we don't have to resume
the task at resume, too.

That said, the best would be:
- cancel the pending work, check the return value
- re-execute the work immediately (delay=0) if the work was canceled
  in the above, and do flush -- or just call the function directly


thanks,

Takashi

      reply	other threads:[~2019-07-10 10:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-09 16:47 [PATCH V5] ALSA: usb-audio: Scarlett Gen 2 mixer interface Geoffrey D. Bennett
2019-07-10 10:04 ` 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=s5hef2yryso.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=g@b4.vu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.