From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH V5] ALSA: usb-audio: Scarlett Gen 2 mixer interface Date: Wed, 10 Jul 2019 12:04:07 +0200 Message-ID: References: <20190709164743.GA26161@b4.vu> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B8E53F800DE for ; Wed, 10 Jul 2019 12:04:09 +0200 (CEST) In-Reply-To: <20190709164743.GA26161@b4.vu> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" To: "Geoffrey D. Bennett" Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org 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