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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 36A30C05027 for ; Tue, 14 Feb 2023 20:21:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6771610E257; Tue, 14 Feb 2023 20:21:23 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9A6D810E257 for ; Tue, 14 Feb 2023 20:21:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676406081; x=1707942081; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=xbtF6Iqgcw88crLHQ+1r/3lStntfGI8GQn0zXt2kNoc=; b=LkBh9+ioTvIjNk3239HAAERNmZI5StCTxaYBfYO2gpyu4v30jLDRXx28 dgtiWRctLiVZ29kAMLQJCBxPOzIcCkqTePZGWXwy5ChqTdzsI0hg5zeUm sjn5OBwARcmyZHi4fbmcWhhChWXQavHNqYuF9N0ej4xUcFQM9g5dK3FMG vnVq5ldGPcED6Bb6t0P4MTFgHxY7P8tIvAKsLub/f7qd4pMfdWP+Vf11N PlWNyEuav25JHgl6NPzR8tgVCPDDAQLp/2Dl+Bt4/cCfnryZ0T5bS8kEE nYMuoZZDMjDDd5UeaosuO2BK+YCI5xKHk6t2LMNUnOC0n0X2/sE5ZI1dS g==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="331256937" X-IronPort-AV: E=Sophos;i="5.97,297,1669104000"; d="scan'208";a="331256937" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 12:20:37 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="914871494" X-IronPort-AV: E=Sophos;i="5.97,297,1669104000"; d="scan'208";a="914871494" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.212.220.101]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 12:20:36 -0800 Date: Tue, 14 Feb 2023 12:20:36 -0800 Message-ID: <87v8k4t2wb.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Rodrigo Vivi In-Reply-To: References: <20230213210049.1900681-1-ashutosh.dixit@intel.com> <20230213210049.1900681-2-ashutosh.dixit@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Intel-gfx] [PATCH 1/3] drm/i915/hwmon: Replace hwm_field_scale_and_write with hwm_power_max_write X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, 14 Feb 2023 06:50:44 -0800, Rodrigo Vivi wrote: > > > +static int > > +hwm_power_max_write(struct hwm_drvdata *ddat, long val) > +{ > > + struct i915_hwmon *hwmon = ddat->hwmon; > > + u32 nval; > > + > > + /* Computation in 64-bits to avoid overflow. Round to nearest. */ > > + nval = DIV_ROUND_CLOSEST_ULL((u64)val << hwmon->scl_shift_power, SF_POWER); > > + > > + hwm_locked_with_pm_intel_uncore_rmw(ddat, hwmon->rg.pkg_rapl_limit, > > + PKG_PWR_LIM_1, > > + REG_FIELD_PREP(PKG_PWR_LIM_1, nval)); > > + return 0; > > Let's keep this function as void and the return 0 in the previous spot. Hmm, see your point. Though there is an identical situation for hwm_power_max_read read too (in hwm_power_read). Maybe I'll change it there too in the same patch to keep things symmetrical and retain your R-b? > With that change: > > Reviewed-by: Rodrigo Vivi Thanks.