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 X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF260C388F7 for ; Tue, 10 Nov 2020 19:20:52 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 625EA2063A for ; Tue, 10 Nov 2020 19:20:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="xuvlVWa0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 625EA2063A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=p8HAn+j9DEOPqsKV7gjz3BRYM8/ghmekUMNP758mNaw=; b=xuvlVWa0PI0A2c4WOIDn3LIeV BDiVoRonhEe/R0wgUOx9lXdyAKVaIiaidRDzhB64aw8pkwdF7rVS0A4WFSEf7IeBcCVyVr+7k1Ck8 e0T8YJR4q6RC7t0zd4UeYLb8Hs+f2HWj7wMhW6ZArUWagjqdFoYc3gn4Quwr/5/kwBUNsoSrA9gFm /pNKDcQzolALpyI2I3AhLNB+kCgMB+HZwyTSs/RF13ewuVOxuyTN+2Ubx3cP21o4aaq6GxH6oeURG T0d3bbHlTG7D9aRTuUYW/Nvtcw+0FMsbF/4Zp6/I4bDG1mWaMyZMigq/ZIOhRXjGL1o++3agnc527 QiMt/UC3A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcZBB-0007OC-9y; Tue, 10 Nov 2020 19:19:45 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcZB8-0007M8-4U for linux-arm-kernel@lists.infradead.org; Tue, 10 Nov 2020 19:19:43 +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 EC99D1063; Tue, 10 Nov 2020 11:19:36 -0800 (PST) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 713533F7BB; Tue, 10 Nov 2020 11:19:35 -0800 (PST) Date: Tue, 10 Nov 2020 19:19:33 +0000 From: Cristian Marussi To: Peter Hilber Subject: Re: [PATCH v2 2/6] firmware: arm_scmi: add SCMIv3.0 Sensors descriptors extensions Message-ID: <20201110191933.GG42652@e120937-lin> References: <20201026201007.23591-1-cristian.marussi@arm.com> <20201026201007.23591-3-cristian.marussi@arm.com> <20201110172120.GF42652@e120937-lin> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_141942_253772_6D575D16 X-CRM114-Status: GOOD ( 23.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mikhail.golubev@opensynergy.com, Igor.Skalkin@opensynergy.com, jbhayana@google.com, sudeep.holla@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, egranata@google.com, lukasz.luba@arm.com 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 Tue, Nov 10, 2020 at 06:50:04PM +0100, Peter Hilber wrote: > Hi Cristian, > > sorry, I mistakenly used the wrong sender ("Mailing Lists") for the > original comment mail. Please see below for my reply. > > On 10.11.20 18:21, Cristian Marussi wrote: > > On Tue, Nov 10, 2020 at 05:00:05PM +0100, Mailing Lists wrote: > >> On 26.10.20 21:10, Cristian Marussi wrote: > >>> Add support for new SCMIv3.0 Sensors extensions related to new sensors' > >>> features, like multiple axis and update intervals, while keeping > >>> compatibility with SCMIv2.0 features. > >>> While at that, refactor and simplify all the internal helpers macros and > >>> move struct scmi_sensor_info to use only non-fixed-size typing. > >>> > >>> Signed-off-by: Cristian Marussi > >>> --- > >>> v1 --> v2 > >>> - restrict segmented intervals descriptors to single triplet > >>> - add proper usage of scmi_reset_rx_to_maxsz > >>> --- > >>> drivers/firmware/arm_scmi/sensors.c | 391 ++++++++++++++++++++++++++-- > >>> include/linux/scmi_protocol.h | 219 +++++++++++++++- > >>> 2 files changed, 584 insertions(+), 26 deletions(-) > >>> > >>> diff --git a/drivers/firmware/arm_scmi/sensors.c b/drivers/firmware/arm_scmi/sensors.c > >>> index 6aaff478d032..5a18f8c84bef 100644 > >>> --- a/drivers/firmware/arm_scmi/sensors.c > >>> +++ b/drivers/firmware/arm_scmi/sensors.c > >>> @@ -7,16 +7,21 @@ > >>> > >>> #define pr_fmt(fmt) "SCMI Notifications SENSOR - " fmt > >>> > >>> +#include > >>> #include > >>> > >>> #include "common.h" > >>> #include "notify.h" > >>> > >>> +#define SCMI_MAX_NUM_SENSOR_AXIS 64 > >> > >> IMHO the related 6 bit wide fields, like SENSOR_DESCRIPTION_GET "Number > >> of axes", should determine the maximum value, so 64 -> 63. > >> > > > > Yes, bits [21:16] 'Number of Axes' in sensor_attributes_high, but this > > #define was meant to represent the maximum number of sensor axis (64...ranging > > from 0 to 63) not the highest possible numbered (63). > > > > But in my understanding the actual maximum number of sensor axes is 63 > due to the maximum value 63 of 'Number of Axes', 64 would overflow > already. The ids would range from 0 to 62. Ah damn, you're right ... maximum that I can set in 5 bits is anyway 63. I'll fix. Thanks Cristian > > That said, in my understanding there is no problem with retaining a > higher value ATM. > > Best regards, > > Peter _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel