From patchwork Thu Jul 7 12:41:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12909433 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E54BDC43334 for ; Thu, 7 Jul 2022 12:33:21 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id F3BB41633; Thu, 7 Jul 2022 14:32:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F3BB41633 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657197200; bh=s8nu2trcXAU6d4rmDzjfp9vfQkXb4kOjxyApbM6NVHw=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qyHG4sZgLBnsbynFbfSuQL2VeQ8qoTBIAcL2gzzg+/BdAxCSSO6KHEMfIYW/kVHWJ sY90hzBVoqXNzoExUa5SRIJVOPsidCErZHtU6pNbxCsECZ4hRdrl2dVuDltFA1rRXo HrdIK6WqECOcHoxGhyUximBooAuq5arl2TKHmPEg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3E225F8016A; Thu, 7 Jul 2022 14:32:03 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 71C37F80539; Thu, 7 Jul 2022 14:32:02 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C3153F800C5 for ; Thu, 7 Jul 2022 14:31:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C3153F800C5 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="NhyAzxH4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657197117; x=1688733117; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=s8nu2trcXAU6d4rmDzjfp9vfQkXb4kOjxyApbM6NVHw=; b=NhyAzxH4AzLb8n+4WbI10rFupLld6VQNjFli13i2/HQXvK3BGbZV5hqA MO0UwfZJsqO5k1nbhdU6Fhu5K21oE/LzvhcWesE3T5hXPbS1i41hGv1ho dljEoLZglSimA4XL683SPfDtv2WjAvhkwaojH7QfigBiQiX+GZmItybva AHEaP50RIz2eq+JRkqAbD6uspeLUDzqfMwVPdhdm0dTY1/m/ej+UlQ+Rw ehFeNfzzbSJrNRil34mtL5cSqx1pMe2BSTJL/x6YL6YnKs3N6RyHc56zx 5LZzWSze+57akHa8Sb6DHZHX7ikRWW7RH0kSdHmjL3JUtyenr9IJtYnKx A==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="272805882" X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="272805882" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2022 05:31:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="593720550" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orsmga002.jf.intel.com with ESMTP; 07 Jul 2022 05:31:48 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 01/12] ASoC: Intel: avs: Register HDAudio ext-bus operations Date: Thu, 7 Jul 2022 14:41:42 +0200 Message-Id: <20220707124153.1858249-2-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220707124153.1858249-1-cezary.rojewski@intel.com> References: <20220707124153.1858249-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" With ASoC representation of HDAudio codec added, update bus initiazation to complete it. Signed-off-by: Cezary Rojewski --- sound/soc/intel/Kconfig | 2 +- sound/soc/intel/avs/core.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig index e5107a3ce16a..ded903f95b67 100644 --- a/sound/soc/intel/Kconfig +++ b/sound/soc/intel/Kconfig @@ -216,7 +216,7 @@ config SND_SOC_INTEL_AVS depends on COMMON_CLK select SND_SOC_ACPI if ACPI select SND_SOC_TOPOLOGY - select SND_HDA + select SND_SOC_HDA select SND_HDA_EXT_CORE select SND_HDA_DSP_LOADER select SND_INTEL_DSP_CONFIG diff --git a/sound/soc/intel/avs/core.c b/sound/soc/intel/avs/core.c index 3a0997c3af2b..664f87c33e9d 100644 --- a/sound/soc/intel/avs/core.c +++ b/sound/soc/intel/avs/core.c @@ -23,6 +23,7 @@ #include #include #include +#include "../../codecs/hda.h" #include "avs.h" #include "cldma.h" @@ -356,7 +357,7 @@ static int avs_bus_init(struct avs_dev *adev, struct pci_dev *pci, const struct struct device *dev = &pci->dev; int ret; - ret = snd_hdac_ext_bus_init(&bus->core, dev, NULL, NULL); + ret = snd_hdac_ext_bus_init(&bus->core, dev, NULL, &soc_hda_ext_bus_ops); if (ret < 0) return ret; From patchwork Thu Jul 7 12:41:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12909443 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 891C8C43334 for ; Thu, 7 Jul 2022 12:33:42 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9EC27162F; Thu, 7 Jul 2022 14:32:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9EC27162F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657197220; bh=lXvpWcDjkZVCDIYvO9U+SgSDw9/2CcD+i1vW3uk7mQQ=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=f9A9t4Vd5UvnfJFmG7JkvLQ+Oy+bdHMkovz4oK4l/SzDU/A/+qolE0L2YCFIq16Fa Y+GSCpApjyzDemUBCxifhwLyYNMM5a8SoyU3eO6AwJ7iG7NHLX+sWevHF4nE/ZXE7r 0pizkWDOGcxAX5jNpIs0ksFvKs9FCtiGFm+g6wgA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id F20F3F80538; Thu, 7 Jul 2022 14:32:04 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C196FF8053D; Thu, 7 Jul 2022 14:32:03 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F0058F80137 for ; Thu, 7 Jul 2022 14:31:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F0058F80137 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="JYJEpd1d" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657197118; x=1688733118; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lXvpWcDjkZVCDIYvO9U+SgSDw9/2CcD+i1vW3uk7mQQ=; b=JYJEpd1dblfpV68hnq38Jit6iFhkVngCTvABsRGTvLwfQKl8S2+w1/Eo 14XFds6McNH7nzyZcgSJqZ2ERRe+Sj2xzK07nlLfRys5OSGf3TjHVKA1j emHR5IvQYsAWt8Avu+oO3wjRNPGpTwB5xMWnEMVaf6hz8icpgvXGT74lA MWvKAh4Dzafto+F77GQPBiXlCA/b0EtV5m6mt9mK/p+DuzEAxBStgYLTy SsmVGXYQPqM2ji85hnCiqxDr2flAbbB4kWnkfk6VEO1zkQHHoW037fMKc m4AiaTaByxiN1NnjPsG4zEIagm2YRCxpwW3NOq7mOsqaw72DLztJUrjCi A==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="272805888" X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="272805888" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2022 05:31:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="593720559" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orsmga002.jf.intel.com with ESMTP; 07 Jul 2022 05:31:50 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 02/12] ASoC: Intel: avs: Assign I2S gateway when parsing topology Date: Thu, 7 Jul 2022 14:41:43 +0200 Message-Id: <20220707124153.1858249-3-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220707124153.1858249-1-cezary.rojewski@intel.com> References: <20220707124153.1858249-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" For formatted port - ssp%d - descriptions to have an effect, copier module templates need to be updated with specified port value. This value is later propagated to the firmware when module instances are being instantiated. Signed-off-by: Cezary Rojewski --- sound/soc/intel/avs/topology.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sound/soc/intel/avs/topology.c b/sound/soc/intel/avs/topology.c index 6a06fe387d13..8a9f9fc48938 100644 --- a/sound/soc/intel/avs/topology.c +++ b/sound/soc/intel/avs/topology.c @@ -808,6 +808,30 @@ static const struct avs_tplg_token_parser pin_format_parsers[] = { }, }; +static void +assign_copier_gtw_instance(struct snd_soc_component *comp, struct avs_tplg_modcfg_ext *cfg) +{ + struct snd_soc_acpi_mach *mach; + + if (!guid_equal(&cfg->type, &AVS_COPIER_MOD_UUID)) + return; + + /* Only I2S boards assign port instance in ->i2s_link_mask. */ + switch (cfg->copier.dma_type) { + case AVS_DMA_I2S_LINK_OUTPUT: + case AVS_DMA_I2S_LINK_INPUT: + break; + default: + return; + } + + mach = dev_get_platdata(comp->card->dev); + + /* Automatic assignment only when board describes single SSP. */ + if (hweight_long(mach->mach_params.i2s_link_mask) == 1 && !cfg->copier.vindex.i2s.instance) + cfg->copier.vindex.i2s.instance = __ffs(mach->mach_params.i2s_link_mask); +} + static int avs_tplg_parse_modcfg_ext(struct snd_soc_component *comp, struct avs_tplg_modcfg_ext *cfg, struct snd_soc_tplg_vendor_array *tuples, @@ -827,6 +851,9 @@ static int avs_tplg_parse_modcfg_ext(struct snd_soc_component *comp, if (ret) return ret; + /* Update copier gateway based on board's i2s_link_mask. */ + assign_copier_gtw_instance(comp, cfg); + block_size -= esize; /* Parse trailing in/out pin formats if any. */ if (block_size) { From patchwork Thu Jul 7 12:41:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12909453 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D97E9C433EF for ; Thu, 7 Jul 2022 12:36:17 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2BBD51687; Thu, 7 Jul 2022 14:35:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2BBD51687 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657197376; bh=n846Hs3c9MgbTP/DPAz9yuXRlEggHqNa7XZGEypGi/s=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Fr5D1diPR/D0ATw+71TM4PTN2yiiCZWt2RklzAhRn0HlbcRSqB0wFNAK9VJd55Fo1 cF8tq+XSpSyBVqwNbi6T1+PDU4HOLff5Z2bHKZxok/N6BRuCyaOuo3nAiieUF4mI8I cy7JXEUFgTxjLckzqSaAPW5BYBQ2smPE/ZY1lWbg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DD2C5F805A0; Thu, 7 Jul 2022 14:32:59 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 28067F804F1; Thu, 7 Jul 2022 14:32:57 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 30D28F8028D for ; Thu, 7 Jul 2022 14:31:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 30D28F8028D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hvgAwjhh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657197119; x=1688733119; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=n846Hs3c9MgbTP/DPAz9yuXRlEggHqNa7XZGEypGi/s=; b=hvgAwjhhD2TCgVbnEKtoxpzVdhXVOtfsiYpIGlknxpKnkcipkmkJag2Z NY1ap4kpD57z8EGVgbtYHSBz2YdvneTbIMGWIv1W7U9xa0f5/YT6VZvxH iogkFbWsoOrWppBz+pWQ5lsgSuVJWYMxhmzfBfgJLh+FbPMFNEK1/MVaB ArYXgAutIjFzPi1qwTZdYpcgewVztk7GpPRvSMTx6uwGV6Md53mQqger8 wcrsM/0GD9t8tjXedaIvi9lyYslwV0+DI4HPZ1pEmNj26sIqe6Wi2Bkkx NN8dR1CoA5ekJIiG8+4uFvk1X9vGakrafIWG+RHQhsdU8qUO4xhsr/ur2 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="272805898" X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="272805898" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2022 05:31:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="593720567" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orsmga002.jf.intel.com with ESMTP; 07 Jul 2022 05:31:52 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 03/12] ASoC: Intel: avs: Relax DSP core transition timings Date: Thu, 7 Jul 2022 14:41:44 +0200 Message-Id: <20220707124153.1858249-4-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220707124153.1858249-1-cezary.rojewski@intel.com> References: <20220707124153.1858249-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" To avoid any false positives when checking CPA after setting SPA, do a short wait. For stall operation, give HW more time to propagate the change before moving on. Signed-off-by: Cezary Rojewski --- sound/soc/intel/avs/dsp.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/avs/dsp.c b/sound/soc/intel/avs/dsp.c index 06d2f7af520f..b881100d3e02 100644 --- a/sound/soc/intel/avs/dsp.c +++ b/sound/soc/intel/avs/dsp.c @@ -13,6 +13,7 @@ #define AVS_ADSPCS_INTERVAL_US 500 #define AVS_ADSPCS_TIMEOUT_US 50000 +#define AVS_ADSPCS_DELAY_US 1000 int avs_dsp_core_power(struct avs_dev *adev, u32 core_mask, bool power) { @@ -26,6 +27,8 @@ int avs_dsp_core_power(struct avs_dev *adev, u32 core_mask, bool power) value = power ? mask : 0; snd_hdac_adsp_updatel(adev, AVS_ADSP_REG_ADSPCS, mask, value); + /* Delay the polling to avoid false positives. */ + usleep_range(AVS_ADSPCS_DELAY_US, 2 * AVS_ADSPCS_DELAY_US); mask = AVS_ADSPCS_CPA_MASK(core_mask); value = power ? mask : 0; @@ -82,11 +85,15 @@ int avs_dsp_core_stall(struct avs_dev *adev, u32 core_mask, bool stall) reg, (reg & mask) == value, AVS_ADSPCS_INTERVAL_US, AVS_ADSPCS_TIMEOUT_US); - if (ret) + if (ret) { dev_err(adev->dev, "core_mask %d %sstall failed: %d\n", core_mask, stall ? "" : "un", ret); + return ret; + } - return ret; + /* Give HW time to propagate the change. */ + usleep_range(AVS_ADSPCS_DELAY_US, 2 * AVS_ADSPCS_DELAY_US); + return 0; } int avs_dsp_core_enable(struct avs_dev *adev, u32 core_mask) From patchwork Thu Jul 7 12:41:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12909444 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F0343C433EF for ; Thu, 7 Jul 2022 12:33:52 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3830D166F; Thu, 7 Jul 2022 14:33:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3830D166F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657197231; bh=T2E0Q5fFnkdrzMkBZrVO1W+FKXmZjaVF5kOzboU7Is8=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FyxNij2YsDMX9esgSe1E3SwTMTr3U4gTKW6cLMP43OGoryzU0unyeDMEs3YRIWUzR qSvtFCNpcnBqxgJe7Q7KuTGNwUZS/+5Vy/nx9nUSiP2/QABxWLFPHdfVEkqfpJy18G /8MBxlrJqBpVXwyLQE2F1XY46I/NuDlmOQYVYLDw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 92FFDF80544; Thu, 7 Jul 2022 14:32:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 872B1F800DF; Thu, 7 Jul 2022 14:32:07 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C9AADF800DF for ; Thu, 7 Jul 2022 14:31:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C9AADF800DF Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="mzF8mQpx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657197119; x=1688733119; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=T2E0Q5fFnkdrzMkBZrVO1W+FKXmZjaVF5kOzboU7Is8=; b=mzF8mQpxoLWm4yORtmr/TFncpxawIYVG6/6aZZyAqcuV5YuJ8ZnMbVk2 LygaSO3LLCw4oebvha6zpGgXb2bbx8H+cJp93LoGPlNGXAvwG1jqVCRgw 5mHsx9hbiD2xVVFa9fdWeZ1RObUDmoe2EG7ln5MA2UVv+JOfQSmmusTmA atEKbAMVUVb85nDpxuUF2M8nfYvxAL0m+km4Dr7rXJEjRB/H2c4Jpn6ZY tU0CAV68cPeUrHM0rNzEUxADywOAuX8Pr/zgugGEjoq9ocsaTwhgoaJC7 UXZC/6vQlu3rr0dPmkLt5xViQUv129/jgRcByi6asp6KWTj26XL80pnJ0 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="272805907" X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="272805907" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2022 05:31:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="593720576" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orsmga002.jf.intel.com with ESMTP; 07 Jul 2022 05:31:54 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 04/12] ASoC: Intel: avs: Copy only as many RX bytes as necessary Date: Thu, 7 Jul 2022 14:41:45 +0200 Message-Id: <20220707124153.1858249-5-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220707124153.1858249-1-cezary.rojewski@intel.com> References: <20220707124153.1858249-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" There is no need to copy number of bytes specified by IPC message caller if DSP firmware returned lower number. In consequence, LARGE_CONFIG_GET handler is simplified. Signed-off-by: Cezary Rojewski --- sound/soc/intel/avs/ipc.c | 1 + sound/soc/intel/avs/messages.c | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/soc/intel/avs/ipc.c b/sound/soc/intel/avs/ipc.c index d755ba8b8518..020d85c7520d 100644 --- a/sound/soc/intel/avs/ipc.c +++ b/sound/soc/intel/avs/ipc.c @@ -480,6 +480,7 @@ static int avs_dsp_do_send_msg(struct avs_dev *adev, struct avs_ipc_msg *request ret = ipc->rx.rsp.status; if (reply) { reply->header = ipc->rx.header; + reply->size = ipc->rx.size; if (reply->data && ipc->rx.size) memcpy(reply->data, ipc->rx.data, reply->size); } diff --git a/sound/soc/intel/avs/messages.c b/sound/soc/intel/avs/messages.c index 6404fce8cde4..3559fb496e0b 100644 --- a/sound/soc/intel/avs/messages.c +++ b/sound/soc/intel/avs/messages.c @@ -378,7 +378,6 @@ int avs_ipc_get_large_config(struct avs_dev *adev, u16 module_id, u8 instance_id union avs_module_msg msg = AVS_MODULE_REQUEST(LARGE_CONFIG_GET); struct avs_ipc_msg request; struct avs_ipc_msg reply = {{0}}; - size_t size; void *buf; int ret; @@ -406,15 +405,14 @@ int avs_ipc_get_large_config(struct avs_dev *adev, u16 module_id, u8 instance_id return ret; } - size = reply.rsp.ext.large_config.data_off_size; - buf = krealloc(reply.data, size, GFP_KERNEL); + buf = krealloc(reply.data, reply.size, GFP_KERNEL); if (!buf) { kfree(reply.data); return -ENOMEM; } *reply_data = buf; - *reply_size = size; + *reply_size = reply.size; return 0; } From patchwork Thu Jul 7 12:41:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12909452 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C54D1C43334 for ; Thu, 7 Jul 2022 12:36:02 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 02D2B167B; Thu, 7 Jul 2022 14:35:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 02D2B167B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657197361; bh=CNXKc1141cIxL1CggFk+aekG0XSLbDs/PG7XDdSjcmQ=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=IBG0Sdn6Rt3utNxd+rHBmUjQlBQFlxwj/dOyFvqmAvKjzCiRP0TDCHIbZNZT8uawN y2zPBOlIVPCAMrswZdzQGs2M4NWn8G7EJIsl53uMoaZuiY++6xReECnZ/lk/SX7cQe 4EyV7NtXT4JD9IbSlllB+7l+gLq2nAVpl6/Xj6pI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5C6A0F8052E; Thu, 7 Jul 2022 14:32:59 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1F797F80137; Thu, 7 Jul 2022 14:32:57 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E3A0AF80537 for ; Thu, 7 Jul 2022 14:31:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E3A0AF80537 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="RXWxHLHF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657197120; x=1688733120; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CNXKc1141cIxL1CggFk+aekG0XSLbDs/PG7XDdSjcmQ=; b=RXWxHLHFQLwmg2umSfT02FmYDpjv2RoI355MtPCCl2kNGuGN0LAT/l8T qzCJNbQnUox6/Sv7Gtu22ha/ezahZ4Dq/ktXpCYdqQF3Ho7EKkE8K7t/e oWbNL3r99LSouV+VgNEd4pZ/QAuPE/wg2lo4vkSSAvn26EIRFWgU/2DGU JtQq0EMG3UmYE1tB+rWVDVLOCLwVsRMO70ijIDnKgVMRhHVfFxStld8mS C3SU1wUVdiKqgsn6/4GVTA6o5allRKXzEd0vD3tjErK3ppTf2eYAeGU3e M5P2D3JRv0B8DPAcWuyK1HgM7unVWxI2OstbNrRiV5TbBWPXPNx0oH6tn A==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="272805912" X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="272805912" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2022 05:31:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="593720599" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orsmga002.jf.intel.com with ESMTP; 07 Jul 2022 05:31:56 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 05/12] ASoC: Intel: avs: Shield LARGE_CONFIG_GETs against zero payload_size Date: Thu, 7 Jul 2022 14:41:46 +0200 Message-Id: <20220707124153.1858249-6-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220707124153.1858249-1-cezary.rojewski@intel.com> References: <20220707124153.1858249-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Some LARGE_CONFIG_GETs are never expected to return payload of size 0. Check for such situation and collapse if met. Signed-off-by: Cezary Rojewski --- sound/soc/intel/avs/messages.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sound/soc/intel/avs/messages.c b/sound/soc/intel/avs/messages.c index 3559fb496e0b..9cf621eaec5a 100644 --- a/sound/soc/intel/avs/messages.c +++ b/sound/soc/intel/avs/messages.c @@ -474,6 +474,9 @@ int avs_ipc_get_fw_config(struct avs_dev *adev, struct avs_fw_cfg *cfg) &payload, &payload_size); if (ret) return ret; + /* Non-zero payload expected for FIRMWARE_CONFIG. */ + if (!payload_size) + return -EREMOTEIO; while (offset < payload_size) { tlv = (struct avs_tlv *)(payload + offset); @@ -587,6 +590,9 @@ int avs_ipc_get_hw_config(struct avs_dev *adev, struct avs_hw_cfg *cfg) &payload, &payload_size); if (ret) return ret; + /* Non-zero payload expected for HARDWARE_CONFIG. */ + if (!payload_size) + return -EREMOTEIO; while (offset < payload_size) { tlv = (struct avs_tlv *)(payload + offset); @@ -670,6 +676,9 @@ int avs_ipc_get_modules_info(struct avs_dev *adev, struct avs_mods_info **info) &payload, &payload_size); if (ret) return ret; + /* Non-zero payload expected for MODULES_INFO. */ + if (!payload_size) + return -EREMOTEIO; *info = (struct avs_mods_info *)payload; return 0; From patchwork Thu Jul 7 12:41:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12909451 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9000AC43334 for ; Thu, 7 Jul 2022 12:35:50 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BC6E515CA; Thu, 7 Jul 2022 14:34:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BC6E515CA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657197348; bh=FcS/5pO861udjUryGuB3jacwCNWcBYXzpZo9rEa6svc=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=OFukVafDiMFiv8a7Lyes+nFAMgPN+e2rB6r759E6OqIN3JKREQJDs3wTuTcMlqJKS rWTCPsetfq7+ZmzGRpcFQMqsbfk/nmeu4RsK88y5d3fgUXvlIVt0oAnnwGC/qggU3j WxHUnaEbX1nIZ0fJq/Uj/Re1SVp/GiR2nzn9Bhdk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 453F3F8028D; Thu, 7 Jul 2022 14:32:58 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 16A06F80589; Thu, 7 Jul 2022 14:32:57 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 105DDF8052E for ; Thu, 7 Jul 2022 14:32:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 105DDF8052E Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Ath5xWYM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657197122; x=1688733122; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FcS/5pO861udjUryGuB3jacwCNWcBYXzpZo9rEa6svc=; b=Ath5xWYMkx8hxUdbHizHG65q535gRn5mLv5iVdE5jxH3HG/wXD4cBZlR mBKB7BFiRN7Pwd9ojxVla3rkNV5q/QiCXafC8pkkxAUeKlZywzl3auvdY MnU++nUnTbw91Y2oymCIkcU2nvAPUV97cIreD83b0SyvdZsIcR1m9Pjja M/B3fGlrgbLoWZCDs4McgYhjN3qTkm+nxL3jIspthpc+6hg0f5rk40eCF Pz2o+yy0lucqSQmZPKeBHwWJS8rV3EN4wrm/+mnJmuEYauntB8LmTeQRa qCNHZU/Lz+TyBjP9fmzlFjOlfv8VdowdCi7Wzby/bXB0YguzdXkgwy9AZ Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="272805920" X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="272805920" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2022 05:32:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="593720618" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orsmga002.jf.intel.com with ESMTP; 07 Jul 2022 05:31:58 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 06/12] ASoC: Intel: avs: Block IPC channel on suspend Date: Thu, 7 Jul 2022 14:41:47 +0200 Message-Id: <20220707124153.1858249-7-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220707124153.1858249-1-cezary.rojewski@intel.com> References: <20220707124153.1858249-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" To allow for driver's filesystem interfaces e.g.: debugfs, to be touched even when the device is asleep, mark IPC-channel as blocked when the device is suspended. This causes any invocation of said interfaces that do not toggle PM themselves to gracefully fail with "Operation not permitted" message. Signed-off-by: Cezary Rojewski --- sound/soc/intel/avs/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/intel/avs/core.c b/sound/soc/intel/avs/core.c index 664f87c33e9d..4234adeb3d1c 100644 --- a/sound/soc/intel/avs/core.c +++ b/sound/soc/intel/avs/core.c @@ -556,6 +556,7 @@ static int __maybe_unused avs_suspend_common(struct avs_dev *adev) return AVS_IPC_RET(ret); } + avs_ipc_block(adev->ipc); avs_dsp_op(adev, int_control, false); snd_hdac_ext_bus_ppcap_int_enable(bus, false); From patchwork Thu Jul 7 12:41:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12909445 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 09112C433EF for ; Thu, 7 Jul 2022 12:34:08 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3AFA9167B; Thu, 7 Jul 2022 14:33:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3AFA9167B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657197246; bh=uS+0VWHXUQV5mh/tay14hAtlkp9rOL81zNIc7hjh5Uw=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=F99Gf8GEzUXpLYaYbMYD1eBPerI1qiArP38yRIkhjlaQPefGe3WhX/BXcEhqSrz5H VRuAWF9QuyNIEj1ToCidYCcNXF2P9G0OKWrcbD6aQTrChz1s2MHMH2/eVf7jXn7VaN CRbSZQz31B5aqEk/xm2mX61mAtG2lqzXVpbrZEAk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 29D9DF80549; Thu, 7 Jul 2022 14:32:10 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0E693F80551; Thu, 7 Jul 2022 14:32:09 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 83827F8053A for ; Thu, 7 Jul 2022 14:32:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 83827F8053A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="c5ZZPcaU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657197123; x=1688733123; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uS+0VWHXUQV5mh/tay14hAtlkp9rOL81zNIc7hjh5Uw=; b=c5ZZPcaUo82dmWF/Gy+VXXgOxruFKd0geZG/Z4aBzi0wjfFdZR7dPJNV 2XMVgvffvyIeiim9TnCUkV96oDRq7drLflKmyHBQfqRtMWKQ320zINoPd 9YTBsf8famV3cyLg4DRBEUVVXGTBqvg0hZxen026QQgOxfuV0A/7yz91b 17zvo2VPwLD+ZsahiyxDBmoGly0aepYAi2BiwatrClOhNanqD96Cr1a79 Swp7gJD2uJ+ViJVccWemZifg0VDJNkpVrqtwSbhVsU4XmvV+6V79Dv+Z8 GBWw72I+IERFEkD+lWEEpr0OjblfkiITLvn5qTHOfzXFUSW98NQ2MoDMA w==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="272805929" X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="272805929" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2022 05:32:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="593720640" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orsmga002.jf.intel.com with ESMTP; 07 Jul 2022 05:32:00 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 07/12] ASoC: Intel: avs: Set max DMA segment size Date: Thu, 7 Jul 2022 14:41:48 +0200 Message-Id: <20220707124153.1858249-8-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220707124153.1858249-1-cezary.rojewski@intel.com> References: <20220707124153.1858249-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Amadeusz Sławiński Apparently it is possible for code to allocate large buffers which may cause warnings as reported in [1]. This was fixed for HDA, SOF and skylake in patchset [2], fix it also for avs driver. [1] https://github.com/thesofproject/linux/issues/3430 [2] https://lore.kernel.org/all/20220215132756.31236-1-tiwai@suse.de/ Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski --- sound/soc/intel/avs/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/intel/avs/core.c b/sound/soc/intel/avs/core.c index 4234adeb3d1c..6a35bf45efcb 100644 --- a/sound/soc/intel/avs/core.c +++ b/sound/soc/intel/avs/core.c @@ -446,6 +446,7 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id) dma_set_mask(dev, DMA_BIT_MASK(32)); dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); } + dma_set_max_seg_size(dev, UINT_MAX); ret = avs_hdac_bus_init_streams(bus); if (ret < 0) { From patchwork Thu Jul 7 12:41:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12909447 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD424C43334 for ; Thu, 7 Jul 2022 12:34:39 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DC144168D; Thu, 7 Jul 2022 14:33:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DC144168D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657197277; bh=BxsTst12WEXwPnl/7T3q6lcrSl+SvAf+7/74K9UwBk4=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=AoaiFJMdg46xyhFW+g3Y5jxZJyOO5mXQCMZosyf/FxJ3YCY/Zonc9rNCCFWoc1EL2 Vr/wO5EQk+YaXoFYFi2eMD4c9kQgbi1ztziLLBuL0bDTDZ2M+vWbfN9gbzcvc36DQZ i+Cj3qieXPWRfoNBmQxGIp3OPmmaV6BDR0wfWnlM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 53FADF8053E; Thu, 7 Jul 2022 14:32:15 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1A1F5F80557; Thu, 7 Jul 2022 14:32:13 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 32DA3F8053E for ; Thu, 7 Jul 2022 14:32:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 32DA3F8053E Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="OMsQk2nJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657197127; x=1688733127; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BxsTst12WEXwPnl/7T3q6lcrSl+SvAf+7/74K9UwBk4=; b=OMsQk2nJidAFI/oDwVmxviv5JRBqFeB4OmVexbW6+Mqo/njNhCjLxVfi q2gldYqAlDT4EIf1phU4VV17nkI6iFEmhOP2M5+d0oLS+PY7U0JmM1emJ i3TALxpXqmMmPbfygMoJDlwAlcZoeIi1cCV8ihpZDNEYSqVmffS2qk3Ph Kme9yKUF0NyMHi8+TZq2c0clcAmtfxiEfBapIJMX7D+kLodmjISahBKSU DdeujDnr2UHc2uJv2Dnpkxr8/cJwLOg67aWZkUIvq0Zun3BgCcfnKuRIU EGAZCe5n7hpmV4K13snWbPXQ2mS4aYvZA/YBOLEjXljYdOFf6PlvSmPwk Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="272805933" X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="272805933" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2022 05:32:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="593720657" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orsmga002.jf.intel.com with ESMTP; 07 Jul 2022 05:32:02 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 08/12] ASoC: Intel: avs: Use helper function to set up DMA Date: Thu, 7 Jul 2022 14:41:49 +0200 Message-Id: <20220707124153.1858249-9-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220707124153.1858249-1-cezary.rojewski@intel.com> References: <20220707124153.1858249-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Amadeusz Sławiński dma_set_mask() and dma_set_coherent_mask() can be performed with one call to dma_set_mask_and_coherent(), which slightly reduces amount of code on our side. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski --- sound/soc/intel/avs/core.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sound/soc/intel/avs/core.c b/sound/soc/intel/avs/core.c index 6a35bf45efcb..c50c20fd681a 100644 --- a/sound/soc/intel/avs/core.c +++ b/sound/soc/intel/avs/core.c @@ -440,12 +440,8 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id) if (bus->mlcap) snd_hdac_ext_bus_get_ml_capabilities(bus); - if (!dma_set_mask(dev, DMA_BIT_MASK(64))) { - dma_set_coherent_mask(dev, DMA_BIT_MASK(64)); - } else { - dma_set_mask(dev, DMA_BIT_MASK(32)); - dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); - } + if (!dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64))) + dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32)); dma_set_max_seg_size(dev, UINT_MAX); ret = avs_hdac_bus_init_streams(bus); From patchwork Thu Jul 7 12:41:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12909446 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 67104C43334 for ; Thu, 7 Jul 2022 12:34:25 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AE6761687; Thu, 7 Jul 2022 14:33:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AE6761687 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657197263; bh=cEr1qSq7uKowCwXgd1HR85ENYkIp1VPbiFZkUH73JkU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=VGSAJsgIhWxZHRm3hmeJcY0r0YgtGENsg10MJ7YCRvtOizoX1OVWa70kze8o/bzc6 8Puceegv+zzVB3kyge5eM6AuuYm+Qd5Ij0v5qCj4JUl8B1Q06UA+unI0T1vpN+J2z2 YkZZvPElNFiCOlhK7FbaynR0YmwNGF2ssuED8l08= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B6EE3F80542; Thu, 7 Jul 2022 14:32:12 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 630D0F80557; Thu, 7 Jul 2022 14:32:10 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A1874F80542 for ; Thu, 7 Jul 2022 14:32:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A1874F80542 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Uy1z60XU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657197127; x=1688733127; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cEr1qSq7uKowCwXgd1HR85ENYkIp1VPbiFZkUH73JkU=; b=Uy1z60XUCqaqO02DH/RJv6a+wJOk8LlQqvkffzI2xetBcxJpAeaoCxFe feUFGq0gtLck9ma93XT/EM0cWwxeyEU9FB9dS9GHNQijjrGq6SWP/8RXd mbnupT97B3qfDJWZrJAxkLO2HYUmg57nEeBz/8/Cb4lAhNMnv9rYSPrua cYlmIVgenpuVzyIHSSGWAqrMp60HenrDKF4/uWpaqXIsum9BJjV9lT89S +qlc+PRiuITQZRf79tZsnUy/aaJYC9onSGpvwanEC+MR3tKnO1WKIrEqz bpCfHAR80IWMWEmoujKDfJ3Nl0TtlxPDyawX4VhZa5M4gj+VobxVV1tl1 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="272805940" X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="272805940" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2022 05:32:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="593720668" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orsmga002.jf.intel.com with ESMTP; 07 Jul 2022 05:32:04 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 09/12] ASoC: Intel: avs: Recognize FW_CFG_RESERVED Date: Thu, 7 Jul 2022 14:41:50 +0200 Message-Id: <20220707124153.1858249-10-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220707124153.1858249-1-cezary.rojewski@intel.com> References: <20220707124153.1858249-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" If exposed by firmware, count RESERVED parameter as known one to avoid dumping noise in kernel logs. Signed-off-by: Cezary Rojewski --- sound/soc/intel/avs/messages.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/intel/avs/messages.c b/sound/soc/intel/avs/messages.c index 9cf621eaec5a..28a948cf790f 100644 --- a/sound/soc/intel/avs/messages.c +++ b/sound/soc/intel/avs/messages.c @@ -562,6 +562,7 @@ int avs_ipc_get_fw_config(struct avs_dev *adev, struct avs_fw_cfg *cfg) case AVS_FW_CFG_DMA_BUFFER_CONFIG: case AVS_FW_CFG_SCHEDULER_CONFIG: case AVS_FW_CFG_CLOCKS_CONFIG: + case AVS_FW_CFG_RESERVED: break; default: From patchwork Thu Jul 7 12:41:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12909448 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AC91EC433EF for ; Thu, 7 Jul 2022 12:35:02 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DB81D1695; Thu, 7 Jul 2022 14:34:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DB81D1695 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657197300; bh=eYWgRGi6e/Ub6oh43K9nix22n8tIvk0eb5TlZU/18qA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=RwV3V97ahl3dm6KvQUNVV4jyycznaBnOVXGhojDQxwIx5c8wTb+VUJAQdHXkHirTJ AtM/Sllu2ne0qKmooCrVvOR1M+BT4vmfPdo3lJYAgQVCvrCfyWhpC83tF6jlMJZnop zI98zhTu9HtHGmh0hlJajM8h/9IsvhEAfIdt4Rg4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8DE61F80570; Thu, 7 Jul 2022 14:32:17 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9D9C5F80566; Thu, 7 Jul 2022 14:32:15 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 821D5F8053A for ; Thu, 7 Jul 2022 14:32:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 821D5F8053A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="n4lbGY1L" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657197129; x=1688733129; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eYWgRGi6e/Ub6oh43K9nix22n8tIvk0eb5TlZU/18qA=; b=n4lbGY1LrLn47Hx9o6MX7dJo3a54I8UK38nuwk7S1MAB3+5zIneuKAWW XSGBNU4wSs2jBs7TWBI34jGcUfYe2RaykTrGT4g8jh9tFNCIlErCfg1Dc 6dRB3hKUtQofvSnry7NlA8ydch5c+903qZIcfzeof3mjXLbeYhu0AHI0t hy6htaw65Puxyvmuaob57PNu9LvzCTTrkZrrUYTkcQaIWO0syzSih9Eii rOlDgmhFY7sP8XomRViPFjk/yQ2Cs28M0BijkXM79+UrL57nM+SIm+vRo iwVU4HQlxKijM8CMwa+WGd3jWEX31n4iXgRwpuMjTyXuR2ns2GIoK+nIi Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="272805949" X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="272805949" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2022 05:32:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="593720678" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orsmga002.jf.intel.com with ESMTP; 07 Jul 2022 05:32:06 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 10/12] ASoC: Intel: avs: Replace hardcodes with SD_CTL_STREAM_RESET Date: Thu, 7 Jul 2022 14:41:51 +0200 Message-Id: <20220707124153.1858249-11-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220707124153.1858249-1-cezary.rojewski@intel.com> References: <20220707124153.1858249-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Improve readability of CLDMA reset operation by making use of already defined SD_CTL_STREAM_RESET. Signed-off-by: Cezary Rojewski --- sound/soc/intel/avs/cldma.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/intel/avs/cldma.c b/sound/soc/intel/avs/cldma.c index d100c6ba4d8a..d7a9390b5e48 100644 --- a/sound/soc/intel/avs/cldma.c +++ b/sound/soc/intel/avs/cldma.c @@ -176,17 +176,17 @@ int hda_cldma_reset(struct hda_cldma *cl) return ret; } - snd_hdac_stream_updateb(cl, SD_CTL, 1, 1); - ret = snd_hdac_stream_readb_poll(cl, SD_CTL, reg, (reg & 1), AVS_CL_OP_INTERVAL_US, - AVS_CL_OP_TIMEOUT_US); + snd_hdac_stream_updateb(cl, SD_CTL, SD_CTL_STREAM_RESET, SD_CTL_STREAM_RESET); + ret = snd_hdac_stream_readb_poll(cl, SD_CTL, reg, (reg & SD_CTL_STREAM_RESET), + AVS_CL_OP_INTERVAL_US, AVS_CL_OP_TIMEOUT_US); if (ret < 0) { dev_err(cl->dev, "cldma set SRST failed: %d\n", ret); return ret; } - snd_hdac_stream_updateb(cl, SD_CTL, 1, 0); - ret = snd_hdac_stream_readb_poll(cl, SD_CTL, reg, !(reg & 1), AVS_CL_OP_INTERVAL_US, - AVS_CL_OP_TIMEOUT_US); + snd_hdac_stream_updateb(cl, SD_CTL, SD_CTL_STREAM_RESET, 0); + ret = snd_hdac_stream_readb_poll(cl, SD_CTL, reg, !(reg & SD_CTL_STREAM_RESET), + AVS_CL_OP_INTERVAL_US, AVS_CL_OP_TIMEOUT_US); if (ret < 0) { dev_err(cl->dev, "cldma unset SRST failed: %d\n", ret); return ret; From patchwork Thu Jul 7 12:41:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12909450 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7D36C433EF for ; Thu, 7 Jul 2022 12:35:31 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D5C47166F; Thu, 7 Jul 2022 14:34:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D5C47166F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657197329; bh=2fxn4vRcQMRgs0A91iQvkTNuZig6q13IIN+ZPUz7Q0Q=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=cLWdfrd+VG8tJum9hgsrjiVguOKAE775o/xqwVmIDueyX0VQCmGVDUOpR/tDG4doL +xoqrZ7bx8GAHMNnecRo8dHH2w1LhbDcPcg1fls87PWsqGxYvOjYFz8cyggK2oBxFr 65DicZ/xUbYGZLEshDm5CyL+4JAAhwvOJhl0hn4Y= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 875CBF8057D; Thu, 7 Jul 2022 14:32:22 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B6958F80587; Thu, 7 Jul 2022 14:32:20 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A277EF80557 for ; Thu, 7 Jul 2022 14:32:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A277EF80557 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="G6A4tJDZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657197133; x=1688733133; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2fxn4vRcQMRgs0A91iQvkTNuZig6q13IIN+ZPUz7Q0Q=; b=G6A4tJDZXnGoE+pSQrEBSbBAZD5MdG4A4c3V6g2zEQ3+JOUktePD4Xp+ 94ROQy2z17BkYWWG14RcTv/vhP2HZft85nQqbEKvdEqXp63eBOCfRBl7I rh8vLg3dXfBAcnRNK/5SxS9lRnJ1TVXOZh+hd21MZnDkSKdc3ToxEVJCE 1i6c0/YnmjTn3Mp3Kh+QNVePNNv3YWPekwQ/IG8hBLkT9AZTOdpl5XSqY Y/n8hsvms/3IgCqufQSODQVAUGkPOmGFfAfYk61RaPN22/aAhTxtKHfhY IBuUm9SEzFYIX84cKnlp6cVuQGQ2ZvhnWJKyFd7PEdvde/n84JESWYQCn w==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="272805957" X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="272805957" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2022 05:32:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="593720695" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orsmga002.jf.intel.com with ESMTP; 07 Jul 2022 05:32:08 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 11/12] ASoC: Intel: avs: Lower UNLOAD_MULTIPLE_MODULES IPC timeout Date: Thu, 7 Jul 2022 14:41:52 +0200 Message-Id: <20220707124153.1858249-12-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220707124153.1858249-1-cezary.rojewski@intel.com> References: <20220707124153.1858249-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Module unloading operation performs memory unmapping and the weight of the opration does not different from any other standard IPC. There is no dependency on secondary task like in module loading scenario where larger message timeout is recommended. Signed-off-by: Cezary Rojewski --- sound/soc/intel/avs/messages.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/avs/messages.c b/sound/soc/intel/avs/messages.c index 28a948cf790f..d4bcee1aabcf 100644 --- a/sound/soc/intel/avs/messages.c +++ b/sound/soc/intel/avs/messages.c @@ -59,7 +59,7 @@ int avs_ipc_unload_modules(struct avs_dev *adev, u16 *mod_ids, u32 num_mod_ids) request.data = mod_ids; request.size = sizeof(*mod_ids) * num_mod_ids; - ret = avs_dsp_send_msg_timeout(adev, &request, NULL, AVS_CL_TIMEOUT_MS); + ret = avs_dsp_send_msg(adev, &request, NULL); if (ret) avs_ipc_err(adev, &request, "unload multiple modules", ret); From patchwork Thu Jul 7 12:41:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 12909449 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C83C2C433EF for ; Thu, 7 Jul 2022 12:35:15 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1430B1697; Thu, 7 Jul 2022 14:34:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1430B1697 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657197314; bh=oPLP+ZZtjRuK42T15AQw9BYYGFEFD/IZVA8eaOBiwKM=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FPVLVYP8rWimX+ZuGJRVawV19In4u7q0/KX/bVrAi5LMy8p/afF6D0u7xAHDdVsAS d7sWyC99VtUIKkBpLArRGEaC0CZ3LECfrw9ZcAvAcFEm0mEYlCDUKQVn1FIuqjK7sF yGtI6sGp8BuB2ky/qRlM7P7vEy5ZVSSGGzIr6ui8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0E165F8057A; Thu, 7 Jul 2022 14:32:18 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CE450F80567; Thu, 7 Jul 2022 14:32:15 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A27A5F8055A for ; Thu, 7 Jul 2022 14:32:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A27A5F8055A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ha8fQrHv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657197133; x=1688733133; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oPLP+ZZtjRuK42T15AQw9BYYGFEFD/IZVA8eaOBiwKM=; b=ha8fQrHv1B43xyBk7eFERuPWAdjt/IcJBNTAqy2wlT1hHkrfYUHpazJg euG1TppMTooEOXoU8IuZHjqJjUiJQVElOGFJF1Jvbcqc2AyygqpARACEM p3X/vciKZA3FgUA8qQE4mFrF5P/u0dT4K1lZHjI/Yj8qrVnEX6ixB80Sg KGcRXDADx7J8p0LynaqbnSp94Hca2zZ5/iSJHOy6PO9pYqc6YOcinTGVk IXNhN45ewKqhRO1a1y/JsoBJti+4R39My2dPonyLx8FKdLNkks3Yui/f8 bQL8zjD80nUnGCogaQde8sxZqmZk386A+SDRMc5EpcUmMPA7/R5U6egBd w==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="272805962" X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="272805962" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2022 05:32:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,252,1650956400"; d="scan'208";a="593720708" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orsmga002.jf.intel.com with ESMTP; 07 Jul 2022 05:32:10 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH 12/12] ASoC: Intel: avs: Update AVS_FW_INIT_TIMEOUT_US declaration Date: Thu, 7 Jul 2022 14:41:53 +0200 Message-Id: <20220707124153.1858249-13-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220707124153.1858249-1-cezary.rojewski@intel.com> References: <20220707124153.1858249-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" To reduce the number of places to update if timeouts would have to change, modify the constant declaration. Signed-off-by: Cezary Rojewski --- sound/soc/intel/avs/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/avs/loader.c b/sound/soc/intel/avs/loader.c index 542fd44aa501..9e3f8ff33a87 100644 --- a/sound/soc/intel/avs/loader.c +++ b/sound/soc/intel/avs/loader.c @@ -27,8 +27,8 @@ #define APL_ROM_INIT_RETRIES 3 #define AVS_FW_INIT_POLLING_US 500 -#define AVS_FW_INIT_TIMEOUT_US 3000000 #define AVS_FW_INIT_TIMEOUT_MS 3000 +#define AVS_FW_INIT_TIMEOUT_US (AVS_FW_INIT_TIMEOUT_MS * 1000) #define AVS_CLDMA_START_DELAY_MS 100