From patchwork Tue Nov 27 22:13:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafa? Bilski X-Patchwork-Id: 1812941 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 993A03FC54 for ; Tue, 27 Nov 2012 22:38:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753441Ab2K0Wiw (ORCPT ); Tue, 27 Nov 2012 17:38:52 -0500 Received: from smtpo.poczta.interia.pl ([217.74.65.205]:44706 "EHLO smtpo.poczta.interia.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753397Ab2K0Wiw (ORCPT ); Tue, 27 Nov 2012 17:38:52 -0500 X-Greylist: delayed 1485 seconds by postgrey-1.27 at vger.kernel.org; Tue, 27 Nov 2012 17:38:52 EST Received: from elke.localdomain (cpc30-shep11-2-0-cust9.8-3.cable.virginmedia.com [86.15.44.10]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by poczta.interia.pl (INTERIA.PL) with ESMTPSA; Tue, 27 Nov 2012 23:14:02 +0100 (CET) From: Rafal Bilski To: "Rafael J. Wysocki" Cc: cpufreq@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH] Longhaul: Disable driver by default Date: Tue, 27 Nov 2012 22:13:55 +0000 Message-Id: <1354054435-2459-1-git-send-email-rafalbilski@interia.pl> X-Mailer: git-send-email 1.8.0 X-Interia-Antivirus: OK DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=interia.pl; s=biztos; t=1354054444; bh=7Zcm7HoI0qgCv8UIn/hdPBMCE1ll46fm231sKuzr3ok=; h=Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer: X-Interia-Antivirus; b=F26m2PEo3ER8M3Emor2BdAFS9g+kxRU7Yqp4SZx0rs/3LG0JIG4LB/XJSx/JRkKTU l60O5AQtprPNOvVNRLSXsNY4pqJiHsFKsEJ+qqThV/DTsb7OxtR0e0c0U7Gs1PiXYv pEluiAm2eXKyz0lCoXLzlvmCPzFr4Gi6hgXdFd3k= Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This is only solution I can think of. User decides if he wants this driver on his machine. I don't have enough knowledge and time to find the reason why same code works on some machines and doesn't on others which use same, or very similar, chipset and processor. Signed-off-by: Rafal Bilski --- drivers/cpufreq/longhaul.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c index 53ddbc7..0bf5bd1 100644 --- a/drivers/cpufreq/longhaul.c +++ b/drivers/cpufreq/longhaul.c @@ -77,7 +77,7 @@ static unsigned int longhaul_index; static int scale_voltage; static int disable_acpi_c3; static int revid_errata; - +static int enable; /* Clock ratios multiplied by 10 */ static int mults[32]; @@ -965,6 +965,10 @@ static int __init longhaul_init(void) if (!x86_match_cpu(longhaul_id)) return -ENODEV; + if (!enable) { + printk(KERN_ERR PFX "Option \"enable\" not set. Aborting.\n"); + return -ENODEV; + } #ifdef CONFIG_SMP if (num_online_cpus() > 1) { printk(KERN_ERR PFX "More than 1 CPU detected, " @@ -1021,6 +1025,10 @@ MODULE_PARM_DESC(scale_voltage, "Scale voltage of processor"); * such. */ module_param(revid_errata, int, 0644); MODULE_PARM_DESC(revid_errata, "Ignore CPU Revision ID"); +/* By default driver is disabled to prevent incompatible + * system freeze. */ +module_param(enable, int, 0644); +MODULE_PARM_DESC(enable, "Enable driver"); MODULE_AUTHOR("Dave Jones "); MODULE_DESCRIPTION("Longhaul driver for VIA Cyrix processors.");