Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp608135pxb; Thu, 9 Sep 2021 08:07:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4gMM5esmBuqnOyexpUp12b2LMIINcCV/jbPJ/IElNjlLmPRnS29l4+bF0SEz4w4QLjqE/ X-Received: by 2002:a05:6e02:1ca6:: with SMTP id x6mr2661163ill.86.1631200025181; Thu, 09 Sep 2021 08:07:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631200025; cv=none; d=google.com; s=arc-20160816; b=bK6UwVNMAAo85n+7rO1w4CHHWfnvh2UtVTJrzzw34++qzoe6MfYM+OHbf6VMWRQHKj I2xrBdVD50SuOdBHSpp3yhd9i6HJSajPTfGh7QBj8WxeEsALsljXH8El0Kdd0q3m8xp7 x5Tupyl+L7xBHTY/qkH1SvihEFn2IPsGGCzoCXqhiM00Ivvkh1lGIRJjuM+fyyDkp7r9 js28DfjVahhC9vpU36UIpIRJ7lBuGdZMdWl9fV4S3DbIiKcyyDgTFqmFMef61okhVL48 DBPJB03vLC4eq1jxXTVYOCtZgTvQ+7/PqbjKrwkI3wposQtJrIDDgtzt7P20oPqSljqQ JuwA== 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:dkim-signature; bh=XatBdf6kvwVA+XoD7v6XgWyLVTuT1t7NiBgGj7BPRz4=; b=UWOp5in09ZJ5qnushNMVINEp+b6jbJ4IAApptz9OrEKerWg3lnNfH8W4nsJPGc+Bd4 yst9Gd14c5uwB6SZk8YazO4hWVmPAf35UmEIKnj7R10J1WKURqOS2yVdeq2EgiXtuYko QdslRYW/CnxbzpdUnLK88MZw8Rj/sCb06CL0c2ROobUBF834dXYPlZWVInIFlnpAhFBU JqZFxnB/OLm/8TMUlusvnetzF/5yGOi2keVYPGOGtBiFXcMYRLBpSiFu30nKslBIFSz2 OdqiMCsMvluTjQB9Ja6yR2CyPHvo6iVkiggYjwLskXRchaMeiPQUT6iqr16fLDwD/Cek mAOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=fVfKmjXs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e2si1939586jaa.68.2021.09.09.08.06.31; Thu, 09 Sep 2021 08:07:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=fVfKmjXs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236687AbhIIPGi (ORCPT + 99 others); Thu, 9 Sep 2021 11:06:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232656AbhIIPGh (ORCPT ); Thu, 9 Sep 2021 11:06:37 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFFF3C061575; Thu, 9 Sep 2021 08:05:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=XatBdf6kvwVA+XoD7v6XgWyLVTuT1t7NiBgGj7BPRz4=; b=fVfKmjXsBlDx/NmKPltkuBLD68 74R78+5rvHbUz+2liXm+xSAeny4dVvaSyJs6hGhvfe21kbTEYOtpZt4QuTkal1W/vn3RSlYOr22Oa XCm8R42DpeKvfgDCC/1Y2sSJPUkepf9knmd93wegg5wNwa67utvKFHvw1xCl6zhFsHi0cj4F1TVv6 RnEq4nAf3HxOG+4pZPLOP4LSMHkVL0hcNvx2VPw1Z7mVGe7LwWo4OQI5nUeH/5288XEPTTwDu5I+3 9xvSspaGoxFhDYO+pivk3SoSx8KycZ0wZdlQnAwl6Gch8RjVt73M8NQF+e54QCPli6hrbvYTtJ9X3 zot/pIog==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mOLal-00A8Cr-7E; Thu, 09 Sep 2021 15:04:23 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id D1E75300094; Thu, 9 Sep 2021 17:03:54 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BA39720D13711; Thu, 9 Sep 2021 17:03:54 +0200 (CEST) Date: Thu, 9 Sep 2021 17:03:54 +0200 From: Peter Zijlstra To: Huang Rui Cc: "Rafael J . Wysocki" , Viresh Kumar , Shuah Khan , Borislav Petkov , Ingo Molnar , linux-pm@vger.kernel.org, Deepak Sharma , Alex Deucher , Mario Limonciello , Nathan Fontenot , Jinzhou Su , Xiaojian Du , linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH 04/19] cpufreq: amd: introduce a new amd pstate driver to support future processors Message-ID: References: <20210908150001.3702552-1-ray.huang@amd.com> <20210908150001.3702552-5-ray.huang@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210908150001.3702552-5-ray.huang@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 08, 2021 at 10:59:46PM +0800, Huang Rui wrote: > +static int pstate_init_perf(struct amd_cpudata *cpudata) > +{ > + u64 cap1; > + > + int ret = rdmsrl_safe_on_cpu(cpudata->cpu, MSR_AMD_CPPC_CAP1, > + &cap1); > + if (ret) > + return ret; > + > + /* Some AMD processors has specific power features that the cppc entry > + * doesn't indicate the highest performance. It will introduce the > + * feature in following days. > + */ Wrong comment style; also imagine reading this comment half a year from now... > + WRITE_ONCE(cpudata->highest_perf, amd_get_highest_perf()); > + > + WRITE_ONCE(cpudata->nominal_perf, CAP1_NOMINAL_PERF(cap1)); > + WRITE_ONCE(cpudata->lowest_nonlinear_perf, CAP1_LOWNONLIN_PERF(cap1)); > + WRITE_ONCE(cpudata->lowest_perf, CAP1_LOWEST_PERF(cap1)); > + > + return 0; > +}