Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3938000imm; Mon, 30 Jul 2018 06:09:06 -0700 (PDT) X-Google-Smtp-Source: AAOMgpegmYOFpAqGbLG9bhvSVsHKhjo3BcOdfDVlixWoAsVMPjp0RGh/NPgcae1NqSoyqCYsLON8 X-Received: by 2002:a63:a502:: with SMTP id n2-v6mr16546480pgf.263.1532956146548; Mon, 30 Jul 2018 06:09:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532956146; cv=none; d=google.com; s=arc-20160816; b=vPP1SD2OlopuSeaB+D0bHtcNdRwRFOPz4zllv6KQ45KslNLERsXdzkz+ol+uD8FCXi m3AYX5nlIdJXomrOsWVg7Ae/60tHxHhivg1ZMvrkxQ2qUnDbZTHchYjHEH3BUQJUv09+ cozwNoW59CJgF4FfO4fCXIVd3gZLcRHRIxwjn8Ts/KkZj80CdRkTrvyz6YGAE33U84SF GE8i/VlTEsrMZw5mW+uPqaAtfv9dzZDtrb2459WmrGDuC4DG1n6zfnT6oVV299C0GKCq uXCRf6pYXDG0SLJYBZO/eZqKNb4VAwv0eTBret+ly3Lj9ryRblUJ/TaNrqUtWdKIvdT8 sqqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date :arc-authentication-results; bh=hXSuYJ95/Xn4pS7b1hSpSUco+MkTcRRC0zUKARywLeY=; b=Mz9y3lfR+TzWjLAQ4V9vYjDTpSzBEVFfHqR0xBT80aSq00t1cPjLXasbCPmGVFoPTl ejLGvsspBoSvyM/CTPjYLWnGRq0ZHZ/vrrSa82RiJyldp4CzlJ74eXpbCFJoeT1IPE7S Vk4XPGlFi8jfnWj8EhcVTj8rKkAWZJHgJ7EkOxxYPzeUmLEdIN0QqXUsg7gu3iiYM9e4 QMm3SSyXVyWKstkWth7xputc8F+llaB1bAdB0uh/UEkjZn4vtFHUGtnQAbHUUk0jKSgE o0KxbvE+J5KNBOMBUrIV0502H+t2R3Jyjq6ozPAkrsmz3zYwcpJo3dxAYw07lhG/mCxp 4/MQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2-v6si11084519pge.64.2018.07.30.06.08.52; Mon, 30 Jul 2018 06:09:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731911AbeG3Omv (ORCPT + 99 others); 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