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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 59D93C43334 for ; Wed, 8 Jun 2022 16:27:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fkpfSQSJr+CqCX+8ioKogoLtuxnTheffgcjP/gCzNnQ=; b=EfTxcP/mcXYO/R 5ybsNG/em3Ott0dwOIZ8hlo8UmN1aApTiwQ6pvU7IoLXDQ2F1GcHWyISGO4mcuEsDW+XseclQyauQ pnduo4SYYGSRqy+EQTarX9srT33oK+w1QJMQ5egHp/z85ogqauu0fydAfu5UmFGU6eJX2GOV7o2pX /NV7bm5fzDAHpI8lvcmaEP0aKV8BXiEyooHiDlvTh6Oq6yWQUmF+hUmjnz6hwRgSB0ACCEDIoFJnU qtMaRyrMmmwNDjkjFAepZ36kD/9T/9JcQ48Uk1IWVyJV6C2wWQieobjDAdEKaqeZUbiPMiCw+anFu FajnBpVL56/yWzX5ICvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyyWF-00EIbr-Rt; Wed, 08 Jun 2022 16:26:55 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyyWC-00EIZp-5d for linux-arm-kernel@lists.infradead.org; Wed, 08 Jun 2022 16:26:54 +0000 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_092652_292397_DDFAEB50 X-CRM114-Status: GOOD ( 13.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel