Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp322296rdb; Thu, 30 Nov 2023 05:57:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGHjsYsJy2SKJzJbclGLOqeRKxNxtrDo4LISuh6vGyUyfH7L32eIuqEX9v+mtR0+Y1AMMTZ X-Received: by 2002:a17:90b:4c52:b0:285:9d7e:ba04 with SMTP id np18-20020a17090b4c5200b002859d7eba04mr20025404pjb.35.1701352633457; Thu, 30 Nov 2023 05:57:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701352633; cv=none; d=google.com; s=arc-20160816; b=e1tD0YTZYPSB1XZfu/FFYI9sMYCGJq7mMgBnYe6IhXOgKR3tqqDbfnS+WMR6YAabx8 TZ5Ls6+uiX0Bktin87SWU1R17WPv59dprL2RtqAqTWJL6H6q742YiItdhoeRGjW7Yrv0 IaApBMZZ4Ch+3laShM2N7fKK3xezgw5bKMHog9Q03kCwAkDY1h7VQ5JzxgMzBy4Q6K7q aKSNRCCmy8IvrM/XMNmjOXfBcEeQcU/+Sa0PG/z3b+Bc3c9FVSbDQIID3ryjfT04t3Jn tEuKBA6oe0DTw31dGX2+tDlRuSsqcejaWaOqI1EXklT7YL8ZFXNfaW0GKggKEWdAIc85 brYg== 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=3DEUb7+kvCUo/Iq0wgbY1s/RUK6MxJj14BNPHBP7GuM=; fh=j5NxkopBRr5Nbom6OkMX0CgJAx8aC2FSZNdM8Jpqdh0=; b=iDTDZZlrs3gw5E9JLNognbhyhtVJ9blFLWIiAvSIn73Vytg8R+uSjqZtvduq5NvdyM QMsr0jGPLwzKjZpnX4Mmj/j6obPnvzod9QbBfjmA6rddJy9ZsWjRMCgg0sdlxaJuwDbN eGFiIysaAfgULfGjS1auemz++rmoHd9iOnqg0a5v2PuMsmn5kjbHm9VUBU++t1xeRdtz 0f7Qudlu0R0leBJCmYOgyivNEwRQF5JfXM4bIYSsuK6avHR5cN4oYtNhLQsfOmBlLJkl aRoirz1Ea0kjn36nY6fpOVxIwRSD7JT34ZYbpnG2zVoV6RzNAe4rCG7MKVGXLnvCBCb+ bJLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id n7-20020a17090aab8700b00274df6d4c38si1319315pjq.89.2023.11.30.05.57.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 05:57:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id AE4578031D70; Thu, 30 Nov 2023 05:57:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345749AbjK3N4y (ORCPT + 99 others); Thu, 30 Nov 2023 08:56:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345699AbjK3N4x (ORCPT ); Thu, 30 Nov 2023 08:56:53 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0A99AB9; Thu, 30 Nov 2023 05:57:00 -0800 (PST) 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 6F33C1042; Thu, 30 Nov 2023 05:57:46 -0800 (PST) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B00B03F5A1; Thu, 30 Nov 2023 05:56:58 -0800 (PST) Date: Thu, 30 Nov 2023 13:56:56 +0000 From: Sudeep Holla To: Cristian Marussi Cc: Sibi Sankar , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, quic_mdtipton@quicinc.com, linux-arm-kernel@lists.infradead.org, quic_asartor@quicinc.com, quic_lingutla@quicinc.com Subject: Re: [PATCH 2/3] firmware: arm_scmi: Fix freq/power truncation in the perf protocol Message-ID: References: <20231129065748.19871-1-quic_sibis@quicinc.com> <20231129065748.19871-3-quic_sibis@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 30 Nov 2023 05:57:10 -0800 (PST) On Thu, Nov 30, 2023 at 12:49:42PM +0000, Cristian Marussi wrote: > On Thu, Nov 30, 2023 at 12:05:06PM +0000, Sudeep Holla wrote: > > On Wed, Nov 29, 2023 at 12:27:47PM +0530, Sibi Sankar wrote: > > > Fix frequency and power truncation seen in the performance protocol by > > > casting it with the correct type. > > > > > > > While I always remembered to handle this when reviewing the spec, seem to > > have forgotten when it came to handling in the implementation :(. Thanks > > for spotting this. > > > > However I don't like the ugly type casting. I think we can do better. Also > > looking at the code around the recently added level index mode, I think we > > can simplify things like below patch. > > > > Cristian, > > What do you think ? > > > > Hi > > the cleanup seems nice in general to compact the mult_factor multipliers > in one place, and regarding addressing the problem of truncation without > the need of the explicit casting, should not be enough to change to > additionally also change mult_factor to be an u64 ? > I started exactly with that, but when I completed the patch, there was no explicit need for it, so dropped it again. I can bump mult_factor to be u64 but do you see any other place that would need it apart from having single statement that does multiplication and assignment ? I am exploiting the conditional based on level_indexing_mode here but I agree it may help in backporting if I make mult_factor u64. -- Regards, Sudeep