From patchwork Mon Apr 1 15:03:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 10880149 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7266C139A for ; Mon, 1 Apr 2019 15:03:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A54828785 for ; Mon, 1 Apr 2019 15:03:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E6CF2878F; Mon, 1 Apr 2019 15:03:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E719228785 for ; Mon, 1 Apr 2019 15:03:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726637AbfDAPDv (ORCPT ); Mon, 1 Apr 2019 11:03:51 -0400 Received: from mail.skyhub.de ([5.9.137.197]:58120 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbfDAPDv (ORCPT ); Mon, 1 Apr 2019 11:03:51 -0400 Received: from zn.tnic (p200300EC2F148A00329C23FFFEA6A903.dip0.t-ipconnect.de [IPv6:2003:ec:2f14:8a00:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 4F4091EC0354; Mon, 1 Apr 2019 17:03:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1554131029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=ID4grBT9wHWRYXPPSwvRThRgD8ziDtniErq38bMC/B4=; b=Sownw1wDqHwxMCtpDZ/JpBApBrufD5+r2Xoo47aMyHExqGyDE207xkBQbL9C6wNBTbbqh9 xCLeAWnzyQApZXOWOUu9Ei6d3Ifw0vIpWcVmNlrW6R7bE8tN9BXofhqYu3iE/0nMmir3t0 n7dM2Qd6vAvqb+RqdAu0yvWgtxzq/nc= Date: Mon, 1 Apr 2019 17:03:45 +0200 From: Borislav Petkov To: Erwan Velu Cc: LKML , Len Brown , "linux-pm@vger.kernel.org" , "Rafael J . Wysocki" , Srinivas Pandruvada , Viresh Kumar Subject: [PATCH] cpufreq/intel_pstate: Load only on Intel hardware Message-ID: <20190401150345.GJ28264@zn.tnic> References: <20190330100225.14744-1-bp@alien8.de> <20190401083902.GC28264@zn.tnic> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190401083902.GC28264@zn.tnic> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Borislav Petkov This driver is Intel-only so loading on anything which is not Intel is pointless. Prevent it from doing so. While at it, correct the "not supported" print statement to say CPU "model" which is what that test does. Suggested-by: Erwan Velu Signed-off-by: Borislav Petkov Cc: Len Brown Cc: linux-pm@vger.kernel.org Cc: Rafael J. Wysocki CC: Srinivas Pandruvada Cc: Viresh Kumar Reviewed-by: Thomas Renninger --- drivers/cpufreq/intel_pstate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index b599c7318aab..2986119dd31f 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -2596,6 +2596,9 @@ static int __init intel_pstate_init(void) const struct x86_cpu_id *id; int rc; + if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) + return -ENODEV; + if (no_load) return -ENODEV; @@ -2611,7 +2614,7 @@ static int __init intel_pstate_init(void) } else { id = x86_match_cpu(intel_pstate_cpu_ids); if (!id) { - pr_info("CPU ID not supported\n"); + pr_info("CPU model not supported\n"); return -ENODEV; }