[alsa-devel] [PATCH V5] ALSA: usb-audio: Scarlett Gen 2 mixer interface

Takashi Iwai tiwai at suse.de
Wed Jul 10 12:04:07 CEST 2019


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


More information about the Alsa-devel mailing list