mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
Input: synaptics-rmi4 - propagate F54 worker errors to V4L2 queue
commit8786d74bf5upstream. Previously, rmi_f54_buffer_queue() waited for the worker thread to finish but ignored whether it succeeded. If the worker failed (e.g., due to a timeout or register read failure), the queue thread would silently return success, delivering stale or uninitialized memory to userspace. Add a 'report_error' field to struct f54_data to store the worker's exit status. Check this field in rmi_f54_buffer_queue() after the worker finishes, and mark the buffer as VB2_BUF_STATE_ERROR if an error occurred. Fixes:3a762dbd53("[media] Input: synaptics-rmi4 - add support for F54 diagnostics") Reported-by: sashiko-bot@kernel.org Cc: stable@vger.kernel.org Assisted-by: Antigravity:gemini-3.5-flash Link: https://patch.msgid.link/20260626051802.4033172-6-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1d718f1461
commit
2b0403fb7e
@@ -106,6 +106,7 @@ struct f54_data {
|
||||
u8 *report_data;
|
||||
size_t max_report_size;
|
||||
int report_size;
|
||||
int report_error;
|
||||
|
||||
bool is_busy;
|
||||
struct mutex status_mutex;
|
||||
@@ -340,6 +341,12 @@ static void rmi_f54_buffer_queue(struct vb2_buffer *vb)
|
||||
mutex_lock(&f54->data_mutex);
|
||||
}
|
||||
|
||||
if (f54->report_error) {
|
||||
dev_err(&f54->fn->dev, "Error acquiring report: %d\n", f54->report_error);
|
||||
state = VB2_BUF_STATE_ERROR;
|
||||
goto data_done;
|
||||
}
|
||||
|
||||
ptr = vb2_plane_vaddr(vb, 0);
|
||||
if (!ptr) {
|
||||
dev_err(&f54->fn->dev, "Error acquiring frame ptr\n");
|
||||
@@ -612,6 +619,7 @@ out:
|
||||
report_size = 0;
|
||||
|
||||
f54->report_size = report_size;
|
||||
f54->report_error = error;
|
||||
|
||||
if (report_size == 0 && !error) {
|
||||
queue_delayed_work(f54->workqueue, &f54->work,
|
||||
|
||||
Reference in New Issue
Block a user