msm: ice: Modify the waiting condition in suspend

This change rectifies the condition which blocks suspend
function of ice and prints debug message if timeout occurs
when ice is busy.

Change-Id: Id21e06ddb34b32867dfd86eef6c25cd4d2bb7fba
Signed-off-by: Prerna Kalla <prernak@codeaurora.org>
tirimbino
Prerna Kalla 5 years ago
parent 143e58dccc
commit da4cb9d4de
  1. 15
      drivers/crypto/msm/ice.c

@ -846,18 +846,27 @@ static int qcom_ice_remove(struct platform_device *pdev)
static int qcom_ice_suspend(struct platform_device *pdev)
{
struct ice_device *ice_dev;
int ret = 0;
ice_dev = (struct ice_device *)platform_get_drvdata(pdev);
if (!ice_dev)
return -EINVAL;
if (atomic_read(&ice_dev->is_ice_busy) != 0)
wait_event_interruptible_timeout(
if (atomic_read(&ice_dev->is_ice_busy) != 0) {
ret = wait_event_interruptible_timeout(
ice_dev->block_suspend_ice_queue,
atomic_read(&ice_dev->is_ice_busy) != 0,
atomic_read(&ice_dev->is_ice_busy) == 0,
msecs_to_jiffies(1000));
if (!ret) {
pr_err("%s: Suspend ICE during an ongoing operation\n",
__func__);
atomic_set(&ice_dev->is_ice_suspended, 0);
return -ETIME;
}
}
atomic_set(&ice_dev->is_ice_suspended, 1);
return 0;

Loading…
Cancel
Save