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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12291C4332D for ; Tue, 22 Dec 2020 14:16:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C584C2313F for ; Tue, 22 Dec 2020 14:16:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727483AbgLVOP7 (ORCPT ); Tue, 22 Dec 2020 09:15:59 -0500 Received: from mx2.suse.de ([195.135.220.15]:52494 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727310AbgLVOP7 (ORCPT ); Tue, 22 Dec 2020 09:15:59 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C36D4B74C; Tue, 22 Dec 2020 14:15:17 +0000 (UTC) Date: Tue, 22 Dec 2020 15:15:17 +0100 Message-ID: From: Takashi Iwai To: Ravulapati Vishnu vardhan rao Cc: , Liam Girdwood , Mark Brown , Jaroslav Kysela , "Takashi Iwai" , Akshu Agrawal , Dan Carpenter , Vijendar Mukunda , "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: Re: [PATCH] ASoC: amd:Replacing MSI with Legacy IRQ model In-Reply-To: <20201222115929.11222-1-Vishnuvardhanrao.Ravulapati@amd.com> References: <20201222115929.11222-1-Vishnuvardhanrao.Ravulapati@amd.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 22 Dec 2020 12:59:18 +0100, Ravulapati Vishnu vardhan rao wrote: > > When we try to play and capture simultaneously we see that > interrupts are genrated but our handler is not being acknowledged, > After investigating further more in detail on this issue we found > that IRQ delivery via MSI from the ACP IP is unreliable and so sometimes > interrupt generated will not be acknowledged so MSI model shouldn't be used > and using legacy IRQs will resolve interrupt handling issue. > > This patch replaces MSI interrupt handling with legacy IRQ model. > > Issue can be reproduced easily by running below python script: > > import subprocess > import time > import threading > > def do2(): > cmd = 'aplay -f dat -D hw:2,1 /dev/zero -d 1' > subprocess.call(cmd, stdin=subprocess.PIPE, > stderr=subprocess.PIPE, shell=True) > print('Play Done') > > def run(): > for i in range(1000): > do2() > > def do(i): > cmd = 'arecord -f dat -D hw:2,2 /dev/null -d 1' > subprocess.call(cmd, stdout=subprocess.PIPE, > stderr=subprocess.PIPE, shell=True) > print(datetime.datetime.now(), i) > > t = threading.Thread(target=run) > t.start() > for i in range(1000): > do(i) > > t.join() > > After applying this patch issue is resolved. > > Signed-off-by: Ravulapati Vishnu vardhan rao Is this specific to Raven, i.e. Renoir doesn't need the same fix? If so, it should be mentioned in the patch description. thanks, Takashi 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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D10BCC433DB for ; Tue, 22 Dec 2020 14:16:24 +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 CF77923124 for ; Tue, 22 Dec 2020 14:16:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF77923124 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de 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 BA70E16E6; Tue, 22 Dec 2020 15:15:29 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BA70E16E6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1608646579; bh=eeX8k/kgR4rhZLTmw/oHJAHAEZ1JJCnqIEYmoF8y6MI=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=I/x9hibmezBwryQkwn+0ut9AgN2mwkmANI/RDTLdAqJmQcJkrUibIlfsBh82vBu6x IisAoLhQb8AiAzjLB3Hm5M9I6Fq2oYrYDqTXtDZpT4PY1B6XZbrykMJixwpe8ktBAt 4Sok9XhbG4ccHe0SzWa14R+bmO/TYsf+PfyDLaI8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 100BAF800BC; Tue, 22 Dec 2020 15:15:29 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B2576F80224; Tue, 22 Dec 2020 15:15:26 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5D4ABF8021D for ; Tue, 22 Dec 2020 15:15:18 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5D4ABF8021D X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C36D4B74C; Tue, 22 Dec 2020 14:15:17 +0000 (UTC) Date: Tue, 22 Dec 2020 15:15:17 +0100 Message-ID: From: Takashi Iwai To: Ravulapati Vishnu vardhan rao Subject: Re: [PATCH] ASoC: amd:Replacing MSI with Legacy IRQ model In-Reply-To: <20201222115929.11222-1-Vishnuvardhanrao.Ravulapati@amd.com> References: <20201222115929.11222-1-Vishnuvardhanrao.Ravulapati@amd.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Liam Girdwood , open list , Takashi Iwai , Akshu Agrawal , Mark Brown , Vijendar Mukunda , Alexander.Deucher@amd.com, Dan Carpenter 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" On Tue, 22 Dec 2020 12:59:18 +0100, Ravulapati Vishnu vardhan rao wrote: > > When we try to play and capture simultaneously we see that > interrupts are genrated but our handler is not being acknowledged, > After investigating further more in detail on this issue we found > that IRQ delivery via MSI from the ACP IP is unreliable and so sometimes > interrupt generated will not be acknowledged so MSI model shouldn't be used > and using legacy IRQs will resolve interrupt handling issue. > > This patch replaces MSI interrupt handling with legacy IRQ model. > > Issue can be reproduced easily by running below python script: > > import subprocess > import time > import threading > > def do2(): > cmd = 'aplay -f dat -D hw:2,1 /dev/zero -d 1' > subprocess.call(cmd, stdin=subprocess.PIPE, > stderr=subprocess.PIPE, shell=True) > print('Play Done') > > def run(): > for i in range(1000): > do2() > > def do(i): > cmd = 'arecord -f dat -D hw:2,2 /dev/null -d 1' > subprocess.call(cmd, stdout=subprocess.PIPE, > stderr=subprocess.PIPE, shell=True) > print(datetime.datetime.now(), i) > > t = threading.Thread(target=run) > t.start() > for i in range(1000): > do(i) > > t.join() > > After applying this patch issue is resolved. > > Signed-off-by: Ravulapati Vishnu vardhan rao Is this specific to Raven, i.e. Renoir doesn't need the same fix? If so, it should be mentioned in the patch description. thanks, Takashi