From patchwork Thu Apr 4 19:03:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 13618157 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7A4413049B for ; Thu, 4 Apr 2024 19:04:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712257447; cv=none; b=I2vKteDvVoD2RL2XkmwZ4+HrP/IM2c0NvtWYnDVL+lDbhMoRjo6cWoUvFN3Asbw6XyqWlnEwjtfTYr/mwB84+k//12QOPooa4XcwUXa0ctUP5Qhu33fT4ui2jKR3FGm39tbV91YEQIyarZV2jaeFxhRbdzgjHMGms+L6NNXn1hw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712257447; c=relaxed/simple; bh=gvWvwJz1TMcsZ+arLk6e5VFQm8nhkbazC2Uqjo8O/ic=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=RmvHL0j3mjbxuXBh/rqUowBFGbSVwcQHjzvZ4TszYtW+ZMELaqfVYcJk2dUIeOfCrhGblG2Nb7fCaiOEUuREXqSw6mM+FYK8KXvpK5FTEx7JhoLkVJ2A56sujljAKQM4D7mHDS5nH10LVr9991v6O6TBBeLPIEzT/4jicaRs8RY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=OZZt3G2G; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="OZZt3G2G" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712257446; x=1743793446; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gvWvwJz1TMcsZ+arLk6e5VFQm8nhkbazC2Uqjo8O/ic=; b=OZZt3G2GnlgOkidQD/eXN95wNF5LnfIs5ZuzDtv0AByEjwR/RxjjAE0h mKqWckbcswUqfIfkgYCoNEt/V+YaGUR85yHmnooA1Yul7Tn8jCH+7d0Fr 7V6IReALnTUKvFEWL9I7HddVqtHySrl9zFkz2htdIOhcSTevIDkju2pUv eSJ5CZQRMo+HIBe/T2NQgY9cxnSPZ7D+kttcvg8QUAlmsHQVh66RdYira hosPYJPf5dKjjPztiRO0f/3VVbySUBUwdXB6wZIY3pYUMfzhvbh9Wd0Jz cN18hYz30odTCDYdpoaC8uy6eWL04gt2iIen5jApiM47QczsdL4TlzHyq g==; X-CSE-ConnectionGUID: VBotZfZqQgikYtL7NkwF5A== X-CSE-MsgGUID: JYPee5qgTQm0cAyfQDxIEw== X-IronPort-AV: E=McAfee;i="6600,9927,11034"; a="7433860" X-IronPort-AV: E=Sophos;i="6.07,179,1708416000"; d="scan'208";a="7433860" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 12:04:04 -0700 X-CSE-ConnectionGUID: KHTE80dDQGaUdnzi4OBsNA== X-CSE-MsgGUID: xF8Og7J8Sc63xgcAh590cw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,179,1708416000"; d="scan'208";a="19492306" Received: from sparrish-mobl1.amr.corp.intel.com (HELO pbossart-mobl6.intel.com) ([10.212.119.106]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 12:04:04 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart , =?utf-8?q?P?= =?utf-8?q?=C3=A9ter_Ujfalusi?= , Bard Liao Subject: [PATCH 1/4] ASoC: SOF: Intel: hda-ctrl: add missing WAKE_STS clear Date: Thu, 4 Apr 2024 14:03:54 -0500 Message-Id: <20240404190357.138073-2-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240404190357.138073-1-pierre-louis.bossart@linux.intel.com> References: <20240404190357.138073-1-pierre-louis.bossart@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 For some reason, the programming sequences in the SOF driver do not include a clear of the WAKE_STS bits before resetting the controller. This clear is not formally required by the HDaudio specification, but was added to harden the snd-hda-reset back in 2007. Adding this sequence back avoids an issue reported by the Intel CI. Closes: https://github.com/thesofproject/linux/issues/4889 Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/intel/hda-ctrl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sound/soc/sof/intel/hda-ctrl.c b/sound/soc/sof/intel/hda-ctrl.c index 84bf01bd360a..b4f0756e21f6 100644 --- a/sound/soc/sof/intel/hda-ctrl.c +++ b/sound/soc/sof/intel/hda-ctrl.c @@ -184,6 +184,7 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev) struct hdac_bus *bus = sof_to_bus(sdev); struct hdac_stream *stream; int sd_offset, ret = 0; + u32 gctl; if (bus->chip_init) return 0; @@ -192,6 +193,12 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev) hda_dsp_ctrl_misc_clock_gating(sdev, false); + /* clear WAKE_STS if not in reset */ + gctl = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_GCTL); + if (gctl & SOF_HDA_GCTL_RESET) + snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, + SOF_HDA_WAKESTS, SOF_HDA_WAKESTS_INT_MASK); + /* reset HDA controller */ ret = hda_dsp_ctrl_link_reset(sdev, true); if (ret < 0) { From patchwork Thu Apr 4 19:03:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 13618158 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D80413249E for ; Thu, 4 Apr 2024 19:04:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712257447; cv=none; b=qE/bixC8AWMymEOagMkiOxFaHZ+ei6ffD31BtlIRMdLjOJ1V3eikteOYOo6no2mUNZ30LM4d51udEjSs1Zlfw7NPDgA73pb0uX2tjXDMdCmHqF3ZNsXaa3oEiNMvnHEfz/xCA4A8EWZWlOGLf+OdkEjfDIXs6JVXK4x+/SeMWA4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712257447; c=relaxed/simple; bh=dO0+Df+UCol+vwpv6OirQZXMXDUJ4CDtRVfQipUXjgI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ox1yRCPLpeI5j0UD9iS/eu23WC8T+Z0xhoQ8AoiC2Jb8/sGZFM+A0rqfijcJ2SXUcUuwXj12SKrCGwGlB2XZNVw0v4wUNFW0TDy4DZmf8A10Rw8ziwaW9uiMT24ktGH+Iny9h/OgGRzteyGNIwzLk5K6NE2i/P2AIp3CpxBj7OA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=FdL3robh; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="FdL3robh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712257446; x=1743793446; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dO0+Df+UCol+vwpv6OirQZXMXDUJ4CDtRVfQipUXjgI=; b=FdL3robhO/sqeARUqFbF1znZpmAIqrnz7lEqmq1hcqwJOyAWuh8JhK50 DY/vC0EJVuKp8ZBgiM0Ena307Ot9Dn6O/6KMiqeQ9tlSq+7O2dpiR4Swl g5yYRg6qc1kIdK5tPQ3fcBvnqxjmRHVwowe89jONOewZWVdkNCHHZa2Pn gPNhFgqfNP+fSL+RZl+lbzYy3WmXhXd9yHet37mpeUuBWDA8284MOv77a jdZrSGyoxTjrRnyFG2ODZp2yuNGB5hfMUnmhZzlSOMeOKvcvz0xXWO8hp NytfJXeGLPhJO9jmY8wp+SoYYf6fGIZ39C8swBYFDsFLLIJd+K0ZGs6Gh w==; X-CSE-ConnectionGUID: C5UCRk6GSAKPbfAoV8gM/w== X-CSE-MsgGUID: g8DOUSYAQbWrKIjOa7IPkA== X-IronPort-AV: E=McAfee;i="6600,9927,11034"; a="7433864" X-IronPort-AV: E=Sophos;i="6.07,179,1708416000"; d="scan'208";a="7433864" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 12:04:05 -0700 X-CSE-ConnectionGUID: NlKdAZtzQk+zr/P2+CC+Ug== X-CSE-MsgGUID: +h89JjrjQ0anJj+DMVWDLQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,179,1708416000"; d="scan'208";a="19492309" Received: from sparrish-mobl1.amr.corp.intel.com (HELO pbossart-mobl6.intel.com) ([10.212.119.106]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 12:04:05 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart , Bard Liao , Rander Wang Subject: [PATCH 2/4] ASoC: SOF: Intel: lnl: add helper to detect SoundWire wakes Date: Thu, 4 Apr 2024 14:03:55 -0500 Message-Id: <20240404190357.138073-3-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240404190357.138073-1-pierre-louis.bossart@linux.intel.com> References: <20240404190357.138073-1-pierre-louis.bossart@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The global STATESTS register will provide information on all links. Rather than iterate on all possible links, the helpers only filters the range of possible bits for a quick lookup. The process_wakeen() helper will walk through all the links and deal with wakes. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Rander Wang --- sound/soc/sof/intel/lnl.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sound/soc/sof/intel/lnl.c b/sound/soc/sof/intel/lnl.c index 95da0c626832..c3ee507e2e21 100644 --- a/sound/soc/sof/intel/lnl.c +++ b/sound/soc/sof/intel/lnl.c @@ -205,6 +205,23 @@ static int lnl_dsp_disable_interrupts(struct snd_sof_dev *sdev) return mtl_enable_interrupts(sdev, false); } +static bool lnl_sdw_check_wakeen_irq(struct snd_sof_dev *sdev) +{ + struct hdac_bus *bus = sof_to_bus(sdev); + u16 wake_sts; + + /* + * we need to use the global HDaudio WAKEEN/STS to be able to + * detect wakes in low-power modes. The link-specific information + * is handled in the process_wakeen() helper, this helper only + * detects a SoundWire wake without identifying the link. + */ + wake_sts = snd_hdac_chip_readw(bus, STATESTS); + + /* filter out the range of SDIs that can be set for SoundWire */ + return wake_sts & GENMASK(SDW_MAX_DEVICES, SDW_INTEL_DEV_NUM_IDA_MIN); +} + const struct sof_intel_dsp_desc lnl_chip_info = { .cores_num = 5, .init_core_mask = BIT(0), @@ -221,6 +238,7 @@ const struct sof_intel_dsp_desc lnl_chip_info = { .read_sdw_lcount = hda_sdw_check_lcount_ext, .enable_sdw_irq = lnl_enable_sdw_irq, .check_sdw_irq = lnl_dsp_check_sdw_irq, + .check_sdw_wakeen_irq = lnl_sdw_check_wakeen_irq, .check_ipc_irq = mtl_dsp_check_ipc_irq, .cl_init = mtl_dsp_cl_init, .power_down_dsp = mtl_power_down_dsp, From patchwork Thu Apr 4 19:03:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 13618159 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67FE013281B for ; Thu, 4 Apr 2024 19:04:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712257448; cv=none; b=VIOmV6Sko5Y+6SQcKDeD8pksA93ZgMVy1yb96jm+mbpP3t4gsAmYVY6PXqFAmxmairYVnHszyf+ebcf8WujQa6Agf2xcHndeld1MMu/g0wS7c6U0x0tEJZtkwwya5peUnLir5ZWXwQZeaDL9u9tuQqa6f/ZLPn0vKr5Z6UALHME= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712257448; c=relaxed/simple; bh=kpEVEkeUvSQHtIiwegnx0xTZnOZz10AbI8oxN1072Tk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Pzs2Ba9nFxJ9fgkNYfB0I5hJuOvapX7xlKX5rNEKpn5/tF2ADLIH0lIvT5ShOh/sY6rvPzbmS5YPrLPnf7ibWD6Ft2S1U8er8YWEeWM0J2WPGEYFTpJNCv6XqC+Qmev6FSDkzc7dGXxYyTFsZTxzzIWs+WM7gR7/7oqn4Iy9tlg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=BcMXR0V9; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="BcMXR0V9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712257448; x=1743793448; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kpEVEkeUvSQHtIiwegnx0xTZnOZz10AbI8oxN1072Tk=; b=BcMXR0V9UXXv6lmIHGOYm4+SF/8FC9HYdGWSS/TFlhD3B/yx4lA+TkBJ EFCn4u15zH5XfGEA71NaXhVNMHtjUTKtRDbHTFm3sQMVrrKPqTAH8mPJm N+JEVoJfoRFOJPJUPsPYaRu82Bmo7e6HTxPg6zySjBNaCp2O/XN8Dlqvg WV55Pj9tlsI+UbpUWj7l1qa1zyK6kDlydhZyM8wV8Q+c6kRn1whlyJn5u /HHrY+geJ33TXmbBpFh4tm2ke/CmxUKk7DR/RFDd9TekVPYYrM87o0iBa tyDKgnBL1hhMYZQfEfiOt+0HJanVJRdhJiFqdYOtW5FBWeXdohMkZcFIU g==; X-CSE-ConnectionGUID: +qXjfKxzRkGf1ABlG6uK5Q== X-CSE-MsgGUID: YGekhO2OTiSRGv+e7mis4g== X-IronPort-AV: E=McAfee;i="6600,9927,11034"; a="7433869" X-IronPort-AV: E=Sophos;i="6.07,179,1708416000"; d="scan'208";a="7433869" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 12:04:06 -0700 X-CSE-ConnectionGUID: yDlEFBh0QCy3ihaz907/og== X-CSE-MsgGUID: cdvmRj1QQnKO6vMm2LFLMA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,179,1708416000"; d="scan'208";a="19492314" Received: from sparrish-mobl1.amr.corp.intel.com (HELO pbossart-mobl6.intel.com) ([10.212.119.106]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 12:04:06 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart , Bard Liao , Keqiao Zhang Subject: [PATCH 3/4] ASoC: SOF: Intel: hda-codec: preserve WAKEEN values Date: Thu, 4 Apr 2024 14:03:56 -0500 Message-Id: <20240404190357.138073-4-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240404190357.138073-1-pierre-louis.bossart@linux.intel.com> References: <20240404190357.138073-1-pierre-louis.bossart@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Since LunarLake, we use the HDadio WAKEEN/WAKESTS to detect wakes for SoundWire codecs. Unfortunately, the existing code in hda_codec_jack_wake_enable() unconditionally resets the WAKEEN bits. This patch changes the initialization to preserve SoundWire WAKEEN bits. For HDAudio codecs the same strategy is used, WAKEEN is only set when the jacktbl.used property is set. Closes: https://github.com/thesofproject/linux/issues/4687 Co-developed-by: Bard Liao Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Reviewed-by: Keqiao Zhang Reviewed-by: Bard Liao --- sound/soc/sof/intel/hda-codec.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c index 9f84b0d287a5..6a13f38a8d21 100644 --- a/sound/soc/sof/intel/hda-codec.c +++ b/sound/soc/sof/intel/hda-codec.c @@ -79,18 +79,27 @@ void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev, bool enable) struct hdac_bus *bus = sof_to_bus(sdev); struct hda_codec *codec; unsigned int mask = 0; + unsigned int val = 0; if (IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT) && sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC)) return; if (enable) { - list_for_each_codec(codec, hbus) + list_for_each_codec(codec, hbus) { + /* only set WAKEEN when needed for HDaudio codecs */ + mask |= BIT(codec->core.addr); if (codec->jacktbl.used) - mask |= BIT(codec->core.addr); + val |= BIT(codec->core.addr); + } + } else { + list_for_each_codec(codec, hbus) { + /* reset WAKEEN only HDaudio codecs */ + mask |= BIT(codec->core.addr); + } } - snd_hdac_chip_updatew(bus, WAKEEN, STATESTS_INT_MASK, mask); + snd_hdac_chip_updatew(bus, WAKEEN, mask & STATESTS_INT_MASK, val); } EXPORT_SYMBOL_NS_GPL(hda_codec_jack_wake_enable, SND_SOC_SOF_HDA_AUDIO_CODEC); From patchwork Thu Apr 4 19:03:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 13618160 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B613132C15 for ; Thu, 4 Apr 2024 19:04:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712257448; cv=none; b=QIlMXMxQPdESs9WCnHYPPXfvj9E8n+QVkCudaxKKwrDfPqCrEbhOygPA/FUaF2ALNP9RqyPPnwL+2NSyMB5liWT5q7L3sLfU4eP7EaHmbnZJt9ROteJKCTA/SDvAchpm4SxWg6SmwCRZL7EJ0XhWIRZwMvuvh+/0YFPBTNcBxOQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712257448; c=relaxed/simple; bh=B0x6Qj2oJDAKQ1Pdrq4ENFEU6JUEvp6eTkcc5HdjsWg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ru1/IYrixfmy/YBKM0x10/iXRIybQHFl7WP8MkVG+BUUG9tKCh8X0OMTrRxk2gB1Ur0F8sO+zi8aWyop1rz8SaqkF2JwkADPt3jHa4cBtU5UTFVx19KB1MhX5NhFXM4VEgQheqqiRcYaUuAIG09DEr22Y5wjBE7+B0bEJkuFU0E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=PuEV91cF; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="PuEV91cF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712257448; x=1743793448; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=B0x6Qj2oJDAKQ1Pdrq4ENFEU6JUEvp6eTkcc5HdjsWg=; b=PuEV91cFTPMRgAsHP2xpmmZhhkyId5aDDQaqQIs6QcP2QtSJo1cAn7Tr HOtwxWVCP/tmyqkfWrI3dfnDNiF234dGd7DaimnWc36rZuLXnGsRF7MZE 9hOXl9koUGtrQCJzVEi3rBWq4dLJhoqHKvQjMPiFGDpjsoUDfaKP4IWfh zV5661kcygdh8jk3O4OLGCws7Gf2I6o26i/XJMEIV7ecli0bRi2I8cqQ5 co2nBm9pQl3Iyg2NDW/AjAuaK2zm9HLkCuKp8ePtm2jtDO2o7E2IBM/LD SfIPKbDX0dVyPohZFV1gaKmKfP3HTvEt6i7bLjD6fWmkohdLdJeFF69AE A==; X-CSE-ConnectionGUID: 3QkD/zyJQAC12Uz8D6rZ9A== X-CSE-MsgGUID: pa1zL0TqTGefRVsq0nLqHg== X-IronPort-AV: E=McAfee;i="6600,9927,11034"; a="7433875" X-IronPort-AV: E=Sophos;i="6.07,179,1708416000"; d="scan'208";a="7433875" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 12:04:07 -0700 X-CSE-ConnectionGUID: 0c2LHNSvR/2Me+42bP4DTA== X-CSE-MsgGUID: n9hlvTysRp+tGEPcu0YZGw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,179,1708416000"; d="scan'208";a="19492318" Received: from sparrish-mobl1.amr.corp.intel.com (HELO pbossart-mobl6.intel.com) ([10.212.119.106]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 12:04:06 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart , Bard Liao , Keqiao Zhang Subject: [PATCH 4/4] ASoC: SOF: Intel: hda-ctrl: only clear WAKESTS for HDaudio codecs Date: Thu, 4 Apr 2024 14:03:57 -0500 Message-Id: <20240404190357.138073-5-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240404190357.138073-1-pierre-louis.bossart@linux.intel.com> References: <20240404190357.138073-1-pierre-louis.bossart@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When a PME wake happens due to a SoundWire wake, we currently clear all WAKESTS bits during the resume operation initiated by the PCI subsystem. As a result, we are unable to identify which SoundWire links need to be resumed and don't properly handle jack detection. This patch only clears the WAKESTS bits for the HDaudio codecs detected earlier. Note that we still clear all WAKESTS bits unconditionally in hda_dsp_ctrl_stop_chip(). The existing behavior is potentially racy if e.g. a jack event happens during a suspend routine, but there's a risk of breaking shutdown or reboot sequences so the code is left as is for now. Closes: https://github.com/thesofproject/linux/issues/4687 Co-developed-by: Bard Liao Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Reviewed-by: Keqiao Zhang Reviewed-by: Bard Liao --- sound/soc/sof/intel/hda-ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/sof/intel/hda-ctrl.c b/sound/soc/sof/intel/hda-ctrl.c index b4f0756e21f6..6d941209847f 100644 --- a/sound/soc/sof/intel/hda-ctrl.c +++ b/sound/soc/sof/intel/hda-ctrl.c @@ -228,7 +228,7 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev) /* clear WAKESTS */ snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, SOF_HDA_WAKESTS, - SOF_HDA_WAKESTS_INT_MASK); + bus->codec_mask); hda_codec_rirb_status_clear(sdev);