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 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 C7041ECAAA1 for ; Thu, 27 Oct 2022 12:31:43 +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 AB7F13061; Thu, 27 Oct 2022 14:30:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AB7F13061 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1666873901; bh=HlZwH+VTqSabzxMqXe77Yo1nAcjc60LNfCp7xD53Es0=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=fvHZBipb/Zf5YabivmTHs6Mrb0EXDyLJsINr6wrStzFZ3N7l8W1fC99Ux/miPHMxl iIZ1HxNU2cCCdv1qj/ntNQgvg8Wt+Q00Y5vNfbtKOQvS4gO8AQVcIgxMElud31oVGw eFHehL2TQvesUeoPR3iiWY+cP/cYaO9a1H4kcEHE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 64EE8F80552; Thu, 27 Oct 2022 14:30:29 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E7154F804AD; Thu, 27 Oct 2022 14:30:25 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 1884BF80100 for ; Thu, 27 Oct 2022 14:30:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1884BF80100 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="V1Mi43+P" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666873824; x=1698409824; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HlZwH+VTqSabzxMqXe77Yo1nAcjc60LNfCp7xD53Es0=; b=V1Mi43+PQVWa+8sl5tqIMgY3OD4jMvBImyQEV6TSPU26crp7fYhjo05b yE3yWmDoP3HdYncEUAs7RGM82qBcbF0OzhLIttKWCMt4SVMk7s8+Bs4mJ dbgRC+kabo+5z+QzVnLjtxEnASxnn5g+UAQdV7gG2FhvQ4Kp6pbMP2ZRQ QQaM5afFuX8LeLqrVE7le8osou4/2jBTCIebEIA1YFznGkpVOto5tTWgn Tyyy99dbuaX8VXr/pnWeLG66guhajZuYig5c3CqS9SPyUEHxO+I9jf6vC kBR0Kk/x8r+zeRDOyT6Qr1qQt6KnPj+LftChxkXL3YUwEMZ+tzc0jpiW2 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10512"; a="334839881" X-IronPort-AV: E=Sophos;i="5.95,217,1661842800"; d="scan'208";a="334839881" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2022 05:30:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10512"; a="807435634" X-IronPort-AV: E=Sophos;i="5.95,217,1661842800"; d="scan'208";a="807435634" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orsmga005.jf.intel.com with ESMTP; 27 Oct 2022 05:30:07 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org, broonie@kernel.org Subject: [PATCH v4 1/9] ASoC: Intel: avs: Split pcm pages freeing operation from hw_free() Date: Thu, 27 Oct 2022 14:46:54 +0200 Message-Id: <20221027124702.1761002-2-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221027124702.1761002-1-cezary.rojewski@intel.com> References: <20221027124702.1761002-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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" Prepare for introduction of PCM power management support. As freeing pages during the suspend operation is not desired, separate snd_pcm_lib_free_pages() from existing avs_dai_fe_hw_free() so that majority of the code found within it can be reused for standard and PM flows both. Signed-off-by: Cezary Rojewski --- sound/soc/intel/avs/pcm.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c index 293336c2fc63..fea801243d37 100644 --- a/sound/soc/intel/avs/pcm.c +++ b/sound/soc/intel/avs/pcm.c @@ -499,7 +499,7 @@ static int avs_dai_fe_hw_params(struct snd_pcm_substream *substream, return ret; } -static int avs_dai_fe_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) +static int __avs_dai_fe_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct avs_dma_data *data; struct hdac_ext_stream *host_stream; @@ -523,9 +523,15 @@ static int avs_dai_fe_hw_free(struct snd_pcm_substream *substream, struct snd_so snd_hdac_stream_cleanup(hdac_stream(host_stream)); hdac_stream(host_stream)->prepared = false; - ret = snd_pcm_lib_free_pages(substream); - if (ret < 0) - dev_dbg(dai->dev, "Failed to free pages!\n"); + return ret; +} + +static int avs_dai_fe_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) +{ + int ret; + + ret = __avs_dai_fe_hw_free(substream, dai); + snd_pcm_lib_free_pages(substream); return ret; } -- 2.25.1