From patchwork Thu Feb 27 09:35:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 11408165 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 31FBC13A4 for ; Thu, 27 Feb 2020 09:36:44 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4EF6924672 for ; Thu, 27 Feb 2020 09:36:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Y6blIXiW"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ti.com header.i=@ti.com header.b="kZ56IXAM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4EF6924672 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org 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 302FD1671; Thu, 27 Feb 2020 10:35:57 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 302FD1671 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1582796201; bh=J0mAW0J1orqyeIdA/JtNkHhlpJ3lbRw6ZeppkMwPFxk=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=Y6blIXiW6JnpeNET33nWkU9JEAPWEb9cZ1uKp7sf6ZqgfbGTDFWaJRtIcklQomwGf odTbLk2/9iYw0gV7iQDYZtuSBtlEX5XOoxQr5yw4HdmchWXT4pqfHkydCeeTYripVS KwTu6de4r0lIYCpOq/sN7kQfSmJJkWRadvc5fDBc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 87256F80089; Thu, 27 Feb 2020 10:35:56 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id AE7C6F80142; Thu, 27 Feb 2020 10:35:53 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,PRX_BODY_78,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (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 BFF63F80089 for ; Thu, 27 Feb 2020 10:35:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BFF63F80089 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="kZ56IXAM" Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 01R9Zk3J119771; Thu, 27 Feb 2020 03:35:46 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1582796146; bh=hSEXvacXGKbZqbC+Ov200OzO4WZvHMrzVZaNB5eXYjw=; h=From:To:CC:Subject:Date; b=kZ56IXAMuAySs7KkxGIRikKbCJGVucUVrK/5t+gpmCj7KEhzYGqKSXnjNG9xyxffY 5wOZerIk1L9U+IWqp2+kyyZY2TEAS/SVXC0AuJQYQbv+mxPTD81THdjawXpx+xpNGO 2i91jX/r10CrSMgOq6yCNepaSUvxFnwFq0NXy14w= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id 01R9Zk0I012955; Thu, 27 Feb 2020 03:35:46 -0600 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Thu, 27 Feb 2020 03:35:46 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Thu, 27 Feb 2020 03:35:46 -0600 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 01R9ZiE2047179; Thu, 27 Feb 2020 03:35:44 -0600 From: Peter Ujfalusi To: , , , Subject: [PATCH] ALSA: dmaengine_pcm: No need to take runtime reference twice in pcm_pointer Date: Thu, 27 Feb 2020 11:35:44 +0200 Message-ID: <20200227093544.27723-1-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: alsa-devel@alsa-project.org 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" The runtime pointer has been taken in functional level so there is no need to take it again under the if () case. Fixes: 9d789dc047e3 ("ALSA: dmaengine_pcm: Consider DMA cache caused delay in pointer callback") Signed-off-by: Peter Ujfalusi --- Hi Mark, it looks like that the DMA caused delay reporting patch went in in two pieces: fa1f875c120f ALSA: dmaengine_pcm: Consider DMA cache caused delay in pointer callback 9d789dc047e3 ALSA: dmaengine_pcm: Consider DMA cache caused delay in pointer callback and the second one missed removing the runtime pointer initialization from the if () case. Regards, Peter sound/core/pcm_dmaengine.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sound/core/pcm_dmaengine.c b/sound/core/pcm_dmaengine.c index 6f1507f992d1..4d059ff2b2e4 100644 --- a/sound/core/pcm_dmaengine.c +++ b/sound/core/pcm_dmaengine.c @@ -248,8 +248,6 @@ snd_pcm_uframes_t snd_dmaengine_pcm_pointer(struct snd_pcm_substream *substream) status = dmaengine_tx_status(prtd->dma_chan, prtd->cookie, &state); if (status == DMA_IN_PROGRESS || status == DMA_PAUSED) { - struct snd_pcm_runtime *runtime = substream->runtime; - buf_size = snd_pcm_lib_buffer_bytes(substream); if (state.residue > 0 && state.residue <= buf_size) pos = buf_size - state.residue;