From patchwork Fri Aug 22 07:37:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lan,Tianyu" X-Patchwork-Id: 4761431 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B62289F344 for ; Fri, 22 Aug 2014 07:38:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC9B1201B4 for ; Fri, 22 Aug 2014 07:38:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1DDCC2018A for ; Fri, 22 Aug 2014 07:38:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755873AbaHVHiK (ORCPT ); Fri, 22 Aug 2014 03:38:10 -0400 Received: from mga01.intel.com ([192.55.52.88]:64021 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755844AbaHVHiK (ORCPT ); Fri, 22 Aug 2014 03:38:10 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 22 Aug 2014 00:38:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,378,1406617200"; d="scan'208";a="588403236" Received: from tlan1-mobl3.sh.intel.com (HELO localhost) ([10.239.192.242]) by fmsmga002.fm.intel.com with ESMTP; 22 Aug 2014 00:38:08 -0700 From: Lan Tianyu To: rjw@rjwysocki.net, lenb@kernel.org, bebl@mageta.org, davem@davemloft.net Cc: Lan Tianyu , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ACPI: Run fixed button devices' notify callback in the process context Date: Fri, 22 Aug 2014 15:37:55 +0800 Message-Id: <1408693091-16268-1-git-send-email-tianyu.lan@intel.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently fixed button devices' notify callbacks are running in the interrupt context. It's not necessary and prevent calling functions with mutex lock(E,G evaluating ACPI method). Otherwise, it's different with non-fixed button device whose notify callback is running in the process context. This patch is to make fixed button device's notify callback in the process context and this also can avoid dead lock when using netlink to report button event to user space. Signed-off-by: Lan Tianyu --- drivers/acpi/scan.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 0a817ad..bfb7fc5 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -922,12 +922,17 @@ static void acpi_device_notify(acpi_handle handle, u32 event, void *data) device->driver->ops.notify(device, event); } -static acpi_status acpi_device_notify_fixed(void *data) +static void acpi_device_notify_fixed_run(void *data) { struct acpi_device *device = data; - /* Fixed hardware devices have no handles */ acpi_device_notify(NULL, ACPI_FIXED_HARDWARE_EVENT, device); +} + +static acpi_status acpi_device_notify_fixed(void *data) +{ + /* Fixed hardware devices have no handles */ + acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_device_notify_fixed_run, data); return AE_OK; }