Received: by 10.223.164.202 with SMTP id h10csp571030wrb; Thu, 23 Nov 2017 02:55:53 -0800 (PST) X-Google-Smtp-Source: AGs4zMYKQ/GSPDMNW/uI11ZzOQLP5323v72Fjp1tYoaErO6h5YIJzNYNKcvjUVP5b+z2SHbmxWj8 X-Received: by 10.84.130.66 with SMTP id 60mr25376904plc.376.1511434553821; Thu, 23 Nov 2017 02:55:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511434553; cv=none; d=google.com; s=arc-20160816; b=R6gR6Q/dMDCvrZr/wX9v2C5nwh39z35AtGTa1KtHDvDnA5aYXaeq1d4MJXUQYCZY61 cG70DdxltVsb9iLgF7pG/2pPzwnvFNplckZaS9LPABPrGHCgkjqyzVmvb4F5TIgYPTGG UGRiQDia+h8Sqh2WAfh4PtDqazkra1yd983AUWfIk3oRJfnFjFTwwfwITQOhj8guITN5 0x90D7pJ+BqSP4QwPoF6Jq+5kUVqrbKvYrZ42luGEdDcjyQ+xhB1Q6RpX6mEcEepcLcW 1tWCUrdFiYclb1xVFeQGIz6lOl2LQQdfbmN1O1zseRyAl3GpacxyadOTAwMAytuy/lke cP/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=PM8/sMwPbkGqMxlRoo/1wF0NzZmE9YYX3vRX72DHYS0=; b=qn1esbBqFwqIPnvTjwMWLqV+aSOqBCnRGefsFYsfcXMdUHr0tx6fhDUkmkXTsp3NtV Hm8oGTb/FLMd/tLb6eyQXqveBaEQnyv+hv/I8VQH8J4zWtJmWVl8fynytEBMag7lTtuy WAE34vMpBBPtIlHSzEAhQDjnxyiaecx2tS+M6z/aTrUEeWnuDtgtTUQEoQggpu91EXVM irqUAFY7YDeXNJ3yT20+2xG8lW1wpJed8HHZVuesgNfuWOX5O5bVBkM5S+8w6iCUVfvm m26PNBj1JFg1StfYPExGSG2+Qw8Kxf/wGUSO6qv8bEVpkJLr1t77OtY8m8iudJfUNEXQ 0dMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=Ns7qmvgh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9si15818023ple.631.2017.11.23.02.55.40; Thu, 23 Nov 2017 02:55:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=Ns7qmvgh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752680AbdKWKzF (ORCPT + 77 others); Thu, 23 Nov 2017 05:55:05 -0500 Received: from mail-by2nam01on0053.outbound.protection.outlook.com ([104.47.34.53]:4439 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752383AbdKWKzC (ORCPT ); Thu, 23 Nov 2017 05:55:02 -0500 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: , CC: , , , , , , , , , Vijendar Mukunda , Guenter Roeck Subject: [PATCH] ASoC: amd: added error checks in dma driver 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 Content-Type: text/plain 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:msfwf/0OljFh8gDoRt5L92nd878zDRN1wuY/1lQAdA0gaFCpMnd5yVaTWWj1FQGm6htM2w/xaC1PKGbExSajifpChd5woBj9T0b2wBXv0MMfBsIS3JVkrLWf5olq2v2rEY1NLyFHaz0ME9w/b2tscjcppX1ekb+gyMeFuH4PuKsLazrqsr8FBLYqjo1rXWmv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gAEcn5ZnE5BIraTMPZqPqI5g4GPprK3mmjRvhO7gRO+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+bj7vLnBEOU9JKKsH1NSN3lXbGpsYA9b/T0ywTjZGWrjcDy8V2LEm1+klPUSCYVCZFA/jxcKQVao8Pmp+vTu/SlTKT980CQ4TUw1CX01jge/ZKW+lH/qZZ0PrxCP0lcB8s/sIVDJBKKAuERAzF45bpF90udLLg9S29Qs4r8LXfEnM1IV76hkkka8h4ZeWF4LPgTImuE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oqp1/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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.7.4 From 1584969187610494999@xxx Fri Nov 24 17:26:46 +0000 2017 X-GM-THRID: 1584938617001584693 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread