From patchwork Thu Nov 23 16:30:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 10072633 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 E8B6A602DC for ; Thu, 23 Nov 2017 10:55:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9C8A29EF0 for ; Thu, 23 Nov 2017 10:55:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE3FA29F7A; Thu, 23 Nov 2017 10:55:12 +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=1.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DATE_IN_FUTURE_03_06,DKIM_SIGNED,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no 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 7E7E229EFA for ; Thu, 23 Nov 2017 10:55:09 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0E7BD266E90; Thu, 23 Nov 2017 11:55:08 +0100 (CET) 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 640492672AF; Thu, 23 Nov 2017 11:55:06 +0100 (CET) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0048.outbound.protection.outlook.com [104.47.38.48]) by alsa0.perex.cz (Postfix) with ESMTP id 626A0266DF5 for ; Thu, 23 Nov 2017 11:55:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=PM8/sMwPbkGqMxlRoo/1wF0NzZmE9YYX3vRX72DHYS0=; b=Ns7qmvgh+3VOs5yfEHNM4IK6vOcGQOKiFxYu4Cxa/1enn9H0Av3fuba8HB+PLeCn8z/p/TlTSB76gB1iLD0Fsh3TbiYNTmO31mKOHQiHbBOhcnXrXdqMQoZWvG9G6eNB5RHn4oGZpRGm8h6QTHD//tVZmkJmOgh6M48oBD/ymc0= Received: from DM5PR12CA0023.namprd12.prod.outlook.com (10.172.32.161) by BN6PR1201MB0049.namprd12.prod.outlook.com (10.174.114.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Thu, 23 Nov 2017 10:55:00 +0000 Received: from DM3NAM03FT060.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::204) by DM5PR12CA0023.outlook.office365.com (2603:10b6:4:1::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.260.4 via Frontend Transport; Thu, 23 Nov 2017 10:55:00 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by DM3NAM03FT060.mail.protection.outlook.com (10.152.83.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.239.4 via Frontend Transport; Thu, 23 Nov 2017 10:54:59 +0000 Received: from SCYBEXDAG03.amd.com (10.34.11.13) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 23 Nov 2017 04:54:59 -0600 Received: from LinuxHost.amd.com (10.129.12.246) by SCYBEXDAG03.amd.com (10.34.11.13) with Microsoft SMTP Server id 14.3.361.1; Thu, 23 Nov 2017 18:54:54 +0800 From: Vijendar Mukunda To: , Date: Thu, 23 Nov 2017 22:00:02 +0530 Message-ID: <1511454602-7259-1-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(376002)(346002)(2980300002)(428002)(199003)(189002)(97736004)(478600001)(356003)(72206003)(36756003)(305945005)(6666003)(105586002)(48376002)(50466002)(7416002)(81166006)(189998001)(4326008)(8676002)(5003940100001)(81156014)(86362001)(39060400002)(316002)(53936002)(2906002)(50226002)(16586007)(50986999)(101416001)(5660300001)(77096006)(106466001)(8936002)(110136005)(68736007)(53416004)(47776003)(54906003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR1201MB0049; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT060; 1:jyqYgmx5Kr9Fy8oiP5BIWd54NPOe8gGGWKYvZ/K5NMToBHlBA242POAj96nY0eLzDMu0kBA6To6jUnrW7I3uODy66Ze4a6+9q2SeXzFuZcikxxaljrW/1/iZMAHJzdBk X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5c421155-0c59-4a5f-f07a-08d53260a450 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600025)(4604075)(2017052603258); SRVR:BN6PR1201MB0049; X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0049; 3:msf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hTkZd0TNWK54lD9Xm0lMlpubHjN8TRcEp0/Jjaro/whQ9d8Uy2HnL0BWCZvdFwjMc3Uz/ZRPG4eB0Uh+iF2G7Q1h2LJQ3Xces6kavRrO4u152v4yQoonRWWU9X6GRyHg0KjcoT1qwoyGfQT+iIIVUtdyrj6zWIQmc9GrX8pvBv9aMZfJvxgAEcn5ZnE5BIraTMPZqPqI5g4GPprK3mmjRvhO7gRO+YOt7d6/QmwhvjTkWYOD4GwlENsYshZQQa10g5LpYbwJteeIWmXDpnO8XiTIAWXP+GRYFmXkBcaAU9vfWn2aN/+K5xvJJ+/xrPbg9xoejTvnHOvbSNNF1pHfz1fEBTGx/VPSbkELYJQXiHVdowcjknkDC/H1+kVWWtIXOEr+e/SHcW2xt4mPRcZI4YZ6aebaIGIavB7wImYuOVPyPxnLN5IuwZDXEgyyPSzcEPzEMaK6+ZWapPM9g+5Ai1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93003095)(10201501046)(3002001)(3231022)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123562025)(20161123564025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR1201MB0049; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR1201MB0049; X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0049; 4:QDt4wcwQX3+UHErIVWdmcdZZkRlw/U4pAo7/P/Z5WnHde5+3Qx5sS/2aBkTgAu+LoHxrZOcwk40k7Ycrx5I36t/wQSDJ/r6lJiC+bj7vLnBEOU9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WDT2xA6222CAxGrY=; 24:iF3qGFBVBd1MLNyyZp8uv+SNJvxSawbi/y9W1K7jeTdXFq50Zi+mlOskX+WkzV8WqNNg1UegcfC2Jt62cW/iViExCeJb19tiZ9ShRDvxoA0=; 7:DI8PEo23MNTOoABi2onk07HpJywc1Jb7JNJlt7f+wcZBYA92Jx+QUMdzFpy/qKoqp1/LTw4v3SgU/c4/k/Qev2bU9XvxryJWC7BwEK+LbqeO6ZSHNvyjvb9mZqhu17B0VnHg/oBZZhKbruMROArg4lLIa+JhTwWxsuthANdnLeZFyVmN893M86d1L5Yfm/LSk83zuok1e7Mmof9k0MAgcHEJ0EGK7TN0koOdusj1e67YwbeSUemckKSxiHF2sgmL SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0049; 20:MPcRJHW05uKhtC+yxT2Q0oLc+lcojrfxYuPZLsHCc0G/83zCUmMRbaTQZxEedgyJ/zOwhCA6yd1Ioq2K0jJ+Ts4DmJYWB2TxYMPj2eArmp3YghZXmke01zyIIMvUjXio4zagregQpqHMUBIY0T1EOzFKP3nBmSRSDlkkv9NQF0m+ElWVTkB8E3ZcigIZ/MgCjXIhDlXXgPVQKiel0sR8GXOoya8J36C4HGjYdC5RaAe7cUzKvKelfpH6oR8ju3sl X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2017 10:54:59.3591 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5c421155-0c59-4a5f-f07a-08d53260a450 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB0049 Cc: tiwai@suse.de, linux-kernel@vger.kernel.org, Vijendar Mukunda , lgirdwood@gmail.com, djkurtz@chromium.org, Akshu.Agrawal@amd.com, Guenter Roeck , dbehr@chromium.org, Alexander.Deucher@amd.com, linux@roeck-us.net Subject: [alsa-devel] [PATCH] ASoC: amd: added error checks in dma driver 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP added error checks in acp dma driver Signed-off-by: Vijendar Mukunda Signed-off-by: Akshu Agrawal Signed-off-by: Guenter Roeck --- sound/soc/amd/acp-pcm-dma.c | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 17d76fa..804e659 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -848,6 +848,9 @@ static snd_pcm_uframes_t acp_dma_pointer(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct audio_substream_data *rtd = runtime->private_data; + if (!rtd) + return -EINVAL; + buffersize = frames_to_bytes(runtime, runtime->buffer_size); bytescount = acp_get_byte_count(rtd->acp_mmio, substream->stream); @@ -873,6 +876,8 @@ static int acp_dma_prepare(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct audio_substream_data *rtd = runtime->private_data; + if (!rtd) + return -EINVAL; if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { config_acp_dma_channel(rtd->acp_mmio, SYSRAM_TO_ACP_CH_NUM, PLAYBACK_START_DMA_DESCR_CH12, @@ -1066,6 +1071,10 @@ static int acp_audio_probe(struct platform_device *pdev) struct resource *res; const u32 *pdata = pdev->dev.platform_data; + if (!pdata) { + dev_err(&pdev->dev, "Missing platform data\n"); + return -ENODEV; + } audio_drv_data = devm_kzalloc(&pdev->dev, sizeof(struct audio_drv_data), GFP_KERNEL); if (audio_drv_data == NULL) @@ -1074,6 +1083,8 @@ static int acp_audio_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); audio_drv_data->acp_mmio = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(audio_drv_data->acp_mmio)) + return PTR_ERR(audio_drv_data->acp_mmio); /* The following members gets populated in device 'open' * function. Till then interrupts are disabled in 'acp_init' * and device doesn't generate any interrupts. @@ -1099,7 +1110,11 @@ static int acp_audio_probe(struct platform_device *pdev) dev_set_drvdata(&pdev->dev, audio_drv_data); /* Initialize the ACP */ - acp_init(audio_drv_data->acp_mmio, audio_drv_data->asic_type); + status = acp_init(audio_drv_data->acp_mmio, audio_drv_data->asic_type); + if (status) { + dev_err(&pdev->dev, "ACP Init failed\n"); + return status; + } status = snd_soc_register_platform(&pdev->dev, &acp_asoc_platform); if (status != 0) { @@ -1116,9 +1131,14 @@ static int acp_audio_probe(struct platform_device *pdev) static int acp_audio_remove(struct platform_device *pdev) { + int status; struct audio_drv_data *adata = dev_get_drvdata(&pdev->dev); - acp_deinit(adata->acp_mmio); + status = acp_deinit(adata->acp_mmio); + if (status) { + dev_err(&pdev->dev, "ACP Deinit failed\n"); + return status; + } snd_soc_unregister_platform(&pdev->dev); pm_runtime_disable(&pdev->dev); @@ -1128,9 +1148,14 @@ static int acp_audio_remove(struct platform_device *pdev) static int acp_pcm_resume(struct device *dev) { u16 bank; + int status; struct audio_drv_data *adata = dev_get_drvdata(dev); - acp_init(adata->acp_mmio, adata->asic_type); + status = acp_init(adata->acp_mmio, adata->asic_type); + if (status) { + dev_err(dev, "ACP Init failed\n"); + return status; + } if (adata->play_stream && adata->play_stream->runtime) { /* For Stoney, Memory gating is disabled,i.e SRAM Banks @@ -1162,18 +1187,28 @@ static int acp_pcm_resume(struct device *dev) static int acp_pcm_runtime_suspend(struct device *dev) { + int status; struct audio_drv_data *adata = dev_get_drvdata(dev); - acp_deinit(adata->acp_mmio); + status = acp_deinit(adata->acp_mmio); + if (status) { + dev_err(dev, "ACP Deinit failed\n"); + return status; + } acp_reg_write(0, adata->acp_mmio, mmACP_EXTERNAL_INTR_ENB); return 0; } static int acp_pcm_runtime_resume(struct device *dev) { + int status; struct audio_drv_data *adata = dev_get_drvdata(dev); - acp_init(adata->acp_mmio, adata->asic_type); + status = acp_init(adata->acp_mmio, adata->asic_type); + if (status) { + dev_err(dev, "ACP Init failed\n"); + return status; + } acp_reg_write(1, adata->acp_mmio, mmACP_EXTERNAL_INTR_ENB); return 0; }