Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2352471imu; Thu, 24 Jan 2019 11:13:12 -0800 (PST) X-Google-Smtp-Source: ALg8bN7hEznZAo/TZPh/UF5JlOdN/qovOIGTY7EN/1UnEBV2EyS26wFMWsjlhKIHETZMEhL5ACRg X-Received: by 2002:a17:902:227:: with SMTP id 36mr7850607plc.140.1548357192105; Thu, 24 Jan 2019 11:13:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548357192; cv=none; d=google.com; s=arc-20160816; b=uJHZMI2BRKjNFlZOkqQ2UWU1pc8ylyFZg04HJ1+8frO4CCAWTHBdKR1G1iu/xbM+JU aXRDevD+WZpy0dYbgOzB8NMHoVTwlQQPn0Ak6nWbE0/T4E/sN4+DPywSf58ko74T03S0 LhoWdp+G0S9wBNq2+RBjISKtGHLq2jxEUmV+coco4vl6rLYiA4nu3lQP0uiT5anDSOe0 mzyTzKOVUNXdxBXv/y4kpH5jYC3pPq4l5M/UL6DYpvxqxSIPMv3iZIcOlWyPkC7R0NCU ZAYVir49558t/82fEls6uBHzpvrFfPcBL/uLfP3WiezTJhqo5sO0hdE42wJHPpKXwqoA eQoQ== 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; bh=ajYNK0tdXNqippujJZ1+m597PlhCaB+RFpoD2zaufLk=; b=M8Ar7DQjLecR0Dgz946o8Chn8WzeGU7jmpZE3AUBGZLbrZYpgT+Ljlvg0lMbCjtamm gRLH03AuNa6i22t0mINMQaYlBqIlACj0GSjcw9UgInQGJq+R7VeJ+LcoW+1y60z1OnS/ Tem44xRIuAqrpolugl83FaN3Ch6Z0F5yRLe2mB/uExG3DzC27aa1iK816RwsQZW0riUT 2Qq2o7Dduy3KqCJiCLAulpBPOjCN2OT4LBkGS+EZyKyCjGK16WvyAMhb7yC1zl/m6fVL U8UVzPtveUPqeus0jZV+fM1DhDIH2/AV8g9vZMDCYvVTY1iEK4AF8p0hyFZwPT4P9utM WapA== 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 n8si571268plp.137.2019.01.24.11.12.55; Thu, 24 Jan 2019 11:13:12 -0800 (PST) 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 S1728796AbfAXTMn (ORCPT + 99 others); Thu, 24 Jan 2019 14:12:43 -0500 Received: from mx2.suse.de ([195.135.220.15]:34812 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725909AbfAXTMn (ORCPT ); Thu, 24 Jan 2019 14:12:43 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E9C98AE52; Thu, 24 Jan 2019 19:12:41 +0000 (UTC) Date: Thu, 24 Jan 2019 20:12:41 +0100 Message-ID: From: Takashi Iwai To: Sameer Pujar Cc: , , , Subject: Re: [PATCH] ALSA: hda: runtime PM is always active In-Reply-To: <3475c359-34ce-c04b-24dc-79458b2b3e2a@nvidia.com> References: <1548345432-11449-1-git-send-email-spujar@nvidia.com> <770a8e0e-3e20-6997-3342-98a3656e14c1@nvidia.com> <3475c359-34ce-c04b-24dc-79458b2b3e2a@nvidia.com> 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 24 Jan 2019 20:01:13 +0100, Sameer Pujar wrote: > > > On 1/25/2019 12:13 AM, Takashi Iwai wrote: > > On Thu, 24 Jan 2019 19:15:12 +0100, > > Sameer Pujar wrote: > >> > >> On 1/24/2019 9:34 PM, Takashi Iwai wrote: > >>> On Thu, 24 Jan 2019 16:57:11 +0100, > >>> Sameer Pujar wrote: > >>>> The runtime PM count is incremented and set to active during hda codec > >>>> device init, but it is decremented and set to suspend during exit only. > >>>> Hence the runtime PM status is always active and hda device cannot be > >>>> put to runtime suspend. Keeping device usage active for entire period, > >>>> though nothing really happening on the device, seems unnecessary. > >>>> > >>>> This patch avoides incrementing runtime PM usage count of the device. > >>>> > >>>> Signed-off-by: Sameer Pujar > >>>> Reviewed-by: Ravindra Lokhande > >>>> Reviewed-by: Mohan Kumar D > >>> This breaks the existing things, I'm afraid. > >>> Did you really test and verify the behavior...? > >>> > >>> The runtime PM refcount is decremented at snd_hda_codec_register(), > >>> and that's the place to let runtime suspend of the codec really > >>> effective. (It's not about the controller, though.) > >>> > >> It worked fine at my end. I could put the device to runtime suspend > >> and resume it back multiple times. > >> Since you are suggesting it could break things, let me rework on the > >> patch and dig up a little more to > >> see if there is better way to fix this. > > Well, I don't see what you want to "fix". Do you see any bug? > I was expecting the device to be runtime suspended, once probe is > finished, until I playback something on it. > But it appears that rutntime PM is always active and runtime PM > suspend callback never happens. Does the behavior really appear? If so, it's a bug. The current design is to enable the runtime PM *after* the device registration. Otherwise it makes no sense -- the problem doesn't finish yet before that point. thanks, Takashi