From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87B7413F6DFF for ; Mon, 30 Jul 2018 13:07:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3FB1F20881 for ; Mon, 30 Jul 2018 13:07:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3FB1F20881 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731919AbeG3Omv (ORCPT ); Mon, 30 Jul 2018 10:42:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:52390 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726693AbeG3Omu (ORCPT ); Mon, 30 Jul 2018 10:42:50 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4F204AD9F; Mon, 30 Jul 2018 13:07:54 +0000 (UTC) Date: Mon, 30 Jul 2018 15:07:54 +0200 Message-ID: From: Takashi Iwai To: Jorge Sanjuan Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/4] ALSA: usb-audio: Add UAC3 Power Domains to suspend/resume In-Reply-To: <20180730092336.18741-4-jorge.sanjuan@codethink.co.uk> References: <20180719112215.4219-1-jorge.sanjuan@codethink.co.uk> <20180730092336.18741-1-jorge.sanjuan@codethink.co.uk> <20180730092336.18741-4-jorge.sanjuan@codethink.co.uk> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/26 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 30 Jul 2018 11:23:35 +0200, Jorge Sanjuan wrote: > > Set the UAC3 Power Domain state for an Audio Streaming interface > to D2 state before suspending the device (usb_driver callback). > This lets the device know there is no intention to use any of the > Units in the Audio Function and that the host is not going to > even listen for wake-up events (interrupts) on the units. > > When the usb_driver gets resumed, the state D0 (fully powered) will > be set. This ties up the UAC3 Power Domains to the runtime PM. > > Signed-off-by: Jorge Sanjuan > --- > sound/usb/card.c | 9 +++++++++ > sound/usb/pcm.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ > sound/usb/pcm.h | 2 ++ > 3 files changed, 59 insertions(+) > > diff --git a/sound/usb/card.c b/sound/usb/card.c > index a1ed798a1c6b..9c2a15b805c3 100644 > --- a/sound/usb/card.c > +++ b/sound/usb/card.c > @@ -808,6 +808,7 @@ static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) > snd_power_change_state(chip->card, SNDRV_CTL_POWER_D3hot); > if (!chip->num_suspended_intf++) { > list_for_each_entry(as, &chip->pcm_list, list) { > + snd_usb_pcm_suspend(as); > snd_pcm_suspend_all(as->pcm); The order of the call is doubtful. Supposing that snd_usb_pcm_suspend() makes the stream in D2 state, it should be done after actually stopping the stream. That is, it should be done after snd_pcm_suspend_all(). thanks, Takashi