Patch "drm/msm/rd: Fix FIFO-full deadlock" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/msm/rd: Fix FIFO-full deadlock

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-msm-rd-fix-fifo-full-deadlock.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit cf344c7952bd6906f37233151c47feed47f9c38a
Author: Rob Clark <robdclark@xxxxxxxxxxxx>
Date:   Sun Aug 7 09:09:01 2022 -0700

    drm/msm/rd: Fix FIFO-full deadlock
    
    [ Upstream commit 174974d8463b77c2b4065e98513adb204e64de7d ]
    
    If the previous thing cat'ing $debugfs/rd left the FIFO full, then
    subsequent open could deadlock in rd_write() (because open is blocked,
    not giving a chance for read() to consume any data in the FIFO).  Also
    it is generally a good idea to clear out old data from the FIFO.
    
    Signed-off-by: Rob Clark <robdclark@xxxxxxxxxxxx>
    Patchwork: https://patchwork.freedesktop.org/patch/496706/
    Link: https://lore.kernel.org/r/20220807160901.2353471-2-robdclark@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/msm/msm_rd.c b/drivers/gpu/drm/msm/msm_rd.c
index c7832a951039f..a6b024b06b363 100644
--- a/drivers/gpu/drm/msm/msm_rd.c
+++ b/drivers/gpu/drm/msm/msm_rd.c
@@ -191,6 +191,9 @@ static int rd_open(struct inode *inode, struct file *file)
 	file->private_data = rd;
 	rd->open = true;
 
+	/* Reset fifo to clear any previously unread data: */
+	rd->fifo.head = rd->fifo.tail = 0;
+
 	/* the parsing tools need to know gpu-id to know which
 	 * register database to load.
 	 */



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux