Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2686224iof; Wed, 8 Jun 2022 09:55:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJczPvthrQ5YsTzQGEH1Fe6WVSJkCDr0eAmXgT0z5caFOY/JLSnKNTgB7DO1HKv65IgV8e X-Received: by 2002:a17:90b:1b05:b0:1e2:a053:2fad with SMTP id nu5-20020a17090b1b0500b001e2a0532fadmr100082pjb.209.1654707307915; Wed, 08 Jun 2022 09:55:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654707307; cv=none; d=google.com; s=arc-20160816; b=mTzAk2BmBc0tSf89vhTYu3fNTZdHAtjx1rtxBBO03YWYgogcGrDTiYzLJkAtOceRT4 QEcJAnYSctxyjzcjxpAtizvo0sLvzjdwfO2TGcGjyWwRaIzIeuuB8IVyyiODLjKlTQnN Dm4CIXzDhHGdkp/jtmYFJVF196jfDfNPnXGuVv1jvm4AjqmG4cwR8V4d73SWC9emmUmo BJLfkmLFA5qIS2JYARoJfz4g39vX6KCpIlZT9J5UwlSKtvl10hbN5onWK3NSUhw1e3/+ vSrvRHEjY8JLKbc5rwAmvv9PFITGDHTCAuQwahJgf0OOEVil2rOkdv+I/5b7TOdpajsq YBLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=J6VEAdLAj4gUIukRgy9UkG1bU6vUwZQNEGV5zcA6pXI=; b=p57M0gBNaLdZWNxBuO17TZvJduZu3DST0DCwiSE4WPKWOnFK31JEca30mslVN8JeVy YCvx/JLzjcGfJan31ZgpJEkTLHYcfJ3wM+opWxpV5D/JsxQZeSslMbHK39PW8fpUM+4Z n4QlUe8SfFvN1M111o/4pfGg0LcEqVUz/TES4F2vAlmtN/e/+/tQQnd6tCWd8bQ0APG/ h3J2rFpQAERRS08z2z1oipcOwnbANAxS5NNJ9xkSzeKxp/vDhlMVG+9aJbFZYBydAPo2 7FTwaYtT2j678h5Ngq450y/As2V9ZhNfzsnNyjm2+zThqf83c+u+L1KXFjTfrPyEYOoE 9Pxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i6-20020a639d06000000b003fb8f6e341fsi31253654pgd.290.2022.06.08.09.55.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 09:55:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6EFDB4BBBB; Wed, 8 Jun 2022 09:27:19 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245464AbiFHQ06 (ORCPT + 99 others); Wed, 8 Jun 2022 12:26:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245425AbiFHQ0u (ORCPT ); Wed, 8 Jun 2022 12:26:50 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 00C59BF4D for ; Wed, 8 Jun 2022 09:26:47 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1DF591424; Wed, 8 Jun 2022 09:26:47 -0700 (PDT) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 580E03F73B; Wed, 8 Jun 2022 09:26:46 -0700 (PDT) Date: Wed, 8 Jun 2022 17:26:40 +0100 From: Cristian Marussi To: Peter Hilber Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sudeep.holla@arm.com Subject: Re: [PATCH 2/3] firmware: arm_scmi: Fix SENSOR_AXIS_NAME_GET behaviour when unsupported Message-ID: References: <20220608095530.497879-1-cristian.marussi@arm.com> <20220608095530.497879-2-cristian.marussi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed, Jun 08, 2022 at 05:19:02PM +0200, Peter Hilber wrote: > Hi Cristian, > > I think I found two missing endianness conversions, see below. > > Best regards, > > Peter [snip] > > @@ -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,18 @@ 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; > > > > - a = &s->axis[st->desc_index + st->loop_idx]; > > + if (adesc->axis_id >= st->max_resources) > > I think adesc->axis_id uses in this function need to be wrapped with > le32_to_cpu() (here and below as well). > ...damn, my bad ... I'm posting a V2. Thanks for the review ! Cristian