From patchwork Mon Jul 2 21:19:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kurtz X-Patchwork-Id: 10502551 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9BE346028F for ; Mon, 2 Jul 2018 22:26:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8776028688 for ; Mon, 2 Jul 2018 22:26:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 77C6128AEB; Mon, 2 Jul 2018 22:26:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDB9628688 for ; Mon, 2 Jul 2018 22:26:39 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 8B630267731; Tue, 3 Jul 2018 00:26:38 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3DEE4267766; Tue, 3 Jul 2018 00:26:36 +0200 (CEST) Received: from mail-it0-f66.google.com (mail-it0-f66.google.com [209.85.214.66]) by alsa0.perex.cz (Postfix) with ESMTP id 77721267714 for ; Tue, 3 Jul 2018 00:26:34 +0200 (CEST) Received: by mail-it0-f66.google.com with SMTP id p17-v6so473271itc.2 for ; Mon, 02 Jul 2018 15:26:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kPbxhTSWC6O0G+NWKxurVzbQQPIYMg5fubB9OKv6290=; b=fFuqR2/9BeLWrYyal2lCpLKX0IlXcM4wfFuK+OT0cZ0vIggq3Z2EyYwuVQdot1FugP LRzceLNAYBNe+FnZlBg8ITBTNJdaSUiz8H3H/S3PWfgMlUALzXhiILwg+/fhZFwIhvmv fR6Ct05wfk0hf0zy4ZBkMBHqcINFYZyEjzFO0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kPbxhTSWC6O0G+NWKxurVzbQQPIYMg5fubB9OKv6290=; b=sbj1diI2ACfjEAUrdJYlSYMqx26LP3rxG7vmMED/UYxOWgRx3VypUNm3pgd2CVcYlN sQ0xOwPYGj2tFLxSc4rD5ZMyE2DLwnrLrM+jKSIYYZEucsvMUtXHd/3V+s300XYxiNle ye2+vrEQj9DizUTPdPYATUuM1XvnUb70ZoUmukCTyxcMa8+0EhcZS6hnj9SlHZnuaVmn B1xbCF4HFQp23pgF4zoQ66ii5KgM1uHF9QULxvC3aIKKfnFsHjjTrSAsjO178P/0FnRa SrMIqNAnvzrLjAd7MzFEFbL0K/tv3peg2MXP56cUWAgmWQ0Sz2dyYDQwuGI8ZXmp2SKs o+IA== X-Gm-Message-State: APt69E1AelMEx0lgTEpNN5haxFnAO4TK0WrrU9IPBK3vyWTl/TZwNAEG IpJtG0fpORbe9tFapch1jyCVT1skJf8= X-Google-Smtp-Source: AAOMgpeWrZvpkqugR09+1c2G/TxtS12yrdAgbgJ1ISIMUcMDOxO3tImz43tVW880qU/2P32Ubf7/7w== X-Received: by 2002:a24:73c1:: with SMTP id y184-v6mr2977234itb.31.1530566414328; Mon, 02 Jul 2018 14:20:14 -0700 (PDT) Received: from djkurtz2.bld.corp.google.com ([2620:15c:183:0:1cfd:61a5:7215:5f9c]) by smtp.gmail.com with ESMTPSA id h75-v6sm776729ioh.50.2018.07.02.14.20.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 14:20:13 -0700 (PDT) From: Daniel Kurtz To: Date: Mon, 2 Jul 2018 15:19:54 -0600 Message-Id: <20180702211956.149355-5-djkurtz@chromium.org> X-Mailer: git-send-email 2.18.0.399.gad0ab374a1-goog In-Reply-To: <20180702211956.149355-1-djkurtz@chromium.org> References: <20180702211956.149355-1-djkurtz@chromium.org> Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list , Takashi Iwai , Daniel Kurtz , Liam Girdwood , Mark Brown , "Mukunda, Vijendar" , Alex Deucher , Guenter Roeck , Akshu Agrawal Subject: [alsa-devel] [PATCH 5/6] ASoC: AMD: Do not generate interrups for every captured sample X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP On capture, audio data is first copied from I2S to ACP memory, and then from ACP to SYSRAM. The I2S_TO_ACP_DMA interrupt fires on every sample transferred from I2S to ACP memory. That is it fires ~48000 times per second when capturing @ 48 kHz. Since we don't do anything on this interrupt anyway, disable it to save quite a few unnecessary interrupts. The real "work" (calling snd_pcm_period_elapsed()) is done when transfer from ACP to SYSRAM is complete. Signed-off-by: Daniel Kurtz --- sound/soc/amd/acp-pcm-dma.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 2a6a6e65e27c3..ab60129f4f266 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -412,10 +412,8 @@ static void acp_dma_start(void __iomem *acp_mmio, u16 ch_num) switch (ch_num) { case ACP_TO_I2S_DMA_CH_NUM: case ACP_TO_SYSRAM_CH_NUM: - case I2S_TO_ACP_DMA_CH_NUM: case ACP_TO_I2S_DMA_BT_INSTANCE_CH_NUM: case ACP_TO_SYSRAM_BT_INSTANCE_CH_NUM: - case I2S_TO_ACP_DMA_BT_INSTANCE_CH_NUM: dma_ctrl |= ACP_DMA_CNTL_0__DMAChIOCEn_MASK; break; default: @@ -704,12 +702,6 @@ static irqreturn_t dma_irq_handler(int irq, void *arg) acp_mmio, mmACP_EXTERNAL_INTR_STAT); } - if ((intr_flag & BIT(I2S_TO_ACP_DMA_CH_NUM)) != 0) { - valid_irq = true; - acp_reg_write((intr_flag & BIT(I2S_TO_ACP_DMA_CH_NUM)) << 16, - acp_mmio, mmACP_EXTERNAL_INTR_STAT); - } - if ((intr_flag & BIT(ACP_TO_SYSRAM_BT_INSTANCE_CH_NUM)) != 0) { valid_irq = true; snd_pcm_period_elapsed(irq_data->capture_i2sbt_stream); @@ -718,13 +710,6 @@ static irqreturn_t dma_irq_handler(int irq, void *arg) acp_mmio, mmACP_EXTERNAL_INTR_STAT); } - if ((intr_flag & BIT(I2S_TO_ACP_DMA_BT_INSTANCE_CH_NUM)) != 0) { - valid_irq = true; - acp_reg_write((intr_flag & - BIT(I2S_TO_ACP_DMA_BT_INSTANCE_CH_NUM)) << 16, - acp_mmio, mmACP_EXTERNAL_INTR_STAT); - } - if (valid_irq) return IRQ_HANDLED; else