mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-03 16:13:17 +01:00
Input: cypress_ps2 - report timeouts when reading command status
Report -ETIMEDOUT error code from cypress_ps2_read_cmd_status() when device does not send enough data within the allotted time in response to a command. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
This commit is contained in:
1 parent
e8688b93ce
commit
8bccf667f6
1 file changed
+6
-3
@@ -115,9 +115,12 @@ static int cypress_ps2_read_cmd_status(struct psmouse *psmouse,
|
||||
if (rc < 0)
|
||||
goto out;
|
||||
|
||||
wait_event_timeout(ps2dev->wait,
|
||||
(psmouse->pktcnt >= pktsize),
|
||||
msecs_to_jiffies(CYTP_CMD_TIMEOUT));
|
||||
if (!wait_event_timeout(ps2dev->wait,
|
||||
psmouse->pktcnt >= pktsize,
|
||||
msecs_to_jiffies(CYTP_CMD_TIMEOUT))) {
|
||||
rc = -ETIMEDOUT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
memcpy(param, psmouse->packet, pktsize);
|
||||
|
||||
|
||||
Reference in new issue
Block a user