Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2801800ybv; Sat, 15 Feb 2020 03:58:53 -0800 (PST) X-Google-Smtp-Source: APXvYqzkJOwZK9hzpy8p3gsxwj/MkPXToYtsmHe0T3+8nKhM5jFI8VeD/x6d0j7vWKrue2BHS7eb X-Received: by 2002:a9d:4f02:: with SMTP id d2mr5484574otl.368.1581767933309; Sat, 15 Feb 2020 03:58:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581767933; cv=none; d=google.com; s=arc-20160816; b=s6mKgyFW9QYCPNKLq0dAnEP3WqN1c1k5kCugL01TWjYyWIxJG2zsw7MZkKCwH/3T0j BVtL5Z7k5vdYE5wqRjAKjSR2/xdGgBLlvj5dELruFfYe+rWrdNvha1IAcHBPQ2Wokg6+ GnPfC8qG6f5wuQHa35IgdZ0b7rsTqoeFqvl3+obtlw255YDF5ubdg1SaJIX4RGYmvoNx GVPHj1Gvfpn5cJkT79oeNr9hQaRaXpkt+yq1OVMvX6p+s9TEygHl7hq6hFf471qfCtd/ ivjUBvlUiPr866yWBZbJ0R3LoAEJKEPuAAkc6JrH1D0PE8xYseSdNu2RnzjEG2RZgnlG IMAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=m4xxgxm4743KXr5hDXhYlvcrcoeJT2Pq9hTSBSclVPE=; b=Q0booAzuoTUN3/TvSnZi9I+IcEDTd6rwyEVTS8skQn21xAxtmDDZG38xDLFqsbWTc5 VGNkWRz9Z9woxGxIRN1Jkq3Buw8pR9/523AB2GVrUSan4hpAUkF0iiyZgsnnb+/vrbpT dMSECIXS8o3fS5ViTFuovMBkyrrvTjO2oT5wVg7H6O3A67kn0KS4AFIlF1AxboR/1/Yr Xj5b58dSELr4msHPiVVkbKo6Uq37vnQdHARrjGmbWyVEGtDgivLNWqpjuOlYjyzrl1Pf wpi5ZrfaeXB2WXnOj8UO6txbXB7jRBFOsd1z+Mg/OINgu95e6WZ8XIVA62+LLV6nH75d Nluw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o18si4526262otk.80.2020.02.15.03.58.40; Sat, 15 Feb 2020 03:58:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726243AbgBOL6f (ORCPT + 99 others); Sat, 15 Feb 2020 06:58:35 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:57140 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726143AbgBOL6e (ORCPT ); Sat, 15 Feb 2020 06:58:34 -0500 Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1j2w5T-0007Jk-Vv; Sat, 15 Feb 2020 12:58:20 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 61C33101161; Sat, 15 Feb 2020 12:58:19 +0100 (CET) From: Thomas Gleixner To: Alexander Koskovich , arjan@linux.intel.com, jacob.jun.pan@linux.intel.com Cc: zvnexus@gmail.com, Alexander Koskovich , Zhang Rui , Daniel Lezcano , Amit Kucheria , Greg Kroah-Hartman , Luc Van Oostenryck , Petr Mladek , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] thermal/intel_powerclamp: Don't report an error for AMD CPUs In-Reply-To: <20200215160938.1025-1-zvnexus@outlook.com> References: <20200215160938.1025-1-zvnexus@outlook.com> Date: Sat, 15 Feb 2020 12:58:19 +0100 Message-ID: <87wo8orrj8.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexander Koskovich writes: > Resolves dmesg error "intel_powerclamp: CPU does not support MWAIT". > > The error that is outputted in dmesg prior to this patch > is innacurate, AMD Ryzen CPUs do support MWAIT. We could > also add the AMD vendor to the MWAIT check, but even though > AMD CPUs do support MWAIT, they fail the C-state package > check so it's better just to bail out in the beginning. > > Signed-off-by: Alexander Koskovich > --- > drivers/thermal/intel/intel_powerclamp.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c > index 53216dcbe173..3c5b25bfa596 100644 > --- a/drivers/thermal/intel/intel_powerclamp.c > +++ b/drivers/thermal/intel/intel_powerclamp.c > @@ -650,6 +650,11 @@ static struct thermal_cooling_device_ops powerclamp_cooling_ops = { > .set_cur_state = powerclamp_set_cur_state, > }; > > +static const struct x86_cpu_id amd_cpu[] = { > + { X86_VENDOR_AMD }, > + {}, > +}; > + > static const struct x86_cpu_id __initconst intel_powerclamp_ids[] = { > { X86_VENDOR_INTEL, X86_FAMILY_ANY, X86_MODEL_ANY, X86_FEATURE_MWAIT }, > {} > @@ -659,6 +664,11 @@ MODULE_DEVICE_TABLE(x86cpu, intel_powerclamp_ids); > static int __init powerclamp_probe(void) > { > > + if (x86_match_cpu(amd_cpu)) { > + pr_info("Intel PowerClamp does not support AMD CPUs\n"); > + return -ENODEV; This is still running into the same problem on all other non Intel vendors, e.g. HYGON, VIA .... > + } > + > if (!x86_match_cpu(intel_powerclamp_ids)) { > pr_err("CPU does not support MWAIT\n"); > return -ENODEV; The right thing to do is to remove this silly pr_err(). It's not an error when a CPU does not support MWAIT. It's a fact and even older Intel CPUs do not have MWAIT. We do not print "Machine does not have $FEATURE" in device drivers and whatever code which depends on runtime detection either. dmesg would be full of this. Thanks, tglx