Commit b4d6c6a0 authored by Matthias Schiffer's avatar Matthias Schiffer Committed by Dmitry Torokhov

Input: synaptics-rmi4 - fix command completion check for bootloader v7/v8

The command register is reset to 0 when a command has completed. Check
for this condition instead of the error status, which will not accurately
reflect completion. In particular, the incorrect condition caused every
command error to be reported as a timeout.
Signed-off-by: default avatarMatthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
Link: https://lore.kernel.org/r/20220608124808.51402-4-matthias.schiffer@ew.tq-group.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 33fe4d97
......@@ -115,12 +115,12 @@ static irqreturn_t rmi_f34_attention(int irq, void *ctx)
} else {
ret = rmi_read_block(f34->fn->rmi_dev,
f34->fn->fd.data_base_addr +
f34->v7.off.flash_status,
f34->v7.off.flash_cmd,
&status, sizeof(status));
rmi_dbg(RMI_DEBUG_FN, &fn->dev, "%s: status: %#02x, ret: %d\n",
rmi_dbg(RMI_DEBUG_FN, &f34->fn->dev, "%s: cmd: %#02x, ret: %d\n",
__func__, status, ret);
if (!ret && !(status & 0x1f))
if (!ret && status == CMD_V7_IDLE)
complete(&f34->v7.cmd_done);
}
......
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