drivers/misc/ti-st: use cpu friendly completions
Be nice to CPU and don't hog the resources, use a nice wait_for_interruptible timeout for completions instead of wait_for_timeout which is non-interruptible. Signed-off-by: Pavan Savoy <pavan_savoy@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b64365a526
commit
537023580d
|
@ -207,8 +207,8 @@ static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wait_for_completion_timeout
|
if (!wait_for_completion_interruptible_timeout(
|
||||||
(&kim_gdata->kim_rcvd, msecs_to_jiffies(CMD_RESP_TIME))) {
|
&kim_gdata->kim_rcvd, msecs_to_jiffies(CMD_RESP_TIME))) {
|
||||||
pr_err(" waiting for ver info- timed out ");
|
pr_err(" waiting for ver info- timed out ");
|
||||||
return -ETIMEDOUT;
|
return -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
|
@ -370,8 +370,8 @@ static long download_firmware(struct kim_data_s *kim_gdata)
|
||||||
break;
|
break;
|
||||||
case ACTION_WAIT_EVENT: /* wait */
|
case ACTION_WAIT_EVENT: /* wait */
|
||||||
pr_debug("W");
|
pr_debug("W");
|
||||||
if (!wait_for_completion_timeout
|
if (!wait_for_completion_interruptible_timeout(
|
||||||
(&kim_gdata->kim_rcvd,
|
&kim_gdata->kim_rcvd,
|
||||||
msecs_to_jiffies(CMD_RESP_TIME))) {
|
msecs_to_jiffies(CMD_RESP_TIME))) {
|
||||||
pr_err("response timeout during fw download ");
|
pr_err("response timeout during fw download ");
|
||||||
/* timed out */
|
/* timed out */
|
||||||
|
@ -462,8 +462,8 @@ long st_kim_start(void *kim_data)
|
||||||
sysfs_notify(&kim_gdata->kim_pdev->dev.kobj,
|
sysfs_notify(&kim_gdata->kim_pdev->dev.kobj,
|
||||||
NULL, "install");
|
NULL, "install");
|
||||||
/* wait for ldisc to be installed */
|
/* wait for ldisc to be installed */
|
||||||
err = wait_for_completion_timeout(&kim_gdata->ldisc_installed,
|
err = wait_for_completion_interruptible_timeout(
|
||||||
msecs_to_jiffies(LDISC_TIME));
|
&kim_gdata->ldisc_installed, msecs_to_jiffies(LDISC_TIME));
|
||||||
if (!err) {
|
if (!err) {
|
||||||
/* ldisc installation timeout,
|
/* ldisc installation timeout,
|
||||||
* flush uart, power cycle BT_EN */
|
* flush uart, power cycle BT_EN */
|
||||||
|
@ -520,8 +520,8 @@ long st_kim_stop(void *kim_data)
|
||||||
sysfs_notify(&kim_gdata->kim_pdev->dev.kobj, NULL, "install");
|
sysfs_notify(&kim_gdata->kim_pdev->dev.kobj, NULL, "install");
|
||||||
|
|
||||||
/* wait for ldisc to be un-installed */
|
/* wait for ldisc to be un-installed */
|
||||||
err = wait_for_completion_timeout(&kim_gdata->ldisc_installed,
|
err = wait_for_completion_interruptible_timeout(
|
||||||
msecs_to_jiffies(LDISC_TIME));
|
&kim_gdata->ldisc_installed, msecs_to_jiffies(LDISC_TIME));
|
||||||
if (!err) { /* timeout */
|
if (!err) { /* timeout */
|
||||||
pr_err(" timed out waiting for ldisc to be un-installed");
|
pr_err(" timed out waiting for ldisc to be un-installed");
|
||||||
err = -ETIMEDOUT;
|
err = -ETIMEDOUT;
|
||||||
|
|
Loading…
Reference in New Issue