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.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 B563EC388F9 for ; Fri, 23 Oct 2020 11:32:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5F6C22225F for ; Fri, 23 Oct 2020 11:32:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S463026AbgJWLcG (ORCPT ); Fri, 23 Oct 2020 07:32:06 -0400 Received: from mx2.suse.de ([195.135.220.15]:35344 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S462946AbgJWLcF (ORCPT ); Fri, 23 Oct 2020 07:32:05 -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 85443B1B6; Fri, 23 Oct 2020 11:32:04 +0000 (UTC) Date: Fri, 23 Oct 2020 13:32:04 +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" , alsa-devel@alsa-project.org (moderated list:SOUND), linux-kernel@vger.kernel.org (open list) Subject: Re: [PATCH 1/4] ALSA: hda: Refactor codec PM to use direct-complete optimization In-Reply-To: <20201023102340.25494-1-kai.heng.feng@canonical.com> References: <20201023102340.25494-1-kai.heng.feng@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 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. thanks, Takashi