Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4438656imw; Tue, 12 Jul 2022 07:59:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vV7+1sKidRD9vT32MxqhBjrDDIpqna/ql4u66g6zEcNXI5qM1SSA+FSdu+9yvtAC8TqqI4 X-Received: by 2002:a63:8bc9:0:b0:412:aa5e:674c with SMTP id j192-20020a638bc9000000b00412aa5e674cmr21623235pge.51.1657637991808; Tue, 12 Jul 2022 07:59:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1657637991; cv=pass; d=google.com; s=arc-20160816; b=wCPP2BUKK4yy95LbW709crDPxW8gpFqIOJKMMbbxJEd/UBUMwI5rbt9s21J/30zVzS AAfBp+TQUhvlAmhG8Sw5rGw6sIdVIeqCYxIj52hm7Ipo8Ho+VRPke5loQ5tFdbWDsySC NCS14we5LlTZX/5n4Mc3B2T96J3j58AhlmhhXo4bsKJ7Im85rLbbbQtcK4my5KHZ90uG U5iy0wg3jpxh0GDCKJSH3yqzIwDK9dNiU2+QfLp2lL8eBSk5+9dr/mZhlf7sNQpNydFY NnTVMES5U+kOfulvaf4Y2blKEDbsbbttKtXHONXbU9LJ6hMjjs0hhTEM6UMNLfRenyB5 AbSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=z1Ggc4LYG/lXVmUFwze3fqikKdfR3lu3hYI4t+f3EvI=; b=K1KzvmxwCSaHVKyNdzZI0jqWqarcZSyvPTHOEMcpzdpUne4csf0yL/huIoxJFt+7e3 LItU5W/GS/NNX6hb5edZWiZdD7Ee3kS4XJq2U+O5EGqb7oUeTt7jigPk8p/AU1AaL/BS pd15PZER0/Je5vFjAEE2ttpLp/14cLXgYh43+hBr8Myb2qXD81tExwNupyfA1A44Tmdn /lykPSOnYs2VgG2TinJBCXtMpTlCAyIQzj8uqBhO9oBlV0f6IrLYPzifNDJr732PjnCV XnylsC2m3I4Wf/AAxLALumFTuHyQLa4xfqURs0PntAUkSJxyrMjgBqimLgCxQ/18t5// WUBw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=StTUnPMq; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bj17-20020a056a02019100b003fcdc3249b8si5246532pgb.494.2022.07.12.07.59.38; Tue, 12 Jul 2022 07:59:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=StTUnPMq; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233070AbiGLOQZ (ORCPT + 99 others); Tue, 12 Jul 2022 10:16:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231474AbiGLOQN (ORCPT ); Tue, 12 Jul 2022 10:16:13 -0400 Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30059.outbound.protection.outlook.com [40.107.3.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 841BB61118 for ; Tue, 12 Jul 2022 07:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dMiuOv1Xul05owOGkUajHELcRfr3OJR9kjaeBuPZnQEO6/biN6tQm1Ohr6G7Zf3AeiKlVgTGsR4tJU2G+6Yd+UHhTLGNKHkJrO9jO/lF+lfy2fwTPcsc1x/uHLSh2SNgJ9+L8Y3qvm4K5vZMbyuBfbJplQ1jDSE8h9EIbjJ8L+oXsy1ifO/4kw16uo/Rps0b1ovb18rjhqohurGwDoEDX60LXsk5HM0qKps/kdSyU4Vo1AehqK2zQKf7k6mURYoxRlATE9Ms7qH6caUs5HwhGeL/p6yaOSpE8VUD8Y+QoTTbuF2dsdb3aWBEuXS5Jt/YAvwJFiFdLh/ygjsqBQg2MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=z1Ggc4LYG/lXVmUFwze3fqikKdfR3lu3hYI4t+f3EvI=; b=SV42kg7GGSrRlbzt5LtprdlOindju9kmG1h/FNBT4pqkjkuUuqZGSXp/LLMERyZiphHd6Zgg+Q7L50o3MKGW03JxOoqbtEd6a+b+jujRthC8WRI1ap1r3Nvjag1ZBCeI/29OduS0H3hZh+V4wTwKr8fgJz3vqj9dCdZxlquyNBbGGQhiF960X5OjMdjgOuoNlYCFpFwAFPTc5Cd3HHEkrcNWp81pcGxWMAGvLYoHBHie9MgbjIpCL0OlEsufXTmAyBtKmyOSylIur9wmVxGC4HGK1V1aZrNXuNJASn2K0Wt3+4J2DQNUFAMTkqUPjSiqPspo38Z3j2qNpi7+G7Yunw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z1Ggc4LYG/lXVmUFwze3fqikKdfR3lu3hYI4t+f3EvI=; b=StTUnPMq1cIGopC3AF0zIIG2xwMYz0G8RFmotD7iT12VMvD0r7LZ6Cj6axJFfLW4Hj17VRkJ8tgLHgbeKFmu1yw+1tcanc6TDpPnOgc/NFZlpNA0vIoYXBfAdQUIWtEQL+jrODzjIMWgOGK10pHzNonotCh2gy9FnktRwV3A1lc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM0PR04MB5140.eurprd04.prod.outlook.com (2603:10a6:208:ca::21) by PA4PR04MB7885.eurprd04.prod.outlook.com (2603:10a6:102:ce::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.26; Tue, 12 Jul 2022 14:16:09 +0000 Received: from AM0PR04MB5140.eurprd04.prod.outlook.com ([fe80::15ba:4274:2df4:8928]) by AM0PR04MB5140.eurprd04.prod.outlook.com ([fe80::15ba:4274:2df4:8928%5]) with mapi id 15.20.5417.026; Tue, 12 Jul 2022 14:16:09 +0000 From: Daniel Baluta To: broonie@kernel.org, alsa-devel@alsa-project.org Cc: daniel.baluta@nxp.com, linux-imx@nxp.com, lgirdwood@gmail.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com, yc.hung@mediatek.com, linux-kernel@vger.kernel.org, Pierre-Louis Bossart Subject: [PATCH 3/4] ASoC: SOF: compress: Prevent current kernel running with older FW Date: Tue, 12 Jul 2022 17:15:30 +0300 Message-Id: <20220712141531.14599-4-daniel.baluta@oss.nxp.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220712141531.14599-1-daniel.baluta@oss.nxp.com> References: <20220712141531.14599-1-daniel.baluta@oss.nxp.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: AM3PR07CA0141.eurprd07.prod.outlook.com (2603:10a6:207:8::27) To AM0PR04MB5140.eurprd04.prod.outlook.com (2603:10a6:208:ca::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 13d35287-1fe1-4ece-9f9f-08da64111153 X-MS-TrafficTypeDiagnostic: PA4PR04MB7885:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hx9bCDz9wBhuruj2xtuae4ubhe/U1qIG4YNMGWwdDDKX1pxOhrkWvKhuml/r7rFVC1i1tMbyklvUOWdUrPQFrPlxTDksatomQ08hcoz0ShmLCG2Az3iMtc1n6Cp3/5Envdb/21sYZ/2gAtHrjHkdvRj4KAg/S/pR5bZXpHwKf53R/PZgvOeNQ/i7YJdPdgzRuR1aDHkzB5R4fzmhfdWONHFgHgKEhAiEazbNTwNRvPRM/e0+T7P6XNk73Ke+1mizE9n6hrz8WNaoLQhd6galjqnR0cNt2s3wsLAUOhVL4Joq8rOnM5hXLbiKv7cgVjfBBA8AK+SZyAahou2PJJ+HcoPsZBebLNRsvLiMdrWeD8mrgl8Hxv3yfzADcuz5mdCGoNKRyMt6/Gcwx+NomcozuMmogOy/Xj23sg/nxpgY0rLgPjVpZYrE/09c1FbfqDgLXmJvo8EZdHunMVNmrZVQWM+RBZ3ShL/NJDp0jZjoSjM46+of1c/zvvles5Zy7tNuM5wRyWaPLvttLbXP28eThEcimnKnnZeACx74xUvyZQ+9DF16yy0RviuKwZAUHUfeO6Tzkcx+vOKl9ofsx8FSQegiPvS4B9+9kg+Gxdz9/xhK4+1/hTI0JG+hHkf9HsRTqh08KPLJR3utACUxtoZBRdNPsV59W7XAT0/FXdSmDofV4ltCUKu9XHja4AB5MCm5/wmSDLCSutN8K+v3cnkmYwyoTvYSoGQNcwJDC4j1CZeH/u9o/Mua3B2vMOR+ffJSP7ySDHdgGhoiFXB2AvTH1/+Etoy3pNhsAGZ3FC4kXxXjx7A0nlAzuuEINX3stRyi X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB5140.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(376002)(136003)(396003)(39860400002)(346002)(366004)(316002)(38100700002)(478600001)(6486002)(8676002)(38350700002)(2616005)(66946007)(4326008)(186003)(66556008)(66476007)(1076003)(26005)(6666004)(86362001)(6506007)(44832011)(41300700001)(5660300002)(8936002)(7416002)(6512007)(52116002)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VkVVU1UxaThUN2pGQndFWENIMnFPMmtmcDRrTExDYi9Qb2dyTHI4bVFtWXlG?= =?utf-8?B?NHIvZGFGQmFFV2hKbXlHZFVYNmxadGY3KzA1ZzFGM2xUUXdkZ0tFVTg4UHIy?= =?utf-8?B?NnhxeklXYnh4a3FyczkzeEFaSW9GQmFyOGpLSWlLelFoL1pSQmkwaVNDYW9E?= =?utf-8?B?cXhoTmNBdGQ0YlQ1NHRXdjJkMk9hdkNTQS9Cb2JRaGd6Tmt5MHJyTndZc2VX?= =?utf-8?B?emZJeW85bTkwcnJhVHdqZjRJYXRUcmYyMWtVdW9PNHht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Uo0RmtJSEtqeDl4MTFIMVpoSmgzUDVTbkRHNFN5bWZFV3RYc1FTbmZS?= =?utf-8?Q?/B1fYJvQUcRG4zcve9fJF8jcP?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13d35287-1fe1-4ece-9f9f-08da64111153 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5140.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2022 14:16:09.6136 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Dzp9Y0j4puH6gA6DQGBy4vk/CyMTHPAp2F3g+LfcWpKUVyFcyaMKc4ro3bDn3Izvse0KZ4ZP6gUYOlzaxyebkg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7885 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Baluta After introducing extended parameters we need to forbid older firmware versions to run with the current and future kernel versions. Although in theory the communication protocol will still work the semantics at application level are undefined. So, prevent this by disallowing older firmwares to run with newer kernels. Signed-off-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi --- sound/soc/sof/compress.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/soc/sof/compress.c b/sound/soc/sof/compress.c index 1204dce29ef9..67139e15f862 100644 --- a/sound/soc/sof/compress.c +++ b/sound/soc/sof/compress.c @@ -167,12 +167,23 @@ static int sof_compr_set_params(struct snd_soc_component *component, struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct snd_compr_runtime *crtd = cstream->runtime; struct sof_ipc_pcm_params_reply ipc_params_reply; + struct sof_ipc_fw_ready *ready = &sdev->fw_ready; + struct sof_ipc_fw_version *v = &ready->version; struct snd_compr_tstamp *tstamp; struct sof_ipc_pcm_params *pcm; struct snd_sof_pcm *spcm; size_t ext_data_size; int ret; + if (v->abi_version < SOF_ABI_VER(3, 22, 0)) { + dev_err(component->dev, + "Compress params not supported with FW ABI version %d:%d:%d\n", + SOF_ABI_VERSION_MAJOR(v->abi_version), + SOF_ABI_VERSION_MINOR(v->abi_version), + SOF_ABI_VERSION_PATCH(v->abi_version)); + return -EINVAL; + } + tstamp = crtd->private_data; spcm = snd_sof_find_spcm_dai(component, rtd); -- 2.27.0