From patchwork Thu Jun 18 07:26:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "RAVULAPATI, VISHNU VARDHAN RAO" X-Patchwork-Id: 11611569 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 E2696138C for ; Thu, 18 Jun 2020 07:31: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 09F92212CC for ; Thu, 18 Jun 2020 07:31: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="NbZUE7AO"; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="jII+dT2X" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 09F92212CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.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 12E23172C; Thu, 18 Jun 2020 09:30:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 12E23172C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1592465502; bh=9Qc3rITLbqg77thfQjTWM7IBjc6vrFW666xmqH05GsI=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=NbZUE7AOGK6Y53v9AA7ofPIqH8seoBwVcDqzBKP9UKwwbmlD8XImHKArBLc19+TrQ abG1vYUGs38zw4d7ANATQDrLsynfl7S8mttGOERhjGC2Jx3yL14CsLBlkC5BVciHL1 +jTEVVqzyoiOoFnnEv195IHRGZEnfL3LUPK2CJwQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8EE76F8010E; Thu, 18 Jun 2020 09:30:53 +0200 (CEST) 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 1F433F80116; Thu, 18 Jun 2020 09:30:52 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, FORGED_SPF_HELO,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2076.outbound.protection.outlook.com [40.107.92.76]) (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 8B6B9F80101 for ; Thu, 18 Jun 2020 09:30:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8B6B9F80101 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="jII+dT2X" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NoosOumjT6/DdGE9Xc5AEZ9AYwLOgiTo+j7Bk9C99CmIMnO9B4AwVzBcv01L2nEiylVDjNJylkOosMVKVgYS6RyVORRq7/HHBzXC2ASUgIclOybsF6+F3DaiVXxx6r7FoFpzV3hts/11CezOEsvXT3FaKCVK4qUicNCD62n4ugxDmFgxSnlAfZvbc+apZ2rZT8A+s8eUsUG7eeB4faTkoLIkHxnZRG+LzcmAttDhJ03sejqKIGsOJWvKHYx0E9Zp0UyqLSuh1Pjr6WmkckkGTJZUEuJdndk+bvQ+7pKBhj7LwY4owyfCg1yYJcYUd5oK4eXVBPK4GG//KZ9JTw5MlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ALhVsoPAVJX01zfIW6EyznoLOnqnzDPiCsGfkEto1iA=; b=WBIevZzHjNVy/sTFhmVjm1aArmBJBt0XdrkpHXM5x2czXlrqCgmim7Bil26dWCh89TwkS1qg+39ck2spFkB0iv5HLfWU/C/MYvR9vMAs4CrGNLk25BVRbnnTRCp0BN+X6cqjs8YyNvGYLBjG4wwoFgIoxoAHA/qgwxaXm77IJbXT8fJx0/NzIRseP5PjyOSc+UtF97ZMRX2JL6rhQNd91oHMGroPdWhrNqtvO4jNaiLtEu1y53SzMLdOwSxGJNam4ACXq/ckQMuHEfEnrF4RF5uMyOLvBvyVE1HjlXr1piVDuSEzOJRe3rJrpOWH5NATs73aEi6Nv8Y782PjGmGSew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ALhVsoPAVJX01zfIW6EyznoLOnqnzDPiCsGfkEto1iA=; b=jII+dT2XgENy6kkpsiPGPh2bgU5gygzkhaNeQKZi+J4yYv4gFoXOqvo9TUE+hkKMyXUW5Ln2IloSY1VTc+wTcgg1RxORFn6jzOzjT5v9Rkbp7qH7NY0owpRNmk1zPNDqAnrZxw2fYUDR8e4IdELbtHH9z0XvE3xw/HmylDI9WSs= Received: from CO2PR06CA0055.namprd06.prod.outlook.com (2603:10b6:104:3::13) by DM5PR12MB2439.namprd12.prod.outlook.com (2603:10b6:4:b4::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.24; Thu, 18 Jun 2020 07:30:40 +0000 Received: from CO1NAM11FT023.eop-nam11.prod.protection.outlook.com (2603:10b6:104:3:cafe::be) by CO2PR06CA0055.outlook.office365.com (2603:10b6:104:3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.21 via Frontend Transport; Thu, 18 Jun 2020 07:30:40 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB02.amd.com (165.204.84.17) by CO1NAM11FT023.mail.protection.outlook.com (10.13.175.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3109.22 via Frontend Transport; Thu, 18 Jun 2020 07:30:39 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 18 Jun 2020 02:30:39 -0500 Received: from SATLEXMB01.amd.com (10.181.40.142) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 18 Jun 2020 02:30:39 -0500 Received: from vishnu-All-Series.amd.com (10.180.168.240) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Thu, 18 Jun 2020 02:30:35 -0500 From: Ravulapati Vishnu vardhan rao To: Subject: [PATCH 1/2] ASoC: amd: Removing unnecessary instance initialization Date: Thu, 18 Jun 2020 12:56:10 +0530 Message-ID: <20200618072624.27047-1-Vishnuvardhanrao.Ravulapati@amd.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SATLEXMB02.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFTY:; SFS:(4636009)(396003)(39860400002)(136003)(346002)(376002)(46966005)(7696005)(54906003)(6666004)(1076003)(316002)(336012)(426003)(2616005)(36756003)(5660300002)(8676002)(70206006)(86362001)(26005)(186003)(109986005)(356005)(70586007)(8936002)(47076004)(82310400002)(2906002)(478600001)(81166007)(83380400001)(82740400003)(4326008)(266003); DIR:OUT; SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c8ed3416-402c-41bf-0731-08d813598070 X-MS-TrafficTypeDiagnostic: DM5PR12MB2439: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-Forefront-PRVS: 0438F90F17 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 77nzCHOs3pmFrgVfn+pul8qPOi5yHZAlORlBByErSgwgQHPijji/iIn4Nk2eD6cIqcrgvqtje09Tn1qvSvUtHQyEcKQeFxzS0A95oj8gk2fWfpZ5znH3baqNbD3huVv89NK7Slv71fJHag/mEzlTNGPFfm1hZDg+1x+gJYZi2eoqxLk68C2+t/v0ven1XIZI68931b9faz0wCgu8oBORqVXAIfFhTladpnjpusGQsX/kwm3NPnyTHsDuU4Xshvo+KxRT+kiYnjJpYVobWmQwrv/tBDF3D4CF8Jl2d+X5d7eVwAWg0rdsVkZlxPa11tl0wwSo5lfgw5f4CCVhKzQ9WrMrN+jNpjJdG5IPE0/AcbJcYK3ZUYXKNTulseMOvr7A06wUZvrrt8/FhOVUq9abN/9IMBYQ0PfwHySm1WWbLVE= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2020 07:30:39.9048 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c8ed3416-402c-41bf-0731-08d813598070 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2439 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list , Takashi Iwai , Liam Girdwood , Ravulapati Vishnu vardhan rao , Mark Brown , Wei Yongjun , Alexander.Deucher@amd.com, Akshu Agrawal 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" In trigger we already get the selected instance details from runtime->private_data.So, removing the local initialization which may corrupt the instance selected details and this leads to corrupt data. Signed-off-by: Ravulapati Vishnu vardhan rao --- sound/soc/amd/raven/acp3x-i2s.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sound/soc/amd/raven/acp3x-i2s.c b/sound/soc/amd/raven/acp3x-i2s.c index a532e01a2622..14607563abd2 100644 --- a/sound/soc/amd/raven/acp3x-i2s.c +++ b/sound/soc/amd/raven/acp3x-i2s.c @@ -151,20 +151,12 @@ static int acp3x_i2s_trigger(struct snd_pcm_substream *substream, struct i2s_stream_instance *rtd; struct snd_soc_pcm_runtime *prtd; struct snd_soc_card *card; - struct acp3x_platform_info *pinfo; u32 ret, val, period_bytes, reg_val, ier_val, water_val; u32 buf_size, buf_reg; prtd = substream->private_data; rtd = substream->runtime->private_data; card = prtd->card; - pinfo = snd_soc_card_get_drvdata(card); - if (pinfo) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) - rtd->i2s_instance = pinfo->play_i2s_instance; - else - rtd->i2s_instance = pinfo->cap_i2s_instance; - } period_bytes = frames_to_bytes(substream->runtime, substream->runtime->period_size); buf_size = frames_to_bytes(substream->runtime, From patchwork Thu Jun 18 07:26:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "RAVULAPATI, VISHNU VARDHAN RAO" X-Patchwork-Id: 11611571 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 D4F1E138C for ; Thu, 18 Jun 2020 07:32:36 +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 6B88D212CC for ; Thu, 18 Jun 2020 07:32:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="DriC+0Xg"; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="mEYHPESw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B88D212CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.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 F1735173C; Thu, 18 Jun 2020 09:31:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F1735173C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1592465555; bh=pKdWN8arQMZ0CBXt/FTh7q1Lw+YJXPQFtKnGH0AmMRE=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=DriC+0XgTybGv4SnNDYXF7cD0Q46vPfIoFkQi7GzOcSxqDZep3zhf+PyrMRnmYVB9 jst32iX/BPQHJoDpby7YwtBjvWcT4aKa6yQ7ilmsXjfVYVfIicUKl1tpwsX3rhEndD pPw1q+dwgc3TVRVE92lpxSQxn1HH4ab3dLS8rk3w= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C0542F80171; Thu, 18 Jun 2020 09:31:21 +0200 (CEST) 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 AEA98F801D9; Thu, 18 Jun 2020 09:31:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, FORGED_SPF_HELO,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2083.outbound.protection.outlook.com [40.107.220.83]) (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 AE1ACF80162 for ; Thu, 18 Jun 2020 09:31:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AE1ACF80162 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="mEYHPESw" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bbgq8wKz8CQxrR2lhjzA0B/kHmCcD41F2ysvLHmyvThtLUndB6rKqzsdh26gIzQUqI7azrKbeUemCwew3h9+8JXFLNztTtYwNoRj+8GEins1XkKDe+WT7IfR7irXFdCUskDxCT6gVpupHFk0RJVWDROSZhAT7ICIiv0n0kgCBMY8M8yDarPphiLmV6a923h4sOQrcNISEJQcm/WFHNeH4+2RR3MCyeEI15OcxkJ12FpGSnhBRTCYQ543KPcW8P4DpM8VbDhjlbH0NusU++GCmzegwFKFb3Z/jmz0EndUa7MlkAwt8UNx+G/P336PJFoz8mTG2+sp3Wp2EFrd20+qWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m3IzppjHtZhIaL0eju8N+YX5Er/KubiX9LfvLhG2LHY=; b=KihlTY5abE6wE+vfgsgdyH3Rx3l4L1W52tG979hVVIVsYOn4zSl4MdR1tnx1EalyMKSSvCerAFpfbD0vjZ5aYkmqcryw5E8iOaOZdQkLwdfj6ZTzTUyUv2aB41N0YC1aeMKaDFW1DG76JFSXa1jPOk8oapS4BkkPowfTC+QjCwwY6KYivD8pOZkvPUy+ZfSDfWQ+U225xz7gazU510e2qHizHgwB3p8eBOREJoBSXLKk9AaLVUoi3BHd+0seHQd6SfcLJHHRkk387FdJzAesyjijv863s+QEZCHpEUctEtRFusJwiMFoVOG39TH0UYmPBJmAf0XQmnTVCKehv41ooA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m3IzppjHtZhIaL0eju8N+YX5Er/KubiX9LfvLhG2LHY=; b=mEYHPESwJm7FeJZ5fducXKj2eKQ1m5k67dOsn962aURLwGH2hsrgNn9a33Kc/os8aRYXQkJLlgVIVwxRMcVQ4vm1aam8VaEmhBemhNHZXGg0oNv/OuJulrgwCrsERtWJZD3/25L66mDnfhbS2sGfPtM4ce/NrlrpU8xFFzpYT0Y= Received: from MW2PR16CA0030.namprd16.prod.outlook.com (2603:10b6:907::43) by CY4PR1201MB0085.namprd12.prod.outlook.com (2603:10b6:910:1c::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.24; Thu, 18 Jun 2020 07:31:09 +0000 Received: from CO1NAM11FT027.eop-nam11.prod.protection.outlook.com (2603:10b6:907:0:cafe::90) by MW2PR16CA0030.outlook.office365.com (2603:10b6:907::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Thu, 18 Jun 2020 07:31:09 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB02.amd.com (165.204.84.17) by CO1NAM11FT027.mail.protection.outlook.com (10.13.174.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3109.22 via Frontend Transport; Thu, 18 Jun 2020 07:31:08 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 18 Jun 2020 02:31:07 -0500 Received: from SATLEXMB01.amd.com (10.181.40.142) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 18 Jun 2020 02:31:06 -0500 Received: from vishnu-All-Series.amd.com (10.180.168.240) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Thu, 18 Jun 2020 02:31:01 -0500 From: Ravulapati Vishnu vardhan rao To: Subject: [PATCH 2/2] ASoC: amd: closing specific instance. Date: Thu, 18 Jun 2020 12:56:52 +0530 Message-ID: <20200618072653.27103-1-Vishnuvardhanrao.Ravulapati@amd.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SATLEXMB02.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFTY:; SFS:(4636009)(396003)(376002)(346002)(39860400002)(136003)(46966005)(83380400001)(2616005)(336012)(26005)(8676002)(4326008)(356005)(426003)(316002)(2906002)(478600001)(54906003)(7696005)(82310400002)(8936002)(81166007)(82740400003)(47076004)(186003)(109986005)(70586007)(5660300002)(70206006)(6666004)(36756003)(1076003)(86362001)(266003); DIR:OUT; SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 14f9d64e-b0f0-4796-13d0-08d8135991c1 X-MS-TrafficTypeDiagnostic: CY4PR1201MB0085: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-Forefront-PRVS: 0438F90F17 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WhoYJkyf3rRBlSnwkNhXVeS6BJZAzOguAnL7kyy3zyKFdZukkeVpHvYwdgyIlpV5CcSZLZ/mQ0/Ooc5UuQ5MnFBwHndUJ+OZe1iiwq1Y5Yz8Gl5dHBWqpXkTvF/UK7GRIyc7IPa5yJ9A5rcvBECpOcvfPi1AcvjiGnG8//TFxeIHloDsQdYLxd+ppzc0HXT36zxoPrv9ubWI0dZLR4AnVFBwHUXzu/lVzsW9wldJy+qtg0PldiSduPwmwhzm8B9hdDnEJgZuxomdo44iDljs7oHb46KTVEO/CG7zQUbOiaoBD7Eh5ftN5VnxWSZA4sJmirPq2+04mrPa56hzmw3yX4S7jNjPSyAYN89qC9WqaowWPK2DtVBoWMl7hE3Xs5RmmafCJAhAChcIwVbGzoJ3LyfVpdBfe75+VEQhvf+qzy8= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2020 07:31:08.9573 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 14f9d64e-b0f0-4796-13d0-08d8135991c1 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0085 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Kuninori Morimoto , open list , Takashi Iwai , Liam Girdwood , Ravulapati Vishnu vardhan rao , Mark Brown , Vijendar Mukunda , Alexander.Deucher@amd.com, Colin Ian King , Akshu Agrawal 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 steps to reproduce: Record from the internal mic : (arecord -D hw:1,2 -f dat /dev/null -V stereos) Record from the headphone mic: (arecord -D hw:1,0 -f dat /dev/null -V stereos) Kill the recording from internal mic. We can see the recording from the headphone mic is broken. This patch rectifies the issue reported. Signed-off-by: Ravulapati Vishnu vardhan rao --- sound/soc/amd/raven/acp3x-pcm-dma.c | 30 ++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c index d8f554f369a8..e6386de20ac7 100644 --- a/sound/soc/amd/raven/acp3x-pcm-dma.c +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c @@ -342,11 +342,34 @@ static int acp3x_dma_close(struct snd_soc_component *component, { struct snd_soc_pcm_runtime *prtd; struct i2s_dev_data *adata; + struct i2s_stream_instance *ins; prtd = substream->private_data; component = snd_soc_rtdcom_lookup(prtd, DRV_NAME); adata = dev_get_drvdata(component->dev); + ins = substream->runtime->private_data; + if (!ins) + return -EINVAL; + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + switch (ins->i2s_instance) { + case I2S_BT_INSTANCE: + adata->play_stream = NULL; + break; + case I2S_SP_INSTANCE: + default: + adata->i2ssp_play_stream = NULL; + } + } else { + switch (ins->i2s_instance) { + case I2S_BT_INSTANCE: + adata->capture_stream = NULL; + break; + case I2S_SP_INSTANCE: + default: + adata->i2ssp_capture_stream = NULL; + } + } /* Disable ACP irq, when the current stream is being closed and * another stream is also not active. @@ -354,13 +377,6 @@ static int acp3x_dma_close(struct snd_soc_component *component, if (!adata->play_stream && !adata->capture_stream && !adata->i2ssp_play_stream && !adata->i2ssp_capture_stream) rv_writel(0, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { - adata->play_stream = NULL; - adata->i2ssp_play_stream = NULL; - } else { - adata->capture_stream = NULL; - adata->i2ssp_capture_stream = NULL; - } return 0; }