]> Git Repo - linux.git/commitdiff
mei: cleanup status before client dma setup call
authorAlexander Usyskin <[email protected]>
Thu, 23 Dec 2021 09:47:05 +0000 (11:47 +0200)
committerGreg Kroah-Hartman <[email protected]>
Mon, 27 Dec 2021 09:30:48 +0000 (10:30 +0100)
The upper layer may retry call to mei_cl_dma_alloc_and_map(),
in that case the client status may be non-zero after the previous call
and the wait condition will be true immediately.
Set cl->status to zero to allow waiting for an actual result
from the firmware.

Signed-off-by: Alexander Usyskin <[email protected]>
Signed-off-by: Tomas Winkler <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/misc/mei/client.c

index 96f4e59c32a5436b1665e51fde4cb33d1dbb6069..22be86a205bfbba60ab6a7283370e0ec9ad37911 100644 (file)
@@ -2327,6 +2327,8 @@ int mei_cl_dma_alloc_and_map(struct mei_cl *cl, const struct file *fp,
                list_move_tail(&cb->list, &dev->ctrl_rd_list);
        }
 
+       cl->status = 0;
+
        mutex_unlock(&dev->device_lock);
        wait_event_timeout(cl->wait,
                           cl->dma_mapped || cl->status,
@@ -2404,6 +2406,8 @@ int mei_cl_dma_unmap(struct mei_cl *cl, const struct file *fp)
                list_move_tail(&cb->list, &dev->ctrl_rd_list);
        }
 
+       cl->status = 0;
+
        mutex_unlock(&dev->device_lock);
        wait_event_timeout(cl->wait,
                           !cl->dma_mapped || cl->status,
This page took 0.05752 seconds and 4 git commands to generate.