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=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 04226C4363A for ; Fri, 23 Oct 2020 13:05:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A631520674 for ; Fri, 23 Oct 2020 13:05:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S464204AbgJWNFA (ORCPT ); Fri, 23 Oct 2020 09:05:00 -0400 Received: from mx2.suse.de ([195.135.220.15]:47678 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S464155AbgJWNE7 (ORCPT ); Fri, 23 Oct 2020 09:04:59 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C7B9AB210; Fri, 23 Oct 2020 13:04:58 +0000 (UTC) Date: Fri, 23 Oct 2020 15:04:58 +0200 Message-ID: From: Takashi Iwai To: Kai-Heng Feng Cc: tiwai@suse.com, Jaroslav Kysela , Pierre-Louis Bossart , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Harsha Priya , Randy Dunlap , "Gustavo A. R. Silva" , "moderated list:SOUND" , open list Subject: Re: [PATCH 1/4] ALSA: hda: Refactor codec PM to use direct-complete optimization In-Reply-To: <9D7D9C4C-3245-41A3-B0C4-D74FBB5FE91A@canonical.com> References: <20201023102340.25494-1-kai.heng.feng@canonical.com> <9D7D9C4C-3245-41A3-B0C4-D74FBB5FE91A@canonical.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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 23 Oct 2020 14:44:18 +0200, Kai-Heng Feng wrote: > > > > > On Oct 23, 2020, at 19:32, Takashi Iwai wrote: > > > > On Fri, 23 Oct 2020 12:23:35 +0200, > > Kai-Heng Feng wrote: > >> > >> +static void hda_codec_pm_complete(struct device *dev) > >> { > >> struct hda_codec *codec = dev_to_hda_codec(dev); > >> - int ret; > >> > >> - ret = pm_runtime_force_resume(dev); > >> - /* schedule jackpoll work for jack detection update */ > >> - if (codec->jackpoll_interval || > >> - (pm_runtime_suspended(dev) && hda_codec_need_resume(codec))) > >> - schedule_delayed_work(&codec->jackpoll_work, > >> - codec->jackpoll_interval); > >> - return ret; > >> + if (pm_runtime_suspended(dev) && > >> + (hda_codec_need_resume(codec) || codec->forced_resume)) > >> + pm_request_resume(dev); > > > > You shouldn't drop the check of codec->jackpoll_interval. If this > > field is set, the codec driver has to resume no matter what it was, so > > that the polling can start up again. > > Ok, will address in v2. Thanks. And, could you submit v2 series with a cover letter? Takashi