Commit d0344ef6 authored by Pavan Savoy's avatar Pavan Savoy Committed by Greg Kroah-Hartman

drivers:misc: ti-st: wait for completion at fail

When the line discipline install fails for reasons such as missing user-space
UIM or broken communication between UIM and ST driver, then the ST
attempts/retries to request for ldisc installation again.
Signed-off-by: default avatarPavan Savoy <pavan_savoy@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2f81a02c
...@@ -473,6 +473,12 @@ long st_kim_start(void *kim_data) ...@@ -473,6 +473,12 @@ long st_kim_start(void *kim_data)
pr_info("ldisc_install = 0"); pr_info("ldisc_install = 0");
sysfs_notify(&kim_gdata->kim_pdev->dev.kobj, sysfs_notify(&kim_gdata->kim_pdev->dev.kobj,
NULL, "install"); NULL, "install");
/* the following wait is never going to be completed,
* since the ldisc was never installed, hence serving
* as a mdelay of LDISC_TIME msecs */
err = wait_for_completion_timeout
(&kim_gdata->ldisc_installed,
msecs_to_jiffies(LDISC_TIME));
err = -ETIMEDOUT; err = -ETIMEDOUT;
continue; continue;
} else { } else {
...@@ -485,6 +491,13 @@ long st_kim_start(void *kim_data) ...@@ -485,6 +491,13 @@ long st_kim_start(void *kim_data)
pr_info("ldisc_install = 0"); pr_info("ldisc_install = 0");
sysfs_notify(&kim_gdata->kim_pdev->dev.kobj, sysfs_notify(&kim_gdata->kim_pdev->dev.kobj,
NULL, "install"); NULL, "install");
/* this wait might be completed, though in the
* tty_close() since the ldisc is already
* installed */
err = wait_for_completion_timeout
(&kim_gdata->ldisc_installed,
msecs_to_jiffies(LDISC_TIME));
err = -EINVAL;
continue; continue;
} else { /* on success don't retry */ } else { /* on success don't retry */
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment