From patchwork Thu Sep 3 15:36:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Jenkins X-Patchwork-Id: 45388 X-Patchwork-Delegate: lenb@kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n83Fb3IG004632 for ; Thu, 3 Sep 2009 15:37:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753328AbZICPg7 (ORCPT ); Thu, 3 Sep 2009 11:36:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755148AbZICPg7 (ORCPT ); Thu, 3 Sep 2009 11:36:59 -0400 Received: from mail-fx0-f217.google.com ([209.85.220.217]:54036 "EHLO mail-fx0-f217.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753328AbZICPg6 (ORCPT ); Thu, 3 Sep 2009 11:36:58 -0400 Received: by fxm17 with SMTP id 17so20248fxm.37 for ; Thu, 03 Sep 2009 08:37:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=6KVCYNq5AORa/WW146ttHoaSlj+64AhpTV+ISAdy8yw=; b=uJotvBaDoQAYoVGZU2PYIfxJtPxWi37tn7GcI3D+uXYiQldV+ueTcHYEs29POV6Wq2 VNrFW64fR1q9tSsIvT1i0Lbuu1KANESFdC4DpmW7JOsYmErlHpaLcGRJZEGKR/wL7GFk Vc1tJetR8L78r6TdRn+XtsXv0MlHkewoW1Keg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=JC8hVV52SnDPmhDSf0Dw54OHymkyedwU5F+ASx1UOZ8GeK3N4W8MEvYC55zy4volg+ vuvyixjHCMSfEicrQ7U+Tr7PMKkj+oWXgGcYe+tmsgR4m3YwGuoYzs8KwXVRAOXhbvfg Gu6ky1ulyiOwrqv2/95drWYjifmUykk9HfGwI= Received: by 10.103.50.32 with SMTP id c32mr4240367muk.1.1251992219697; Thu, 03 Sep 2009 08:36:59 -0700 (PDT) Received: from ?192.168.0.5? ([86.53.68.233]) by mx.google.com with ESMTPS id y2sm93066mug.3.2009.09.03.08.36.58 (version=SSLv3 cipher=RC4-MD5); Thu, 03 Sep 2009 08:36:59 -0700 (PDT) Message-ID: <4A9FE298.4050303@tuffmail.co.uk> Date: Thu, 03 Sep 2009 16:36:56 +0100 From: Alan Jenkins User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: Alexey Starikovskiy CC: linux acpi Subject: ACPI: EC: wait for ongoing transactions before suspending Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org If a transaction is started just before suspend we should wait for it before disabling the GPE. Otherwise the GPE could be re-enabled by the "disable gpe during transactions" workaround (EC_FLAGS_GPE_STORM). I hope this also solves EC timeouts and resume hangs when pressing acpi hotkeys during hibernation. However this problem is difficult to reproduce and I have not been able to confirm the fix. References: http://bugzilla.kernel.org/show_bug.cgi?id=14112 Signed-off-by: Alan Jenkins --- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 64a20ef..6fd1be2 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -979,7 +979,9 @@ static int acpi_ec_suspend(struct acpi_device *device, pm_message_t state) { struct acpi_ec *ec = acpi_driver_data(device); /* Stop using GPE */ + mutex_lock(&ec->lock); acpi_disable_gpe(NULL, ec->gpe); + mutex_unlock(&ec->lock); return 0; }