Message ID | 1408693091-16268-1-git-send-email-tianyu.lan@intel.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
On 08/22/2014 03:37 PM, Lan Tianyu wrote: > 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. > Hi David: Could you try this patch on your machine? So far, I don't have fixed button machine on the hand. > 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; > } > > -- 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
On Friday, August 22, 2014 03:37:55 PM Lan Tianyu wrote: > 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. I guess this is the main reason for the patch? Is there a bug report regarding this? > 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; > } > >
On 08/22/2014 07:33 PM, Rafael J. Wysocki wrote: > On Friday, August 22, 2014 03:37:55 PM Lan Tianyu wrote: >> 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. > > I guess this is the main reason for the patch? > > Is there a bug report regarding this? > There is: https://lkml.org/lkml/2014/8/21/606 > >> 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; >> } >> >> >
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; }
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(-)