From patchwork Thu Oct 21 16:24:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Renninger X-Patchwork-Id: 271661 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9LGP1ri003549 for ; Thu, 21 Oct 2010 16:25:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751011Ab0JUQZA (ORCPT ); Thu, 21 Oct 2010 12:25:00 -0400 Received: from cantor2.suse.de ([195.135.220.15]:56558 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750990Ab0JUQZA (ORCPT ); Thu, 21 Oct 2010 12:25:00 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 1A53A890B6; Thu, 21 Oct 2010 18:24:59 +0200 (CEST) From: Thomas Renninger Organization: SUSE Products GmbH To: Len Brown Subject: [PATCH] ACPI: Make Embedded Controller command timeout delay configurable Date: Thu, 21 Oct 2010 18:24:57 +0200 User-Agent: KMail/1.13.3 (Linux/2.6.31.5-0.1-desktop; KDE/4.4.3; x86_64; ; ) Cc: rjw@sisk.pl, linux-acpi@vger.kernel.org MIME-Version: 1.0 Message-Id: <201010211824.57893.trenn@suse.de> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 21 Oct 2010 16:25:03 +0000 (UTC) diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index f31291b..6499cc4 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -83,6 +83,11 @@ enum { EC_FLAGS_BLOCKED, /* Transactions are blocked */ }; +/* ec.c is compiled in acpi namespace so this shows up as acpi.ec_delay param */ +static unsigned int ec_delay __read_mostly = ACPI_EC_DELAY; +module_param(ec_delay, uint, 0644); +MODULE_PARM_DESC(ec_delay, "Timeout(ms) waited until an EC command completes"); + /* If we find an EC via the ECDT, we need to keep a ptr to its context */ /* External interfaces use first EC only, so remember */ typedef int (*acpi_ec_query_func) (void *data); @@ -210,7 +215,7 @@ static int ec_poll(struct acpi_ec *ec) int repeat = 2; /* number of command restarts */ while (repeat--) { unsigned long delay = jiffies + - msecs_to_jiffies(ACPI_EC_DELAY); + msecs_to_jiffies(ec_delay); do { /* don't sleep with disabled interrupts */ if (EC_FLAGS_MSI || irqs_disabled()) { @@ -265,7 +270,7 @@ static int ec_check_ibf0(struct acpi_ec *ec) static int ec_wait_ibf0(struct acpi_ec *ec) { - unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY); + unsigned long delay = jiffies + msecs_to_jiffies(ec_delay); /* interrupt wait manually if GPE mode is not active */ while (time_before(jiffies, delay)) if (wait_event_timeout(ec->wait, ec_check_ibf0(ec),