Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2684111iof; Wed, 8 Jun 2022 09:51:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3IY9WVi53wtiirxgWghX/JBWm0bc/VA8iSZrnyS5uBj9fgBtqYvJx+D0sp+uNZWIkbsPM X-Received: by 2002:a17:90b:4a12:b0:1e8:4a16:ae28 with SMTP id kk18-20020a17090b4a1200b001e84a16ae28mr113851pjb.1.1654707104975; Wed, 08 Jun 2022 09:51:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654707104; cv=pass; d=google.com; s=arc-20160816; b=p8yFZQpDwBJU1KCLCrgmQb0z7zpYPxCCvGqG8tHS0brRoJQbdTcdZnkzIt5ZG01pwN d0dS2ZFgoV+tM4Rf0DyzhQ8HuWLfj/AewNtJuBdeIRmLkCKhOve7re4x55FFuxXnKW/J sXCQOyUopd04RmTZ8priOmBv/zfPVK8mcAZgIpXyE7LC1bTl64qgOdW6kKgleoi3XEch 5JB5SGA9+TydkvLwR0kV920lSj5Jb7WLHjzphLvMQLv+3tSBGwuIbogE87UjjeiC69kQ idDQDHr2da/q9wRl9n1clFLq47RAwdLyIAfrhSKiGti6ubmQkgduzZX3oGp+0MvzvmfC Qaug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:mime-version :content-transfer-encoding:in-reply-to:subject:from:references:cc:to :content-language:date:message-id; bh=Y6ziHTLDkY8j76NgQYiU2wICG3YdEYqcXarJr2dCHaU=; b=FnO7IVdxtQ9A83p/yCVsN8DvH0zLgNKDY3UQKOqJOaqSr1EiPp+S1ym2niaB5HtykL 4ydVlML4rlMxV/jhaYb+/sYcy1qJ+PVydc5Xq9EsBvNqgk7Qvz45IkeOHG4Ze9lxc+nd rPrYwiHyAnyNwhgcqwgTPhFlFWzlTcXn85V9fN4GtDPzzywXUz/HT3OHCM8/lKRUlLcu RkyjzCKfCegpeJvi/d3bb0dGEDmcUL1aOOYt2PnbFxikkbuUU9YPqjj1V94//1Wy/68n /6CZ4QCIFpjMyrEjxHjhdGILdfmd00AurhoLOp3zGICqLc2Nt+WbodE13j3RiT60OlcC ki7Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@opensynergy.com header.s=TM-DKIM-20210503141657 header.b=HEXBJAXC; arc=pass (i=1 spf=pass spfdomain=opensynergy.com dkim=pass dkdomain=opensynergy.com dmarc=pass fromdomain=opensynergy.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=opensynergy.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v12-20020a170902b7cc00b001615a62cf93si27391898plz.544.2022.06.08.09.51.29; Wed, 08 Jun 2022 09:51:44 -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=fail header.i=@opensynergy.com header.s=TM-DKIM-20210503141657 header.b=HEXBJAXC; arc=pass (i=1 spf=pass spfdomain=opensynergy.com dkim=pass dkdomain=opensynergy.com dmarc=pass fromdomain=opensynergy.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=opensynergy.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343604AbiFHQu0 (ORCPT + 99 others); Wed, 8 Jun 2022 12:50:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343561AbiFHQuC (ORCPT ); Wed, 8 Jun 2022 12:50:02 -0400 Received: from repost01.tmes.trendmicro.eu (repost01.tmes.trendmicro.eu [18.185.115.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4121BAF33D for ; Wed, 8 Jun 2022 09:49:59 -0700 (PDT) Received: from 104.47.5.55_.trendmicro.com (unknown [172.21.163.172]) by repost01.tmes.trendmicro.eu (Postfix) with SMTP id 371691000045D; Wed, 8 Jun 2022 16:49:57 +0000 (UTC) X-TM-MAIL-RECEIVED-TIME: 1654706996.550000 X-TM-MAIL-UUID: 0a79bb37-d001-427d-81f6-fa382e625a5b Received: from EUR02-HE1-obe.outbound.protection.outlook.com (unknown [104.47.5.55]) by repre01.tmes.trendmicro.eu (Trend Micro Email Security) with ESMTPS id 865D7100024F5; Wed, 8 Jun 2022 16:49:56 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n3MZGZTlh4hqTeK+quolpjOhKKJA+d7fT3QUUisEYTTyaVT7eRQS1+nXE4ya212X1IQI1ET2xWIlNZh4AZeVzREGseEKOO6dUYHdRehWeFuRYfs/lXKxjbX1WdRxgD4Y9DWZAwv+ZN1rxAN+nKZe8OwtC+9mPlO9trQi+7U7zdQlAbKGb7IQBFN05l2NVFV9fVakfIJhpH6aCtBN3ud/4VEmxq7pmiEa6wVaoNlU5cO8gwByHjuAZtb4H/yX67tVe5ZnlmnmMFltZHOxApKik78NPoS/I0msdN1QU2VgwhDcuyo8wqSeZJC9JYQufuiiCn03M5nU37FJjxHpI6wbdQ== 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=Y6ziHTLDkY8j76NgQYiU2wICG3YdEYqcXarJr2dCHaU=; b=XQb6APcNjiSzhecEim9ek6V9vDjPnNqTxavfACuDmxHn5d81odbdKpgrKBMhVGvQKEQHn91/sbh0IJb2Nn9TT8Np78a9KkuT7ED4C4/btNIEgbKph7xkErCpHOHl1Bv3ryVhHFfdGgsCfHZoHLHueY1pLZ4bJ4Vg7ORWLf6P3eQQTS/wrEoMBy0pbeBQOAkVns8osizUBn2Ub+RVI4sACIAIvVcSRvqebFohg4UPYPOnHCaM+c20eJw7t2V7Ot5dz3+du8OxwcL5fOY6cpNgb3cPUSNwTBFa0P7/88rmAx06vcJYHnWK72kJV2nZn9zz05qyjSKk6dVEddTQEgVwwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=opensynergy.com; dmarc=pass action=none header.from=opensynergy.com; dkim=pass header.d=opensynergy.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=opensynergy.com; Message-ID: <1720e1a8-8bfb-ff9c-a81c-a9af41da3fa9@opensynergy.com> Date: Wed, 8 Jun 2022 18:49:53 +0200 Content-Language: en-US To: Cristian Marussi , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: sudeep.holla@arm.com References: <20220608095530.497879-2-cristian.marussi@arm.com> <20220608164051.2326087-1-cristian.marussi@arm.com> From: Peter Hilber Subject: Re: [PATCH v2 2/3] firmware: arm_scmi: Fix SENSOR_AXIS_NAME_GET behaviour when unsupported In-Reply-To: <20220608164051.2326087-1-cristian.marussi@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: AM4PR0101CA0071.eurprd01.prod.exchangelabs.com (2603:10a6:200:41::39) To AM9PR04MB8084.eurprd04.prod.outlook.com (2603:10a6:20b:3ec::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cc91f5dd-5061-4e85-f2e5-08da496ee9c5 X-MS-TrafficTypeDiagnostic: AS8PR04MB8452:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qkPQDuZgxVKbCBMdAwM3tZ4CEVc/WxTmsHIyTm34uq4pBYwcRclbP4qfz7Q/HU6ASQIVO27mklHEY2wL6EqirRWsVLWvyK/89OaxbIj6NS5qlAC35C52VCj2lbJDtZmG2fEAtifzsu5XS0uZHGAKIk2WaTOeUpxfwyY5OnX7ilYPESyeAuajnV9vrDAQ+WtUcM5y/K8640yRomDLvxiNgt8Z59h9slHRU5SVksHyfKwz/CYBm+xzP8ONnntJMSjaS1aCqu3/nDyQVL2BPCovMBDJGYtBTKSXplHUo0Mge3azZD03h0tfjunK/zKkAxZS3U/09+zlsdjPb2yqq3qft+pOzbQ/JTur6OzHIjA6dsmo/DbQo6GA4jfsQl8bCPWTfdr5y2RuuWeHzp/Nu1/FoBvE3vAyr4KaryvgSfDwz3wveDL5l3amWP/ZIc19bedtG19NdPvo2d9bUsQPG0axfZ9fxDiYmlbbYSe15OzrOe2mpowahg8w4FLWY5UfSQmgLrT8dagtjxKCscxjTqCGpYDBphSrzuDTMAOvjJrHt50942YyM4m5POSBUemPdaOruiqoVreuBpKp/hnZRuBV2hWamfxHgwRRUjijXRF8QcHw/A1VttcRGSBR6t9z9q2Oxvq7jj5uAerKy746sBOniw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8084.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(36756003)(38100700002)(8676002)(66556008)(53546011)(66476007)(5660300002)(4326008)(31696002)(2906002)(66946007)(44832011)(8936002)(508600001)(316002)(42186006)(86362001)(31686004)(186003)(2616005)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZnI5K2ErSWpjeWNnZ0FVQkhnNXN3L0NLaG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utf-8?B?U2ZVS0loUEtkOXBXdE1HM2pSSy9RcW5tcy9mdUZNNDBDaDducDh6UWdSdm0r?= =?utf-8?B?MEFCbmpzNFFEeXBnTUdzd1N5MEp4WFF3NzFFaC9IUVFKYlhSZC9MYXhySFc0?= =?utf-8?B?ZzZybk9FaFlXL2lrVEE2S0pzRUh2YnQxcTVKM2dtVUpNdFhrWW9oWFBOUGUv?= =?utf-8?B?N3gwNTU5VnlGcUdyNGluQlIyUUhJNWZWOWFGVDBrR1RZYWY2QTlQcXhzeGxR?= =?utf-8?B?OTU1TElRVlFOT2xSZHBTa0RJZGd3MVltVTgyK0QwVy8yZUxqRExrUzBZT1Ru?= =?utf-8?B?TXhpSXZpMWZhWEdacTY1dWpyV0k1TC9kRlFOR0VSSmFxaW40WjdhOXB6dkI0?= =?utf-8?B?K2N4NjFjS0dGdEttS0FaaEJpbW5Uck5ldlJpOXlFb0h5RHhSWDFkVEs5NVVZ?= =?utf-8?B?aWFZL1FWMW1WRndEcWNmMkN4S2d1TjFGcW5lb3dKMCt2YkxHVGp5Z0wzV0lv?= =?utf-8?B?M1crOXdOaEtrcHp0S2E3NGlCVUlPelFpeGhVR09QVFZJOVYwUDNvRmcyMkdB?= =?utf-8?Q?FW4cTrja5TQIsBaXL3gW4PkjekD307aTzm+LHy5cv1PG3?= X-MS-Exchange-AntiSpam-MessageData-1: tYDOT7K5qb7OOQ== X-OriginatorOrg: opensynergy.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc91f5dd-5061-4e85-f2e5-08da496ee9c5 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8084.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2022 16:49:54.4734 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 800fae25-9b1b-4edc-993d-c939c4e84a64 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5LOXb8MeY3EQPtZFu9j0moHUaoI1AiyuvaqTP1Hai/luTF4/5Cu3iSE3ooGcLwbml4vlM3jlZxTbxQbX/pcVMQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8452 X-TM-AS-ERS: 104.47.5.55-0.0.0.0 X-TMASE-Version: StarCloud-1.3-8.8.1001-26944.001 X-TMASE-Result: 10--10.740900-4.000000 X-TMASE-MatchedRID: y/2oPz6gbvg6yy6RAAEPc65i3jK3KDOoC/ExpXrHizwM4i3DScf0scNG 97DfmZl7TPK+KoOivGanTNYQei/0G1nGEjlsas2ye015woyPLfbBOVz0Jwcxl6vCrG0TnfVUvqn FtM6Nq/LhphqipnEX3Fs4QZAvccGCSrKLiysRAC4Zca7SN08UZBeN9Hd3TB5GPHMAbjuhwd9zCG qWg6PTivyPsndJnGNFSArVrOFmKyHzVhAZtxSZ0s69emDs42dd2FA7wK9mP9e4GyTmeN+AbC15I FUNL+ETeIe4HQ8ldFa1k1Md9jc6+pcFdomgH0lnOX/V8P8ail1ZDL1gLmoa/PoA9r2LThYYKrau Xd3MZDUHi8CNpq2En1B9GkMY3zTJ4Tt/Pml4SiibFILCA9TJOs7FDNRUTqOA X-TMASE-XGENCLOUD: 04ff35e4-f31f-42a1-b8dc-ec3e8efa2488-0-0-200-0 X-TM-Deliver-Signature: F8ED72FA0F10F9A24E5E9160619AA086 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=opensynergy.com; s=TM-DKIM-20210503141657; t=1654706997; bh=OlJ1OXbE75jdkKCbWSNkWbbRslVh6EQQXEy6H0+vgrA=; l=5854; h=Date:To:From; b=HEXBJAXCf+BlA1+mKq5pQjY9O2XqitcRsgpDyPlMap72ML4mnfUBAmbOFkHv9rCOj B6C1h4QvF8O+/5oiH8qMgrNfr7/Do4TTXAMpBFN7IXyfITnkLc2j/Z/RpZ90mAKhwj rqdB1ExsPECoZuepPDZAMBACb/+P2tsXfck9P6JGkfFPGEC0Sn2qKqPcp0wy+rJU3R LyaN1sWyFA8+aQE5B+du6Y30erN1UPpzjiFW9gv6US8d2FAx6mC2yP0S966c8xC8Pr b47UXH5wbcHLs5LhSlDSSAFAY3yzXfJRsxLmUOQ//z+LZ9CE4tmgUmU4lsfbrFKNxL PXcOFjkGN4eXA== X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, 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 On 08.06.22 18:40, Cristian Marussi wrote: > Avoid to invoke SENSOR_AXIS_NAME_GET on sensors that have not declared at > least one of their axes as supporting extended names. > > Since the returned list of axes supporting extended names is not > necessarily comprising all the existing axes of the specified sensor, > take care also to properly pick the ax descriptor from the id embedded > in the reply. > > Cc: Peter Hilber > Cc: Sudeep Holla > Fixes: 802b0bed011e ("firmware: arm_scmi: Add SCMI v3.1 SENSOR_AXIS_NAME_GET support") > Signed-off-by: Cristian Marussi Reviewed-by: Peter Hilber > --- > V1 --> v2 > - fixed missing endianity conversion > --- > drivers/firmware/arm_scmi/sensors.c | 56 +++++++++++++++++++++++------ > 1 file changed, 46 insertions(+), 10 deletions(-) > > diff --git a/drivers/firmware/arm_scmi/sensors.c b/drivers/firmware/arm_scmi/sensors.c > index 75b9d716508e..8a93dd944c49 100644 > --- a/drivers/firmware/arm_scmi/sensors.c > +++ b/drivers/firmware/arm_scmi/sensors.c > @@ -358,15 +358,20 @@ static int scmi_sensor_update_intervals(const struct scmi_protocol_handle *ph, > return ph->hops->iter_response_run(iter); > } > > +struct scmi_apriv { > + bool any_axes_support_extended_names; > + struct scmi_sensor_info *s; > +}; > + > static void iter_axes_desc_prepare_message(void *message, > const unsigned int desc_index, > const void *priv) > { > struct scmi_msg_sensor_axis_description_get *msg = message; > - const struct scmi_sensor_info *s = priv; > + const struct scmi_apriv *apriv = priv; > > /* Set the number of sensors to be skipped/already read */ > - msg->id = cpu_to_le32(s->id); > + msg->id = cpu_to_le32(apriv->s->id); > msg->axis_desc_index = cpu_to_le32(desc_index); > } > > @@ -393,12 +398,14 @@ iter_axes_desc_process_response(const struct scmi_protocol_handle *ph, > u32 attrh, attrl; > struct scmi_sensor_axis_info *a; > size_t dsize = SCMI_MSG_RESP_AXIS_DESCR_BASE_SZ; > - struct scmi_sensor_info *s = priv; > + struct scmi_apriv *apriv = priv; > const struct scmi_axis_descriptor *adesc = st->priv; > > attrl = le32_to_cpu(adesc->attributes_low); > + if (SUPPORTS_EXTENDED_AXIS_NAMES(attrl)) > + apriv->any_axes_support_extended_names = true; > > - a = &s->axis[st->desc_index + st->loop_idx]; > + a = &apriv->s->axis[st->desc_index + st->loop_idx]; > a->id = le32_to_cpu(adesc->id); > a->extended_attrs = SUPPORTS_EXTEND_ATTRS(attrl); > > @@ -444,10 +451,19 @@ iter_axes_extended_name_process_response(const struct scmi_protocol_handle *ph, > void *priv) > { > struct scmi_sensor_axis_info *a; > - const struct scmi_sensor_info *s = priv; > + const struct scmi_apriv *apriv = priv; > struct scmi_sensor_axis_name_descriptor *adesc = st->priv; > + u32 axis_id = le32_to_cpu(adesc->axis_id); > + > + if (axis_id >= st->max_resources) > + return -EPROTO; > > - a = &s->axis[st->desc_index + st->loop_idx]; > + /* > + * Pick the corresponding descriptor based on the axis_id embedded > + * in the reply since the list of axes supporting extended names > + * can be a subset of all the axes. > + */ > + a = &apriv->s->axis[axis_id]; > strscpy(a->name, adesc->name, SCMI_MAX_STR_SIZE); > st->priv = ++adesc; > > @@ -458,21 +474,36 @@ static int > scmi_sensor_axis_extended_names_get(const struct scmi_protocol_handle *ph, > struct scmi_sensor_info *s) > { > + int ret; > void *iter; > struct scmi_iterator_ops ops = { > .prepare_message = iter_axes_desc_prepare_message, > .update_state = iter_axes_extended_name_update_state, > .process_response = iter_axes_extended_name_process_response, > }; > + struct scmi_apriv apriv = { > + .any_axes_support_extended_names = false, > + .s = s, > + }; > > iter = ph->hops->iter_response_init(ph, &ops, s->num_axis, > SENSOR_AXIS_NAME_GET, > sizeof(struct scmi_msg_sensor_axis_description_get), > - s); > + &apriv); > if (IS_ERR(iter)) > return PTR_ERR(iter); > > - return ph->hops->iter_response_run(iter); > + /* > + * Do not cause whole protocol initialization failure when failing to > + * get extended names for axes. > + */ > + ret = ph->hops->iter_response_run(iter); > + if (ret) > + dev_warn(ph->dev, > + "Failed to get axes extended names for %s (ret:%d).\n", > + s->name, ret); > + > + return 0; > } > > static int scmi_sensor_axis_description(const struct scmi_protocol_handle *ph, > @@ -486,6 +517,10 @@ static int scmi_sensor_axis_description(const struct scmi_protocol_handle *ph, > .update_state = iter_axes_desc_update_state, > .process_response = iter_axes_desc_process_response, > }; > + struct scmi_apriv apriv = { > + .any_axes_support_extended_names = false, > + .s = s, > + }; > > s->axis = devm_kcalloc(ph->dev, s->num_axis, > sizeof(*s->axis), GFP_KERNEL); > @@ -495,7 +530,7 @@ static int scmi_sensor_axis_description(const struct scmi_protocol_handle *ph, > iter = ph->hops->iter_response_init(ph, &ops, s->num_axis, > SENSOR_AXIS_DESCRIPTION_GET, > sizeof(struct scmi_msg_sensor_axis_description_get), > - s); > + &apriv); > if (IS_ERR(iter)) > return PTR_ERR(iter); > > @@ -503,7 +538,8 @@ static int scmi_sensor_axis_description(const struct scmi_protocol_handle *ph, > if (ret) > return ret; > > - if (PROTOCOL_REV_MAJOR(version) >= 0x3) > + if (PROTOCOL_REV_MAJOR(version) >= 0x3 && > + apriv.any_axes_support_extended_names) > ret = scmi_sensor_axis_extended_names_get(ph, s); > > return ret;