Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9330DC433EF for ; Thu, 18 Nov 2021 21:28:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 65CD6610A5 for ; Thu, 18 Nov 2021 21:28:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230184AbhKRVbX (ORCPT ); Thu, 18 Nov 2021 16:31:23 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:35618 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229795AbhKRVbW (ORCPT ); Thu, 18 Nov 2021 16:31:22 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 68F5521637; Thu, 18 Nov 2021 21:28:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1637270901; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Tj2qDPPH7/fdXs4s6fVfZvvEYvOEPb6jEe+qwBqRPH8=; b=cp3egkErElQpA+Ra7uYswz6PK0JERQXemVSktGQsv51ws29izSgOQCpgh45l1WaDKe6oXA 8GWSJ2sL2rkR0hWw8pX6gQ8btoYTXzeWV5YgbkegDJ5OIN4rH2Z06G3CcRat/kQ5vsu6zD 0Tpd8VWy1DwOkpYTTwrrmlZbpYO8axM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1637270901; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Tj2qDPPH7/fdXs4s6fVfZvvEYvOEPb6jEe+qwBqRPH8=; b=pafceiVa6nM/LRnWYfPESgkuUKJYb65IQix2SV4X5OsVD3au22KjfuJoo/zym6uLaAKgND H0295qba0vh5VsAQ== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 5B2CBA3B83; Thu, 18 Nov 2021 21:28:21 +0000 (UTC) Date: Thu, 18 Nov 2021 22:28:21 +0100 Message-ID: From: Takashi Iwai To: Heiner Kallweit Cc: alsa-devel@alsa-project.org, Linux PM Subject: Re: Warning due to "ALSA: hda: intel: More comprehensive PM runtime setup for controller driver" In-Reply-To: References: 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/25.3 (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 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Thu, 18 Nov 2021 21:33:34 +0100, Heiner Kallweit wrote: > > I get the following warning caused by 4f66a9ef37d3 ("ALSA: hda: intel: More > comprehensive PM runtime setup for controller driver"): > > snd_hda_intel 0000:00:1f.3: Unbalanced pm_runtime_enable! > > Not sure how this patch was tested because the warning is obvious. > The patch doesn't consider what the PCI sub-system does with regard to > RPM. Have a look at pci_pm_init(). > > I'd understand to add the call to pm_runtime_dont_use_autosuspend(), > but for all other added calls I see no justification. > > If being unsure about when to use which RPM call best involve > linux-pm@vger.kernel.org. Thanks for the notice. It's been through Intel CI and tests on a few local machines, maybe we haven't checked carefully those errors but only concentrated on the other issues, as it seems. There were two problems: one was the runtime PM being kicked off even during the PCI driver remove call, and another was the proper runtime PM setup after re-binding. For avoiding the former, only the pm_runtime_forbid() (and maybe pm_runtime_dont_use_autosuspend(), too) would suffice? Also, for PCI device, no need for pm_runtime_set_supended() at remove, right? thanks, Takashi