From patchwork Tue Apr 27 21:10:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Starikovskiy X-Patchwork-Id: 95503 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3RLC7pf016962 for ; Tue, 27 Apr 2010 21:12:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756921Ab0D0VKb (ORCPT ); Tue, 27 Apr 2010 17:10:31 -0400 Received: from nat.nue.novell.com ([195.135.221.3]:51682 "EHLO emea5-mh.id5.novell.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756941Ab0D0VK2 (ORCPT ); Tue, 27 Apr 2010 17:10:28 -0400 Received: from [127.0.1.1] ([149.44.162.75]) by emea5-mh.id5.novell.com with ESMTP; Tue, 27 Apr 2010 23:10:26 +0200 Subject: [RFC][PATCH] Subject: [ACPI] Add constraints on usage of ACPI Sleep function To: Len Brown From: Alexey Starikovskiy Cc: Linux-acpi@vger.kernel.org Date: Wed, 28 Apr 2010 01:10:27 +0400 Message-ID: <20100427211027.18890.78034.stgit@thinkpad> User-Agent: StGit/0.15 MIME-Version: 1.0 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 (demeter.kernel.org [140.211.167.41]); Tue, 27 Apr 2010 21:12:07 +0000 (UTC) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 7594f65..7a58dc5 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -438,7 +438,14 @@ acpi_status acpi_os_remove_interrupt_handler(u32 irq, acpi_osd_handler handler) void acpi_os_sleep(u64 ms) { - schedule_timeout_interruptible(msecs_to_jiffies(ms)); + if (ms > 1000) { + printk(KERN_WARNING "ACPI: Limit long sleep to 1 second\n"); + ms = 1000; + } + if (system_state == SYSTEM_RUNNING) + schedule_timeout_interruptible(msecs_to_jiffies(ms)); + else + acpi_os_stall(ms * 1000); } void acpi_os_stall(u32 us)