Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp563569rdb; Thu, 30 Nov 2023 11:54:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IGoHlRdtrnCkBvDIBK8QD9uAoyOJOEf0LJURlQbQa67PJv5DOIJZNYf9yYBH9pdLo2VOqLq X-Received: by 2002:a17:902:db06:b0:1cf:c376:6d8d with SMTP id m6-20020a170902db0600b001cfc3766d8dmr17946844plx.32.1701374050889; Thu, 30 Nov 2023 11:54:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701374050; cv=none; d=google.com; s=arc-20160816; b=LsdoGmVL+Qthh382eVd41bgXg1mnm/QCDaV2xT1SkRb6U49arT1Wx0XpvJOpCMR5hL p3tMDxSYdoMFKzeY/qeAJW/ANLZyzAzg2Fr89fQOOKDL3g6oBuk2Xv0Audh9aPMliYC4 tGWB8wYw912WbGBuijhhl95FP5E388S6e9URha717M9n9u4YytUCRTQ9d+dj3xRCORN1 aYj2yOXbKrzdYxImRa9PJjOdXJgi3ngHEjOk/QlMZcbb6XYnErjwR8CmE2n6M0d15osQ sILIr5NImsFCvweMUhJTBsRMvUa3h13l0h10vWA4vptN6x0LAcq8PlglTrBW+sxsHRHT 5wCw== 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=WEGC8E5VppJTYYophRJ8FH9CU1yZtaCRZSDylapJRws=; fh=WjGu5X/+7lJghPKhDgtnPSBlVnmMuitqImwn7mwLILY=; b=SehXZvIhGK1sNQzIOtUtseZm8DLZ25IDCN11xnoUfhuRRfw47I1EQExHvVO9ER4qDq GwW132v1NTA3Biw2QMrgyk86HnmFIiO8NebxllBWpnWbU9i9NDTLgsdaXUm9Bj1kyDcO OOscimIfn1ug+Gv6AtzmfqkDrsNyp9Hwd4WgEZWv+xTc5PfTfhSRQCHou/gGWxgT2UXc 7N1q9aMXt+Fj2fe3rbNzZJjzA8EsUSjSdpeH+NeLXECJ0KznlbUAvGXnkTesyuDfJCfV o2RnduN1ox59oA8I8t8E26tzYImZZDNIjmOlKg6nWdvz6JlgT6w/9T95OLV6/hu/wp3F GsEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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. [23.128.96.38]) by mx.google.com with ESMTPS id w3-20020a170902a70300b001cc0cd0772dsi1778650plq.86.2023.11.30.11.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:54:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 7C45E80A135A; Thu, 30 Nov 2023 11:54:06 -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 S1376574AbjK3Txw (ORCPT + 99 others); Thu, 30 Nov 2023 14:53:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376470AbjK3Txv (ORCPT ); Thu, 30 Nov 2023 14:53:51 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 74DA1DD; Thu, 30 Nov 2023 11:53:57 -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 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-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 11:54:06 -0800 (PST) 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