public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI: Run fixed button devices' notify callback in the process context
@ 2014-08-22  7:37 Lan Tianyu
  2014-08-22  7:41 ` Lan Tianyu
  2014-08-22 17:33 ` Rafael J. Wysocki
  0 siblings, 2 replies; 5+ messages in thread
From: Lan Tianyu @ 2014-08-22  7:37 UTC (permalink / raw)
  To: rjw, lenb, bebl, davem; +Cc: Lan Tianyu, linux-acpi, linux-kernel

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 <tianyu.lan@intel.com>
---
 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;
 }
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-25 23:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-22  7:37 [PATCH] ACPI: Run fixed button devices' notify callback in the process context Lan Tianyu
2014-08-22  7:41 ` Lan Tianyu
2014-08-22 17:33 ` Rafael J. Wysocki
2014-08-22 17:59   ` Benjamin Block
2014-08-25 23:33     ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox