Re: [ibm-acpi-devel] [PATCH] thinkpad-acpi: fix potential suspend blocking issue

2013-03-06 Thread Maciej Rutecki
On wtorek, 5 marca 2013 o 18:34:43 Mandeep Singh Baines wrote: > Fixes the following lockdep error: > > [ BUG: ktpacpi_nvramd/446 still has locks held! ] > > hotkey_kthread() calls set_freezable() after acquiring the > hotkey_kthread_mutex(). set_freezable() calls try_to_freeze(). > This could bl

Re: [ibm-acpi-devel] [PATCH] thinkpad-acpi: fix potential suspend blocking issue

2013-03-06 Thread Oleg Nesterov
On 03/05, Andrew Morton wrote: > > Basically the same as > http://ozlabs.org/~akpm/mmots/broken-out/drivers-platform-x86-thinkpad_acpic-move-hotkey_thread_mutex-lock-after-set_freezable.patch. > I think Artem's patch is a little better. There doesn't appear to be > any locking protocol for tpacpi

Re: [ibm-acpi-devel] [PATCH] thinkpad-acpi: fix potential suspend blocking issue

2013-03-06 Thread Artem Savkov
On Wed, Mar 06, 2013 at 04:50:39PM +0100, Oleg Nesterov wrote: > On 03/05, Andrew Morton wrote: > > > > Basically the same as > > http://ozlabs.org/~akpm/mmots/broken-out/drivers-platform-x86-thinkpad_acpic-move-hotkey_thread_mutex-lock-after-set_freezable.patch. > > I think Artem's patch is a lit

Re: [ibm-acpi-devel] [PATCH] thinkpad-acpi: fix potential suspend blocking issue

2013-03-06 Thread Mandeep Singh Baines
On Tue, Mar 5, 2013 at 10:05 AM, Oleg Nesterov wrote: > On 03/05, Mandeep Singh Baines wrote: >> >> On Tue, Mar 5, 2013 at 9:48 AM, Oleg Nesterov wrote: >> > On 03/05, Mandeep Singh Baines wrote: >> >> >> >> @@ -2462,13 +2462,13 @@ static int hotkey_kthread(void *data) >> >> unsigned int po

Re: [ibm-acpi-devel] [PATCH] thinkpad-acpi: fix potential suspend blocking issue

2013-03-06 Thread Mandeep Singh Baines
On Tue, Mar 5, 2013 at 9:48 AM, Oleg Nesterov wrote: > On 03/05, Mandeep Singh Baines wrote: >> >> @@ -2462,13 +2462,13 @@ static int hotkey_kthread(void *data) >> unsigned int poll_freq; >> bool was_frozen; >> >> + set_freezable(); >> + >> mutex_lock(&hotkey_thread_mutex); >

Re: [ibm-acpi-devel] [PATCH] thinkpad-acpi: fix potential suspend blocking issue

2013-03-06 Thread Oleg Nesterov
On 03/05, Mandeep Singh Baines wrote: > > On Tue, Mar 5, 2013 at 9:48 AM, Oleg Nesterov wrote: > > On 03/05, Mandeep Singh Baines wrote: > >> > >> @@ -2462,13 +2462,13 @@ static int hotkey_kthread(void *data) > >> unsigned int poll_freq; > >> bool was_frozen; > >> > >> + set_freeza

Re: [ibm-acpi-devel] [PATCH] thinkpad-acpi: fix potential suspend blocking issue

2013-03-06 Thread Oleg Nesterov
On 03/05, Mandeep Singh Baines wrote: > > @@ -2462,13 +2462,13 @@ static int hotkey_kthread(void *data) > unsigned int poll_freq; > bool was_frozen; > > + set_freezable(); > + > mutex_lock(&hotkey_thread_mutex); > > if (tpacpi_lifecycle == TPACPI_LIFE_EXITING) >

[ibm-acpi-devel] [PATCH] thinkpad-acpi: fix potential suspend blocking issue

2013-03-06 Thread Mandeep Singh Baines
Fixes the following lockdep error: [ BUG: ktpacpi_nvramd/446 still has locks held! ] hotkey_kthread() calls set_freezable() after acquiring the hotkey_kthread_mutex(). set_freezable() calls try_to_freeze(). This could block suspend if we were to freeze at this point and another task were to block

Re: [ibm-acpi-devel] [PATCH] thinkpad-acpi: fix potential suspend blocking issue

2013-03-06 Thread Oleg Nesterov
On 03/05, Henrique de Moraes Holschuh wrote: > > On Tue, 05 Mar 2013, Mandeep Singh Baines wrote: > > This mutex seems wrong. Its held the entire time the kthread is > > running. I think its used to synchronize on the exit of the kthread. A > > completion would more appropriate in that case. > > Fr

Re: [ibm-acpi-devel] [PATCH] thinkpad-acpi: fix potential suspend blocking issue

2013-03-06 Thread Henrique de Moraes Holschuh
On Wed, 06 Mar 2013, Oleg Nesterov wrote: > On 03/05, Henrique de Moraes Holschuh wrote: > > On Tue, 05 Mar 2013, Mandeep Singh Baines wrote: > > > This mutex seems wrong. Its held the entire time the kthread is > > > running. I think its used to synchronize on the exit of the kthread. A > > > comp

Re: [ibm-acpi-devel] [PATCH] thinkpad-acpi: fix potential suspend blocking issue

2013-03-05 Thread Henrique de Moraes Holschuh
On Tue, 05 Mar 2013, Mandeep Singh Baines wrote: > This mutex seems wrong. Its held the entire time the kthread is > running. I think its used to synchronize on the exit of the kthread. A > completion would more appropriate in that case. >From the top of the driver source: /* Acquired while the p

Re: [ibm-acpi-devel] [PATCH] thinkpad-acpi: fix potential suspend blocking issue

2013-03-05 Thread Andrew Morton
On Tue, 5 Mar 2013 09:34:43 -0800 Mandeep Singh Baines wrote: > Fixes the following lockdep error: > > [ BUG: ktpacpi_nvramd/446 still has locks held! ] > > hotkey_kthread() calls set_freezable() after acquiring the > hotkey_kthread_mutex(). set_freezable() calls try_to_freeze(). > This could