Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp346227pxu; Tue, 5 Jan 2021 12:38:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDgLvXI2azb+BccSyBB9+tV6ag9Ee2N7vvFpGeUcU88wTzOgmAO8jO6rfqqoGdPhl12WvT X-Received: by 2002:a17:906:298c:: with SMTP id x12mr785533eje.244.1609879102030; Tue, 05 Jan 2021 12:38:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609879102; cv=none; d=google.com; s=arc-20160816; b=w87mxz+6XFPyaap+0DDQrMKU/B2sw1GGKR5y6Q2/GzyB7BaZKbpXrzRJ4wGj5Qihah omEY7lfgzPbyDnsBhYUbqHQLpMKYtCzp4HoY4QqEpyEGtHAvgtwZ/p4/DgQ5Mn5cHBgo RiXBebr+I/1f5disjQ2ShIWNkJ+6q1YMEK5UkeynZmAgxoWQmOhnE95OfUG1KgBrQLIT +GkG3yAai73JbPJwWssZqFbTnb+CtiNIqmnDXS9jQxq4HXLTmGfB6cee3ixD/tBkjIg0 4YeTtFVg51mqJHmNOBHQaNbqznU2I2ShXvTDqkGdJjH5kUY2Qd+D23FzCfy1t5eqOzaf 70og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:organization:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=ae7uD4IT+2XJc+bUJhzfhrDgOck7Y6igMWlc8134THs=; b=zfGEWDmBlse78RlHmBZuzRKyCcQQ5Hp2PVdlWFWvXZNjvzOoYfyxR7wC+U7bFFu8E5 jVdgwyvJaLBroUDRFmPUN4pXbXkqgPsqpcQUEuMVFssT70w/Nk7cgzwxNO6rmgesc4Ty lMwS/7HVQVKyOViY50b8cfsUocNn3Rical2sGImX6ud1HIO1G7/ZKJ6z/ncouUM8i2rt hZf1BaFLNswG2neUf+IurKeS1lH22u5yXH7FZAtHgbamBPP9Dr9m4ch5LJokSh6vPIAz eWL6FosNe4A8fxzrm67zGBAWs7d+ckTP986QLSEa8es8xfzZrvTpaWqsUz0L1qYMfEvG ozOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q10si71487eds.293.2021.01.05.12.37.58; Tue, 05 Jan 2021 12:38:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730412AbhAENCR (ORCPT + 99 others); Tue, 5 Jan 2021 08:02:17 -0500 Received: from mga14.intel.com ([192.55.52.115]:20960 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726308AbhAENCR (ORCPT ); Tue, 5 Jan 2021 08:02:17 -0500 IronPort-SDR: CXVMdRY+prz70H6xyBg17va6QOykrI0uyei8wACsGw/kMKebEspzGFWNQt/1Rah5OfRPDqRHOB CUkJAnIESeEA== X-IronPort-AV: E=McAfee;i="6000,8403,9854"; a="176317452" X-IronPort-AV: E=Sophos;i="5.78,476,1599548400"; d="scan'208";a="176317452" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2021 05:00:31 -0800 IronPort-SDR: kXyPxD3/i3+kNgTomQl+sswUl8Rflu/3/SRDgEEtE1Ld9v2Wray4IHsfXB2hJkeiC5YkBmUol3 alzeW5ytCncw== X-IronPort-AV: E=Sophos;i="5.78,476,1599548400"; d="scan'208";a="378861333" Received: from eliteleevi.tm.intel.com ([10.237.54.20]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2021 05:00:19 -0800 Date: Tue, 5 Jan 2021 14:57:19 +0200 (EET) From: Kai Vehmanen X-X-Sender: kvehmane@eliteleevi.tm.intel.com To: Kai-Heng Feng cc: pierre-louis.bossart@linux.intel.com, lgirdwood@gmail.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com, daniel.baluta@nxp.com, Mark Brown , Jaroslav Kysela , Takashi Iwai , Guennadi Liakhovetski , Rander Wang , Payal Kshirsagar , "moderated list:SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS" , "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: Re: [PATCH v2 1/3] ASoC: SOF: Intel: hda: Resume codec to do jack detection In-Reply-To: <20210104140853.228448-1-kai.heng.feng@canonical.com> Message-ID: References: <20210104140853.228448-1-kai.heng.feng@canonical.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7 02160 Espoo MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, 4 Jan 2021, Kai-Heng Feng wrote: > Instead of queueing jackpoll_work, runtime resume the codec to let it > use different jack detection methods based on jackpoll_interval. hmm, but jackpoll_work() does the same thing, right? So end result should be the same. > This matches SOF driver's behavior with commit a6e7d0a4bdb0 ("ALSA: hda: > fix jack detection with Realtek codecs when in D3"). Since SOF only uses > Realtek codec, we don't need any additional check for the resume. This is not quite correct. First, SOF does support any HDA codec, not just Realteks (see e.g. https://github.com/thesofproject/linux/issues/1807), and second, this doesn't really match the hda_intel.c patch you mention. SOF implements a more conservative approach where we basicly assume codec->forced_resume=1 to always apply, and do not implement support for codec->relaxed_resume. So the above patch doesn't fully apply to SOF as the design is not same. > diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c > index 6875fa570c2c..df59c79cfdfc 100644 > --- a/sound/soc/sof/intel/hda-codec.c > +++ b/sound/soc/sof/intel/hda-codec.c > @@ -93,8 +93,7 @@ void hda_codec_jack_check(struct snd_sof_dev *sdev) > * has been recorded in STATESTS > */ > if (codec->jacktbl.used) > - schedule_delayed_work(&codec->jackpoll_work, > - codec->jackpoll_interval); > + pm_request_resume(&codec->core.dev); I think this change is still good. Just drop the but about Realtek codecs from commit message and maybe s/matches/aligns/. Br, Kai