mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
nvidia: timed out wait for userspace response
Using this patch we are waiting for 5secs for response from userspace else we are returning error. Bug 3712829 Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com> Change-Id: I43ee139d4c2f737851ec1cf375e463d7c7c7d6f7 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2760068 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Preetham Chandru <pchandru@nvidia.com> Reviewed-by: Sandeep Trasi <strasi@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261630 Tested-by: Bhavesh Parekh <bparekh@nvidia.com> Reviewed-by: Bhavesh Parekh <bparekh@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Reviewed-by: svc-bootloader-acv <svc-bootloader-acv@nvidia.com>
This commit is contained in:
committed by
Jon Hunter
parent
cdefe42278
commit
f666d39d4d
@@ -38,6 +38,8 @@
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
#define NETLINK_USERSPACE_PM 30
|
||||
#define MAX_USER_CLIENT 64
|
||||
#define USERSPACE_RESPONSE_TIMEOUT msecs_to_jiffies(5000)
|
||||
|
||||
static struct sock *nl_sk;
|
||||
static struct completion netlink_complete;
|
||||
static spinlock_t netlink_lock;
|
||||
@@ -1000,7 +1002,11 @@ static int netlink_pm_notify(struct notifier_block *nb,
|
||||
|
||||
/*Receive the message from userspace*/
|
||||
if (user_client_count)
|
||||
wait_for_completion(&netlink_complete);
|
||||
if (wait_for_completion_timeout(&netlink_complete,
|
||||
USERSPACE_RESPONSE_TIMEOUT) == 0) {
|
||||
dev_err(data->dev, "%s target suspend failed\n", __func__);
|
||||
return NOTIFY_BAD;
|
||||
}
|
||||
break;
|
||||
|
||||
case PM_POST_HIBERNATION:
|
||||
@@ -1018,13 +1024,17 @@ static int netlink_pm_notify(struct notifier_block *nb,
|
||||
|
||||
/*Receive the message from userspace*/
|
||||
if (user_client_count)
|
||||
wait_for_completion(&netlink_complete);
|
||||
if (wait_for_completion_timeout(&netlink_complete,
|
||||
USERSPACE_RESPONSE_TIMEOUT) == 0) {
|
||||
dev_err(data->dev, "%s target resume failed\n", __func__);
|
||||
return NOTIFY_BAD;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
static struct notifier_block netlink_pm_nb = {
|
||||
|
||||
Reference in New Issue
Block a user