Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8948630rwr; Thu, 11 May 2023 08:08:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7eLLlTk5CXdLV6+LguRjjyCNZXtj3ztKFbhwss5cN5M1abkl7EZCOYAVHDIbsiB/IXmsfR X-Received: by 2002:a05:6a20:1584:b0:101:e4f3:5336 with SMTP id h4-20020a056a20158400b00101e4f35336mr10094180pzj.27.1683817723368; Thu, 11 May 2023 08:08:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683817723; cv=none; d=google.com; s=arc-20160816; b=rZjwgpeJntSz+jML3TbeiQBV8ewlSThelPVp2+H6OVXISluwyO38vsOq+cZFWlHcPA drxOuB7a7W+WqMgSnJihJlStBqfydy/s7T+khWTsO2CQQAOZfDJMhX9eUhPXM7tmAKVi aMkX14rRGCnap2rF7gH09eggu/X4k5Q+SBndQ25JNlgqqlY7Y5UgO16kTuCn2DVGoqAM ZeT5v70zdWRz4gcNmPPn1xp+xg0Hr8Liw5Eq55muBWVWMYIADbE4Z77WYsql1Ye+Yz12 0QpEw/iH+9/9ecl3Qo2oeEksG8JoI5otYd+NXYjqgBOybx72Kru9vQaAdwPy+Qfwf6/Y zMbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=7f2euWZSuMJiT3Als7vFwpiYKZL6XvPa6JvXpo7YgM4=; b=hg0hNduSWAPqqP3aq54TpCwMTXaJ7N8Gv7iJZpTCTt6gTZo9nTEoGUI1i7lGPLZaQD fnCULfq5IcmsnxjoRdFwMK+TdzSureMULmSTs19vcvuDLBhYWPWtkib6a7/BS7pU4Yiv xb2aH7ZAHdZK2dV91A/XxZ1TQxlR0Pa6OvBXkkK7tiYdhZZsnU7OB2L7qUYAJSvU48qB c5c84GhoxE+Ox6/89jpoXQX1AnqpkdiKYmSi25UvfmsIFkvvkyCvbUT4K+4iiWS+fz/I kHrVHtOgXsbT2XL0CpH7sDKLMKhae5AvBHvFHGUotV3lwo7R5Ow7Y6OHyfpioBheULPc OnBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ya6oXwD5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s204-20020a632cd5000000b0051b618ec7d0si6736094pgs.617.2023.05.11.08.08.27; Thu, 11 May 2023 08:08:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ya6oXwD5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237973AbjEKO6c (ORCPT + 99 others); Thu, 11 May 2023 10:58:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238061AbjEKO6Y (ORCPT ); Thu, 11 May 2023 10:58:24 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C46C7187; Thu, 11 May 2023 07:58:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683817085; x=1715353085; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=xcC/Z7/5lJtWD+qFNw7HuvRGj7Z3+YU6H3jp61sb/YM=; b=Ya6oXwD58t1H3K5YteiL8bjeHUlZhazUwtsjY+ACTk612ujrz0zmU/Ft +nBM+yApIGQ8i4l6Gx9XAK6ufNrL6URbKGHjbkurmAO0TZzTQ56aGNEG3 YygphnxXfKJnWh0twfoUh/MhINdKQj3Gdw7dJ1OA3mEn0ORAg3gPKltqX ZxD9Ugz05/TiEDMD6HeBWJF72lOePKgGqQnkBxCeBTzM6QNnh30yx2U+N /r4UO7DG6vLTCIBCbw2W86tGh2CN3aFVtcNl+60X0RbMeYOPFP2RsGcuC FZDswAv33Th3PevAzJOUOet+0M6o/OMmcgXGZXL/IPSIvyAhfLcSUvZhx A==; X-IronPort-AV: E=McAfee;i="6600,9927,10707"; a="436854022" X-IronPort-AV: E=Sophos;i="5.99,266,1677571200"; d="scan'208";a="436854022" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2023 07:55:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10707"; a="650220286" X-IronPort-AV: E=Sophos;i="5.99,266,1677571200"; d="scan'208";a="650220286" Received: from ambujamp-mobl1.amr.corp.intel.com (HELO [10.212.238.119]) ([10.212.238.119]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2023 07:55:09 -0700 Message-ID: <28ead36b-2d9e-1a36-6f4e-04684e420260@intel.com> Date: Thu, 11 May 2023 07:55:08 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] powercap: RAPL: Add Power Limit4 support for Meteor Lake SoC Content-Language: en-US To: Sumeet Pawnikar , rafael@kernel.org, srinivas.pandruvada@linux.intel.com, rui.zhang@intel.com, linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org References: <20230215123249.4473-1-sumeet.r.pawnikar@intel.com> From: Dave Hansen In-Reply-To: <20230215123249.4473-1-sumeet.r.pawnikar@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/15/23 04:32, Sumeet Pawnikar wrote: > diff --git a/drivers/powercap/intel_rapl_msr.c b/drivers/powercap/intel_rapl_msr.c > index bc6adda58883..a27673706c3d 100644 > --- a/drivers/powercap/intel_rapl_msr.c > +++ b/drivers/powercap/intel_rapl_msr.c > @@ -143,6 +143,8 @@ static const struct x86_cpu_id pl4_support_ids[] = { > { X86_VENDOR_INTEL, 6, INTEL_FAM6_ALDERLAKE_N, X86_FEATURE_ANY }, > { X86_VENDOR_INTEL, 6, INTEL_FAM6_RAPTORLAKE, X86_FEATURE_ANY }, > { X86_VENDOR_INTEL, 6, INTEL_FAM6_RAPTORLAKE_P, X86_FEATURE_ANY }, > + { X86_VENDOR_INTEL, 6, INTEL_FAM6_METEORLAKE, X86_FEATURE_ANY }, > + { X86_VENDOR_INTEL, 6, INTEL_FAM6_METEORLAKE_L, X86_FEATURE_ANY }, > {} > }; Sumeet, could you _please_ go take a close look at 'struct x86_cpu_id'? > struct x86_cpu_id { > __u16 vendor; > __u16 family; > __u16 model; > __u16 steppings; > __u16 feature; /* bit index */ > kernel_ulong_t driver_data; > }; You might also want to very carefully count the fields in the structure. Which field is being initialized to X86_FEATURE_ANY? Is it: a. ->feature b. ->steppings c. ->model How could this _possibly_ work, you ask yourself? Well, you lucked out: #define X86_FAMILY_ANY 0 #define X86_MODEL_ANY 0 #define X86_STEPPING_ANY 0 #define X86_FEATURE_ANY 0 so, you actually accidentally *explicitly* specified a 0 for ->steppings *AND* accidentally *implicitly* specified a 0 for ->feature. ... and you did this in at least five separate commits over four years. Why does this matter? Because some hapless maintainer might take your code, copy it, and then s/X86_FEATURE_ANY/X86_FEATURE_FOO/ and then scratch their head for an hour as to why it doesn't work. Could you please fix this up? As penance, you could even fix the _ANY defines so that people can't do this accidentally any longer.