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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux