Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp571847pxv; Wed, 14 Jul 2021 10:15:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3jDNV/z5CSN1GGRFB4xxzNQeFlB3z6O4UhDhh6BRjGlFyxspE3bT7saHdnj4vXZCCDPmX X-Received: by 2002:a92:7c10:: with SMTP id x16mr7365431ilc.192.1626282921971; Wed, 14 Jul 2021 10:15:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626282921; cv=none; d=google.com; s=arc-20160816; b=jCQQz4h9lOiHIXVFhfbAXVoUPFrlsz+dGSY85dUQYTXM/cRnlQlFiIul49Q2crBpRu +O0tDClw7EFqRg+H9DH8Q7lBZkaiSTrxyTlpbMDI4LYY4VG4jmrw3RfBFLC2EgDJv7eC bX0sTXNEQwPjvTZRz0vKB9kzlCd4BRj3H4LggaIFt3VAZ0+ZlqPHaapMlQtdlg2XhhEP fCaxdt2aBdBDn6DqzpeMMnHBnc1CFoH+hEmMDOYL1y6+qmZN9QE4LK172E44WKBwu39n Tkls9Fagh9rNma5yuM8p7oM6LX+Aj0lV3prAsT87U9bk9dr9ae1vcnPQwCQSWVb89AbG flSw== 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; bh=V6HGqRliCm+PZqD/TkMmOJtZKS5T9n8gXvNAJbYIEAA=; b=yU85gtSg9+Jp6ZNAdebM2euCp8qcGpviLhAIsOX/xHx1ZyunLLEJ9Z1WUsu6wUFNCR Qh4ArUfFRux4gQ7Utuv5dcKX9juz1IpN0mQxbm4hKH4G8gve1aRQM6l6sIvz98Y6J5zo jHy6GfXnc/OtEO/vWH7fC6FSoDQHWgUeQyUGXWD3lywR+0MpMfX4RxYAC/Y96ON4cie4 M60I/+VH3tLz+XmzlfXLhgMpiEt9Rsty1IIaAldwqbrA8X1Uidm19oQjgLDE/9ayPkN1 TpdZ89QDcS5uLqSAwlerd/p6J7927TCL2JFt51sKlO0IiQEM7I+DJ1gt2R9ESziZ4Hjo WObQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si3088566jak.4.2021.07.14.10.15.04; Wed, 14 Jul 2021 10:15:21 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238296AbhGNRRS (ORCPT + 99 others); Wed, 14 Jul 2021 13:17:18 -0400 Received: from mga01.intel.com ([192.55.52.88]:35631 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229631AbhGNRRR (ORCPT ); Wed, 14 Jul 2021 13:17:17 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10045"; a="232208011" X-IronPort-AV: E=Sophos;i="5.84,239,1620716400"; d="scan'208";a="232208011" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2021 10:14:25 -0700 X-IronPort-AV: E=Sophos;i="5.84,239,1620716400"; d="scan'208";a="413353696" Received: from alpinagh-mobl1.amr.corp.intel.com (HELO [10.212.71.223]) ([10.212.71.223]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2021 10:14:23 -0700 Subject: Re: [PATCH v2 05/16] ASoC: qcom: audioreach: add basic pkt alloc support To: Srinivas Kandagatla , 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> From: Pierre-Louis Bossart Message-ID: <58d6df8d-83ed-c716-81b2-e0927f58da6f@linux.intel.com> Date: Wed, 14 Jul 2021 11:30:12 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210714153039.28373-6-srinivas.kandagatla@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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? > +/* container config */ > +struct apm_container_obj { > + struct apm_container_cfg container_cfg; > + /* Capablity ID list */ typo: Capability > + struct apm_prop_data cap_data; > + uint32_t num_capablity_id; > +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. > + 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... > + 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; > +}