From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A228CDB465 for ; Mon, 16 Oct 2023 15:55:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233869AbjJPPzR (ORCPT ); Mon, 16 Oct 2023 11:55:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233874AbjJPPzQ (ORCPT ); Mon, 16 Oct 2023 11:55:16 -0400 Received: from srv01.abscue.de (abscue.de [89.58.28.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79C4AAD for ; Mon, 16 Oct 2023 08:55:13 -0700 (PDT) Received: from srv01.abscue.de (localhost [127.0.0.1]) by spamfilter.srv.local (Postfix) with ESMTP id 341E31C07B1; Mon, 16 Oct 2023 17:55:09 +0200 (CEST) Received: from abscue (dslb-088-078-201-093.088.078.pools.vodafone-ip.de [88.78.201.93]) by srv01.abscue.de (Postfix) with ESMTPSA id 974DE1C07B0; Mon, 16 Oct 2023 17:55:08 +0200 (CEST) Date: Mon, 16 Oct 2023 17:55:03 +0200 From: Otto =?iso-8859-1?Q?Pfl=FCger?= To: Mark Brown Cc: Otto =?iso-8859-1?Q?Pfl=FCger?= , linux-arm-msm@vger.kernel.org, Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , alsa-devel@alsa-project.org, ~postmarketos/upstreaming@lists.sr.ht Subject: Re: [PATCH 1/3] ASoC: qcom: q6core: expose ADSP core firmware version Message-ID: References: <20231014172624.75301-1-otto.pflueger@abscue.de> <20231014172624.75301-2-otto.pflueger@abscue.de> <6ff78ead-fe41-496f-afdc-a83eee27f652@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6ff78ead-fe41-496f-afdc-a83eee27f652@sirena.org.uk> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Mon, Oct 16, 2023 at 01:47:28PM +0100, Mark Brown wrote: > On Sat, Oct 14, 2023 at 07:26:22PM +0200, Otto Pflüger wrote: > > > + for (i = 0; i < g_core->svc_version->num_services; i++) { > > + struct avcs_svc_info *info; > > + > > + info = &g_core->svc_version->svc_api_info[i]; > > + if (info->service_id != APR_SVC_ADSP_CORE) > > + continue; > > + > > + switch (info->version) { > > + case AVCS_CMDRSP_Q6_ID_2_6: > > + core->adsp_version = Q6_ADSP_VERSION_2_6; > > + break; > > + case AVCS_CMDRSP_Q6_ID_2_7: > > + core->adsp_version = Q6_ADSP_VERSION_2_7; > > + break; > > + case AVCS_CMDRSP_Q6_ID_2_8: > > + core->adsp_version = Q6_ADSP_VERSION_2_8; > > + break; > > + } > > This doesn't handle unknown versions at all. The adsp_version is initialized to Q6_ADSP_VERSION_UNKNOWN in q6core_probe, so it should stay unknown if it doesn't match any of these values. I don't see any big problems here, but I agree that some additional handling such as a warning message could be useful.