From patchwork Thu Oct 27 19:35:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 619236 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 188C6ECAAA1 for ; Thu, 27 Oct 2022 19:40:34 +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 3FF542DBD; Thu, 27 Oct 2022 21:39:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3FF542DBD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1666899632; bh=RDOSYGtxP4ldqOOaUKxB6GXEBoUjy++oyOKHOCBcjrQ=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=s+tYgbbKfYe3DMvvKurJMLiISB7xk8PPfMeXFHBoYk2kvyPOAEFNYW/ujakN9gU+P tdKXh9aJY2iLJPuUaezHDiHb0p7TkSVRLJbmrDukPilscqvCfqtxEwR33YTfvYt0rA OIZ0dHLfjzUP4GSUHwfo6CNaWpmiWyBexyP6PYcA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5E24DF805C1; Thu, 27 Oct 2022 21:36:36 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9E4E4F80558; Thu, 27 Oct 2022 21:36:29 +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 0502FF8055C for ; Thu, 27 Oct 2022 21:36:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0502FF8055C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="g11WEdMU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666899378; x=1698435378; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RDOSYGtxP4ldqOOaUKxB6GXEBoUjy++oyOKHOCBcjrQ=; b=g11WEdMU7u/KxlF7I5P6/efqA2N65238nmhXdSDM6I0txGaKYv5ELukK Lj56qUcMi/9jq8lDvKcnH3bdHGeskqsZ+AyYAJNXXdZGtkEbhVl5enO7y rAmVfM5DMDFn/vY77cM2RtGNqN5eAbVvHxdajH7UQrD9EQGiCC/XJf6L7 5RbY5yEuIMu56p/EDOwHsIiW7I117gR9u863PWXCjk9hFS9QHaLVZ3AFI WsZeUghr6daE81H3LXZx7yDGTF2MYRcGKwrbtQiRSKKXiicm2IJO/E6qN 34lnHQ3d9NTsjapJCyWFgCDaJNDUhjfl9+4BHYkAbBxFxzyv/Y4C9I8nm g==; X-IronPort-AV: E=McAfee;i="6500,9779,10513"; a="334957836" X-IronPort-AV: E=Sophos;i="5.95,218,1661842800"; d="scan'208";a="334957836" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2022 12:36:16 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10513"; a="632527027" X-IronPort-AV: E=Sophos;i="5.95,218,1661842800"; d="scan'208";a="632527027" Received: from vmehta-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.6.254]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2022 12:36:15 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 11/21] ASoC: SOF: Intel: hda-stream: always allocate CORB/RIRB buffer Date: Thu, 27 Oct 2022 15:35:30 -0400 Message-Id: <20221027193540.259520-12-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027193540.259520-1-pierre-louis.bossart@linux.intel.com> References: <20221027193540.259520-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , tiwai@suse.de, =?utf-8?q?P?= =?utf-8?q?=C3=A9ter_Ujfalusi?= , Pierre-Louis Bossart , Rander Wang , broonie@kernel.org, Ranjani Sridharan , Bard Liao 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 real reason to filter out this allocation at build time. Let's allocate it always, so that we can have a more dynamic way of disabling HDaudio codec support without having to recompile. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan --- sound/soc/sof/intel/hda-stream.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sound/soc/sof/intel/hda-stream.c b/sound/soc/sof/intel/hda-stream.c index c858f30c08f9..59a3c0c9c21f 100644 --- a/sound/soc/sof/intel/hda-stream.c +++ b/sound/soc/sof/intel/hda-stream.c @@ -854,15 +854,16 @@ int hda_dsp_stream_init(struct snd_sof_dev *sdev) return -ENOMEM; } -#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) - /* mem alloc for the CORB/RIRB ringbuffers */ + /* + * mem alloc for the CORB/RIRB ringbuffers - this will be used only for + * HDAudio codecs + */ ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, &pci->dev, PAGE_SIZE, &bus->rb); if (ret < 0) { dev_err(sdev->dev, "error: RB alloc failed\n"); return -ENOMEM; } -#endif /* create capture streams */ for (i = 0; i < num_capture; i++) { @@ -995,11 +996,9 @@ void hda_dsp_stream_free(struct snd_sof_dev *sdev) if (bus->posbuf.area) snd_dma_free_pages(&bus->posbuf); -#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) - /* free position buffer */ + /* free CORB/RIRB buffer - only used for HDaudio codecs */ if (bus->rb.area) snd_dma_free_pages(&bus->rb); -#endif list_for_each_entry_safe(s, _s, &bus->stream_list, list) { /* TODO: decouple */