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 CA03EC07CA9 for ; Thu, 30 Nov 2023 19:54:36 +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=Epe5y9ijEf1GOxTGACVjqPEo021WCIQNPOqqjUSNah4=; b=We6MuuUyqaWT+z f/7apE/t0ASsKFW2c8PphBlgBLlU8h1yqHTmK6FBHEKZvHUiTMuxenVh5vC3liONfnwrUlD6PXJ8O cgA8KyLqLS9b+lqlsTJubiEvCJr85Xoy3ayngZ00cWwFuKHZts6DTXyAuKjv93Rv9vs4W/Psj/AnI tpdc2DpDLZaUODGi32Ic6KoVSXiZug4KXuR5ZIWKVwf9tbkDEy6oKYu6aDnI4rNmvJDxjww8r7jbt 2/mED4wsAIypLXA7zVOi3VEXtvzTR2jh9FulWf+XD9rsGP04LexhqzervepJ0tUpuyfxVmwW1yXo7 xisJIdatj/VY/FHWL53g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r8n6t-00BmZ5-2S; Thu, 30 Nov 2023 19:54:07 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r8n6q-00BmYJ-1v for linux-arm-kernel@lists.infradead.org; Thu, 30 Nov 2023 19:54:06 +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 CA3CE1042; Thu, 30 Nov 2023 11:54:43 -0800 (PST) Received: from bogus (unknown [10.57.42.162]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 69BDF3F73F; Thu, 30 Nov 2023 11:53:55 -0800 (PST) Date: Thu, 30 Nov 2023 19:51:54 +0000 From: Sudeep Holla To: Cristian Marussi Cc: Sibi Sankar , linux-arm-msm@vger.kernel.org, Sudeep Holla , 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: <20231130195154.hid7darksc4skxqp@bogus> References: <20231129065748.19871-1-quic_sibis@quicinc.com> <20231129065748.19871-3-quic_sibis@quicinc.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-20231130_115404_685760_F18E65BC X-CRM114-Status: GOOD ( 15.91 ) 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 Thu, Nov 30, 2023 at 04:25:44PM +0000, Cristian Marussi wrote: > On Thu, Nov 30, 2023 at 01:56:56PM +0000, Sudeep Holla wrote: > > 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. > > > > Ah right > > freq *= dom->multi_fact; > > does the trick..but cannot this by itself (under unplausibl conds) > overflow and does not fit into a u32 mult_factor ? > > dom_info->mult_factor = > (dom_info->sustained_freq_khz * 1000UL) > / dom_info->sustained_perf_level; Agreed. Also thinking about backports, I think making it u64 is simple fix. I will also thinking of splitting the changes so that fixes are more appropriate. I will try to post something soonish. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel