add patch 0011-ps3stor-send-cmd-timeout.patch
[ps3linux_kernel_patches_314.git] / 0011-ps3stor-send-cmd-timeout.patch
blobc6f986cbbfd3039a9c6858c93ee73570f15f327b
1 --- a/drivers/ps3/ps3stor_lib.c 2014-05-29 12:57:04.121254704 +0200
2 +++ b/drivers/ps3/ps3stor_lib.c 2014-05-29 12:57:27.407922725 +0200
3 @@ -342,8 +342,13 @@
4 return -1;
7 - wait_for_completion(&dev->done);
8 - if (dev->lv1_status) {
9 + res = wait_for_completion_timeout(&dev->done, msecs_to_jiffies(2000));
10 + if (res == 0) {
11 + dev_err(&dev->sbd.core,
12 + "%s:%u: send_device_command 0x%llx timed out\n",
13 + __func__, __LINE__, cmd);
14 + return -1;
15 + } else if (dev->lv1_status) {
16 dev_dbg(&dev->sbd.core, "%s:%u: command 0x%llx failed 0x%llx\n",
17 __func__, __LINE__, cmd, dev->lv1_status);
18 return dev->lv1_status;