Received: by 10.192.165.148 with SMTP id m20csp5232630imm; Wed, 9 May 2018 01:27:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqjpMInePDvrWPSp6zBSkP0TfY0A0rCCHXZMKVgBK8CLcT+/tEqZHWmTSxxXWjdaesb9qKC X-Received: by 2002:a17:902:ab93:: with SMTP id f19-v6mr44466851plr.392.1525854433090; Wed, 09 May 2018 01:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525854433; cv=none; d=google.com; s=arc-20160816; b=0jKGlLcv3ILI7gttUDHCu+vbJNT/CkRSNtkpBxBksYMErdIwqTbn6CnqP6+WI4yII3 SWkBdpNicb1pWxOhs8Z3uX5f+XeY1WfDBxoIq9IERFds61sOd/hes8LLSzHnh6OAVQnk attLvjsqBoiHvZil9a8Ylv04UuHMBsHJgCnoXc5MNF2N/DdCR87PlxUkzgoaU0JD7XiG p+4v9VED+bAjyI9VwKun9wekJzwsnwzeIzy2Hj3kXThiunjlY+/BdwNnlQRSDh5LaSz+ MSpFOa073N0BHvAAQBOXr41c8/1/7z5Jtwu1+HYCSvA370DFLJhlh1X2OJ5nuCzQtc46 78gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=d7pOADsEBU2oEv873pEckCGyZI5BPjrCpKrA59XwAl4=; b=uh5UQItoSJcoW5644awuXJqCY3T1DQZE9+aBHLTD/SR9iTmjpYMzWYh9ATEzF8weis 6waEpfzY9IhWHU+5OCvdgVtdU6QEUY2nxbnJC1pJ45e5B+GgOdpa7Kr3HyDqOFomb2kU ci1UmE5gGOTFx4pdlXwLEzG66dGvs9DKK2SgFbPvtdX/vLZ+5G/Y8SHTQZWfGpNXxo2p WhYOYLCDRya+xmpRhI6XsXg1zIJxxpPBLDqss0D+p4Vl8rADhy8/IQnSS6gRx6u3S38Y 4aWJw6hRhL6msX2DAxvyolY0Qyy4B8ap92l06fm5eOuYJmkqdc9y5acW4V2XLKBUtwPw JTtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=KpGahyH4; dkim=pass header.i=@codeaurora.org header.s=default header.b=NgBZRuvm; 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 w9-v6si25269752plk.28.2018.05.09.01.26.58; Wed, 09 May 2018 01:27:13 -0700 (PDT) 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=@codeaurora.org header.s=default header.b=KpGahyH4; dkim=pass header.i=@codeaurora.org header.s=default header.b=NgBZRuvm; 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 S934035AbeEIIYu (ORCPT + 99 others); Wed, 9 May 2018 04:24:50 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:47032 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933907AbeEIIXz (ORCPT ); Wed, 9 May 2018 04:23:55 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id EA57A60F5F; Wed, 9 May 2018 08:23:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1525854234; bh=VSNAsW1g1CCFAvLaT8rrcc0VN5oNvo42I1xUaNOCQbk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=KpGahyH4dRD9FdPSBpte1Oo2SImXkzMiwAS2KdExkZXKBsZtXwI8pv/g1JCJ4fXi3 kNI/iPPaoS8XMepuj9t4ZMLkschHIclEQeWc9uOIBikIn7Ojx3lm+UFC2g9Nb7Lz00 el1U+mA/MIgI63Hk8X3eDQpDSGlAsyfoSNuhQYJo= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.110.9.49] (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: bgoswami@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 90C3260881; Wed, 9 May 2018 08:23:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1525854233; bh=VSNAsW1g1CCFAvLaT8rrcc0VN5oNvo42I1xUaNOCQbk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=NgBZRuvmQqc/EX77NE1YlsmtR3KSL8rs7WiCyV45/+UDZhEaBjGiHzH0C7GqyORap B8KtodQHXryvQ5QdZy2Lnbh4iihj2g/9AIxm/wpxfkYi6YfR4dQWLN8dD1ixAPF5rK ty5ieFT2COYI2ok50ZWazHni6x29PSRb8kvmyAGI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 90C3260881 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=bgoswami@codeaurora.org Subject: Re: [PATCH v7 15/24] ASoC: qdsp6: q6asm: Add support to memory map and unmap To: Srinivas Kandagatla , andy.gross@linaro.org, broonie@kernel.org, linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, robh+dt@kernel.org Cc: gregkh@linuxfoundation.org, david.brown@linaro.org, mark.rutland@arm.com, lgirdwood@gmail.com, plai@codeaurora.org, tiwai@suse.com, perex@perex.cz, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, rohkumar@qti.qualcomm.com, spatakok@qti.qualcomm.com References: <20180501120820.11016-1-srinivas.kandagatla@linaro.org> <20180501120820.11016-16-srinivas.kandagatla@linaro.org> From: Banajit Goswami Message-ID: <39933a04-7249-24ec-9ece-c3edd82e7d6c@codeaurora.org> Date: Wed, 9 May 2018 01:23:51 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180501120820.11016-16-srinivas.kandagatla@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/1/2018 5:08 AM, Srinivas Kandagatla wrote: > This patch adds support to memory map and unmap regions commands in > q6asm module. > > Signed-off-by: Srinivas Kandagatla > Reviewed-and-tested-by: Rohit kumar > --- > sound/soc/qcom/qdsp6/q6asm.c | 349 +++++++++++++++++++++++++++++++++++++++++++ > sound/soc/qcom/qdsp6/q6asm.h | 5 + > 2 files changed, 354 insertions(+) > > diff --git a/sound/soc/qcom/qdsp6/q6asm.c b/sound/soc/qcom/qdsp6/q6asm.c > index c9526d2e59d2..5a573e927a5e 100644 > --- a/sound/soc/qcom/qdsp6/q6asm.c > +++ b/sound/soc/qcom/qdsp6/q6asm.c > @@ -18,10 +18,45 @@ > #include "q6dsp-errno.h" > #include "q6dsp-common.h" > + > +/** > + * q6asm_map_memory_regions() - map memory regions in the dsp. > + * > + * @dir: direction of audio stream > + * @ac: audio client instanace > + * @phys: physcial address that needs mapping. > + * @period_sz: audio period size > + * @periods: number of periods > + * > + * Return: Will be an negative value on failure or zero on success > + */ > +int q6asm_map_memory_regions(unsigned int dir, struct audio_client *ac, > + phys_addr_t phys, > + size_t period_sz, unsigned int periods) > +{ > + struct audio_buffer *buf; > + unsigned long flags; > + int cnt; > + int rc; > + > + spin_lock_irqsave(&ac->buf_lock, flags); > + if (ac->port[dir].buf) { > + dev_err(ac->dev, "Buffer already allocated\n"); > + spin_unlock_irqrestore(&ac->buf_lock, flags); > + return 0; > + } > + > + buf = kzalloc(((sizeof(struct audio_buffer)) * periods), GFP_ATOMIC); > + if (!buf) { > + spin_unlock_irqrestore(&ac->buf_lock, flags); > + return -ENOMEM; > + } > + > + Remove extra blank line. Otherwise LGTM. Acked-by: Banajit Goswami -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project