Re: [PATCH v2 2/3] firmware loader: fix hung task warning dump

2014-11-08 Thread Greg Kroah-Hartman
On Mon, Nov 03, 2014 at 11:07:09AM +0800, Kweh Hock Leong wrote:
> From: "Kweh, Hock Leong" 
> 
> When using request_firmware_nowait() with FW_ACTION_NOHOTPLUG param to
> expose user helper interface, if the user do not react immediately, after
> 120 seconds there will be a hung task warning message dumped as below:
> 
> [ 3000.784235] INFO: task kworker/0:0:8259 blocked for more than 120 seconds.
> [ 3000.791281]   Tainted: GE 3.16.0-rc1-yocto-standard #41
> [ 3000.798082] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables 
> this message.
> [ 3000.806072] kworker/0:0 D cd0075c8 0  8259  2 0x
> [ 3000.812765] Workqueue: events request_firmware_work_func
> [ 3000.818253]  cd375e18 0046 000e cd0075c8 00f0 cd40ea00 
> cd375fec 1b883e89
> [ 3000.826374]  026b cd40ea00 8000 0001 cd0075c8  
> cd375de4 c119917f
> [ 3000.834492]  cd563360 cd375df4 c119a0ab cd563360  cd375e24 
> c119a1d6 
> [ 3000.842616] Call Trace:
> [ 3000.845252]  [] ? kernfs_next_descendant_post+0x3f/0x50
> [ 3000.851543]  [] ? kernfs_activate+0x6b/0xc0
> [ 3000.856790]  [] ? kernfs_add_one+0xd6/0x130
> [ 3000.862047]  [] schedule+0x22/0x60
> [ 3000.866548]  [] schedule_timeout+0x175/0x1d0
> [ 3000.871887]  [] ? __kernfs_create_file+0x71/0xa0
> [ 3000.877574]  [] ? sysfs_add_file_mode_ns+0xaa/0x180
> [ 3000.883533]  [] wait_for_completion+0x6f/0xb0
> [ 3000.888961]  [] ? wake_up_process+0x40/0x40
> [ 3000.894219]  [] _request_firmware+0x750/0x9f0
> [ 3000.899666]  [] ? n_tty_receive_buf2+0x1f/0x30
> [ 3000.905200]  [] request_firmware_work_func+0x22/0x50
> [ 3000.911235]  [] process_one_work+0x122/0x380
> [ 3000.916571]  [] worker_thread+0xf9/0x470
> [ 3000.921555]  [] ? create_and_start_worker+0x50/0x50
> [ 3000.927497]  [] ? create_and_start_worker+0x50/0x50
> [ 3000.933448]  [] kthread+0x9f/0xc0
> [ 3000.937850]  [] ret_from_kernel_thread+0x20/0x30
> [ 3000.943548]  [] ? kthread_worker_fn+0x100/0x100
> 
> This patch change the wait_for_completion() function call to
> wait_for_completion_interruptible() function call for solving the issue.
> 
> Cc: Matt Fleming 
> Signed-off-by: Kweh, Hock Leong 

Acked-by: Greg Kroah-Hartman 
--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 2/3] firmware loader: fix hung task warning dump

2014-11-02 Thread Kweh Hock Leong
From: "Kweh, Hock Leong" 

When using request_firmware_nowait() with FW_ACTION_NOHOTPLUG param to
expose user helper interface, if the user do not react immediately, after
120 seconds there will be a hung task warning message dumped as below:

[ 3000.784235] INFO: task kworker/0:0:8259 blocked for more than 120 seconds.
[ 3000.791281]   Tainted: GE 3.16.0-rc1-yocto-standard #41
[ 3000.798082] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this 
message.
[ 3000.806072] kworker/0:0 D cd0075c8 0  8259  2 0x
[ 3000.812765] Workqueue: events request_firmware_work_func
[ 3000.818253]  cd375e18 0046 000e cd0075c8 00f0 cd40ea00 cd375fec 
1b883e89
[ 3000.826374]  026b cd40ea00 8000 0001 cd0075c8  cd375de4 
c119917f
[ 3000.834492]  cd563360 cd375df4 c119a0ab cd563360  cd375e24 c119a1d6 

[ 3000.842616] Call Trace:
[ 3000.845252]  [] ? kernfs_next_descendant_post+0x3f/0x50
[ 3000.851543]  [] ? kernfs_activate+0x6b/0xc0
[ 3000.856790]  [] ? kernfs_add_one+0xd6/0x130
[ 3000.862047]  [] schedule+0x22/0x60
[ 3000.866548]  [] schedule_timeout+0x175/0x1d0
[ 3000.871887]  [] ? __kernfs_create_file+0x71/0xa0
[ 3000.877574]  [] ? sysfs_add_file_mode_ns+0xaa/0x180
[ 3000.883533]  [] wait_for_completion+0x6f/0xb0
[ 3000.888961]  [] ? wake_up_process+0x40/0x40
[ 3000.894219]  [] _request_firmware+0x750/0x9f0
[ 3000.899666]  [] ? n_tty_receive_buf2+0x1f/0x30
[ 3000.905200]  [] request_firmware_work_func+0x22/0x50
[ 3000.911235]  [] process_one_work+0x122/0x380
[ 3000.916571]  [] worker_thread+0xf9/0x470
[ 3000.921555]  [] ? create_and_start_worker+0x50/0x50
[ 3000.927497]  [] ? create_and_start_worker+0x50/0x50
[ 3000.933448]  [] kthread+0x9f/0xc0
[ 3000.937850]  [] ret_from_kernel_thread+0x20/0x30
[ 3000.943548]  [] ? kthread_worker_fn+0x100/0x100

This patch change the wait_for_completion() function call to
wait_for_completion_interruptible() function call for solving the issue.

Cc: Matt Fleming 
Signed-off-by: Kweh, Hock Leong 
---
 drivers/base/firmware_class.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index a238a46..639eeff 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -908,7 +908,7 @@ static int _request_firmware_load(struct firmware_priv 
*fw_priv,
kobject_uevent(&fw_priv->dev.kobj, KOBJ_ADD);
}
 
-   wait_for_completion(&buf->completion);
+   retval = wait_for_completion_interruptible(&buf->completion);
 
cancel_delayed_work_sync(&fw_priv->timeout_work);
if (!buf->data)
@@ -985,7 +985,7 @@ static int sync_cached_firmware_buf(struct firmware_buf 
*buf)
break;
}
mutex_unlock(&fw_lock);
-   wait_for_completion(&buf->completion);
+   ret = wait_for_completion_interruptible(&buf->completion);
mutex_lock(&fw_lock);
}
mutex_unlock(&fw_lock);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html