Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp312683pxv; Thu, 15 Jul 2021 05:02:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzX3o4L8QcMM7zd7Oe9tNz9U6/2fiFtAtDJSGpdzeNNl0/4PlAMcJzzVc5Jp+gc7Oo82une X-Received: by 2002:a05:6638:3452:: with SMTP id q18mr1495978jav.111.1626350536746; Thu, 15 Jul 2021 05:02:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626350536; cv=none; d=google.com; s=arc-20160816; b=qv4vUNCirD2NPxUz+uskLND6iCl3Hvt/tvjlBPxtUzcNyr4MkNFmBbwdahzsP+piqa K1XvryG+XExEpQlWqHBNBG0uqKieUbti0zCxIerpkeVtYvJ3oo35evZT1xIJ5Q4Y3hYx cALpBkpaD7SsRRcmCAHvdgiJwT/8CUYWWoiYm1hEZg15m/KgQEIT/kwew84n2Obm61N9 xLscbaa2hlWob3tZD1nHS3oR1s7ru6Q+LhyLciAPlcLxktd4XObOrsp6Xeb9TPMEZJia t1zxkUv8Chf5vVzzoGhkM54yPg8bLGW4BmRZ3WI+y1usdlPjHg4Esxz+lQpPvhqn4R7W Ufcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=uI5sHLv1X45o41P1ZNlIPZTo6K3CNNbzt4/8j7wHrLk=; b=A74i/q5tomXrT67+tGDrcL7ToZkZrYY33BLJULDdxjLW2vkeDL6xb/DCh1S3YmsTvG c8uOJCc0vDKn0t/J6Nr541Os+pkcoGsSeig5eZWBZwUrS1f7j2+1eyHVLyrSKLund2np l/6DXUPVjzpgjL0mdo5iEdFZbkofXTMbCT2Hz7UPKi0xE8nYyGZLiNBMFBWjR1qNozyV r5WqWXTj1NwY7JdawdPbVdDmmKovie3BwYAXrf9loNeTP8rSWFuyVRbR2Y9YWJXVvBam IaZ7N0QaslxzmICW6G2slDDjox+R9vw+EhAR7TkxmAR5pczybvhJYs14WYwMK+cC86I/ 5cKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lmeWxw8A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si6703913jao.15.2021.07.15.05.02.04; Thu, 15 Jul 2021 05:02:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lmeWxw8A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241330AbhGOKeq (ORCPT + 99 others); Thu, 15 Jul 2021 06:34:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241327AbhGOKep (ORCPT ); Thu, 15 Jul 2021 06:34:45 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC3D3C06175F for ; Thu, 15 Jul 2021 03:31:52 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id j34so3383395wms.5 for ; Thu, 15 Jul 2021 03:31:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=uI5sHLv1X45o41P1ZNlIPZTo6K3CNNbzt4/8j7wHrLk=; b=lmeWxw8AKP2iBysQEh7Z2PubnYaxE2lkhrpjNnUE2kdpRe7+LnM8Fmql7GNKcRgT6D L4+Icg8PsIGa4cjqvjH03raTn8s2B7dYUPYq4l9pJVf1KPV96EegokF3mTAonWDMxeGL VkFkVhDaqbBGhU0ZWY+z/Ynpkqe/su5BTT/kvLF+/zHFipRiGsGCpI72O/pgb6S+B84/ R5hWAaJj2+N5knNlfVuJm1foqFZp53MzatBLotjhUh4jpJeMJ5SO5RNifwq5qMrTdIc4 WkdMaxTsS71oJsc4dNKM6sh25DmqrlS1u0gNQZuK1SbhJOk5Zq3u2LXL/k36OHbZFgag BO2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=uI5sHLv1X45o41P1ZNlIPZTo6K3CNNbzt4/8j7wHrLk=; b=n0dUgNX9nKnR/mDnDi4ZPH8hs+eGFRHUUhYdt9hi+5h3ZDt19u0DlCOj8j4XdnjFWm fQANYyj3wZ+niQr4lrgtkpf+qsCKzoCsQsRTe7BFZND7RFidCnK1dGVReDMg8ZM5I2gM elOnWbzC5fO3c5QJJ8ctF7AWdgkjrnjRzSeQFpqsOI5r/CuCrby0uVbLga9kStAAyhJ+ /BB8280yL0iBQxmfkXXVRNaKIi8QFMlHfh68BP+D5YgpYFG91jF4AyXoMi6iLhBXGlHz Y/nGoFWeVP+znOX6XAJ5UrqDPeFqhWaAaO/4ORVCe7q2DcrZEVo7SlfFPni50iEoxmCp 4iWg== X-Gm-Message-State: AOAM533wQI7dOqLnCASd4/70uI/RGqmbXcC8OfQlVH4Cuo9rw4/PC1m1 KNcmGmRXvoT3hQ+LYFhGk5nbNyqeeo+SDw== X-Received: by 2002:a05:600c:22d2:: with SMTP id 18mr3779099wmg.63.1626345111181; Thu, 15 Jul 2021 03:31:51 -0700 (PDT) Received: from [192.168.86.34] (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.googlemail.com with ESMTPSA id p2sm4505436wmg.6.2021.07.15.03.31.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Jul 2021 03:31:50 -0700 (PDT) Subject: Re: [PATCH v2 05/16] ASoC: qcom: audioreach: add basic pkt alloc support To: Pierre-Louis Bossart , bjorn.andersson@linaro.org, broonie@kernel.org, robh@kernel.org Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, bgoswami@codeaurora.org, lgirdwood@gmail.com, tiwai@suse.de, plai@codeaurora.org, linux-kernel@vger.kernel.org References: <20210714153039.28373-1-srinivas.kandagatla@linaro.org> <20210714153039.28373-6-srinivas.kandagatla@linaro.org> <58d6df8d-83ed-c716-81b2-e0927f58da6f@linux.intel.com> From: Srinivas Kandagatla Message-ID: Date: Thu, 15 Jul 2021 11:31:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <58d6df8d-83ed-c716-81b2-e0927f58da6f@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for review Pierre, On 14/07/2021 17:30, Pierre-Louis Bossart wrote: > > > >> diff --git a/sound/soc/qcom/Kconfig b/sound/soc/qcom/Kconfig >> index cc7c1de2f1d9..721ea56b2cb5 100644 >> --- a/sound/soc/qcom/Kconfig >> +++ b/sound/soc/qcom/Kconfig >> @@ -103,6 +103,12 @@ config SND_SOC_QDSP6 >> audio drivers. This includes q6asm, q6adm, >> q6afe interfaces to DSP using apr. >> >> +config SND_SOC_QCOM_AUDIOREACH >> + tristate "SoC ALSA audio drives for Qualcomm AUDIOREACH" > > typo: drivers? > Will fix all the typos in next spin. >> +static void *__audioreach_alloc_pkt(int payload_size, uint32_t opcode, >> + uint32_t token, uint32_t src_port, >> + uint32_t dest_port, bool has_cmd_hdr) >> +{ >> + struct apm_cmd_header *cmd_header; >> + struct gpr_pkt *pkt; >> + void *p; >> + int pkt_size = GPR_HDR_SIZE + payload_size; >> + >> + if (has_cmd_hdr) >> + pkt_size += APM_CMD_HDR_SIZE; >> + >> + p = kzalloc(pkt_size, GFP_ATOMIC); > > is GFP_ATOMIC required? it's the same question really than my earlier one on spinlock_irqsave, it's rather hard to figure out in what context this code will run. I had some spinlocks in this patch for compress offload cases, so had to make it ATOMIC. having said that we could avoid ATOMIC here. > >> + if (!p) >> + return ERR_PTR(-ENOMEM); >> + >> + pkt = p; >> + pkt->hdr.version = GPR_PKT_VER; >> + pkt->hdr.hdr_size = 6; > > magic number. looks like a missing macro... There is already a macro for this, GPR_PKT_HEADER_WORD_SIZE I should have used it. > >> + pkt->hdr.pkt_size = pkt_size; >> + pkt->hdr.dest_port = dest_port; >> + pkt->hdr.src_port = src_port; >> + >> + pkt->hdr.dest_domain = GPR_DOMAIN_ID_ADSP; >> + pkt->hdr.src_domain = GPR_DOMAIN_ID_APPS; >> + pkt->hdr.token = token; >> + pkt->hdr.opcode = opcode; >> + >> + if (has_cmd_hdr) { >> + p = p + GPR_HDR_SIZE; >> + cmd_header = p; >> + cmd_header->payload_size = payload_size; >> + } >> + >> + return pkt; >> +} >