From 174974d8463b77c2b4065e98513adb204e64de7d Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sun, 7 Aug 2022 09:09:01 -0700 Subject: drm/msm/rd: Fix FIFO-full deadlock 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 Patchwork: https://patchwork.freedesktop.org/patch/496706/ Link: https://lore.kernel.org/r/20220807160901.2353471-2-robdclark@gmail.com --- drivers/gpu/drm/msm/msm_rd.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/gpu/drm/msm/msm_rd.c') diff --git a/drivers/gpu/drm/msm/msm_rd.c b/drivers/gpu/drm/msm/msm_rd.c index a92ffde53f0b..db2f847c8535 100644 --- a/drivers/gpu/drm/msm/msm_rd.c +++ b/drivers/gpu/drm/msm/msm_rd.c @@ -196,6 +196,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. * -- cgit v1.2.3 c9f7458f44f1b2369d7a7ab9346d55546161'>refslogtreecommitdiffstats
AgeCommit message (Expand)AuthorFilesLines
2014-01-26net: add and use skb_gso_transport_seglen()Florian Westphal3-10/+29
2014-01-26um: hostfs: make functions staticJames Hogan1-25/+28
2014-01-26um: Include generic barrier.hRichard Weinberger1-0/+1
2014-01-26um: Removed unused attributes from thread_structRichard Weinberger1-3/+0
2014-01-25ipmi: Cleanup error returnCorey Minyard1-15/+29
2014-01-25ipmi: fix timeout calculation when bmc is disconnectedXie XiuQi1-1/+1
2014-01-25ipmi: use USEC_PER_SEC instead of 1000000 for more meaningfulXie XiuQi3-7/+7
2014-01-25ipmi: remove deprecated IRQF_DISABLEDMichael Opdenacker1-2/+2
2014-01-24net/cxgb4: Fix referencing freed adapterGavin Shan1-1/+1
2014-01-24ipv6: reallocate addrconf router for ipv6 address when lo device upGao feng1-2/+12
2014-01-24fib_frontend: fix possible NULL pointer dereferenceOliver Hartkopp1-0/+2
2014-01-249p: update documentationEric Van Hensbergen1-11/+6
2014-01-24rtnetlink: remove IFLA_BOND_SLAVE definitionJiri Pirko1-1/+0
2014-01-23lib/decompress_unlz4.c: always set an error return code on failuresJan Beulich1-0/+1
2014-01-23romfs: fix returm err while getting inode in fill_superRui Xiang1-4/+2
2014-01-23drivers/w1/masters/w1-gpio.c: add strong pullup emulationEvgeny Boger3-12/+23
2014-01-23drivers/memstick/host/rtsx_pci_ms.c: fix ms card data transfer bugMicky Ching1-10/+20
2014-01-23userns: relax the posix_acl_valid() checksAndreas Gruenbacher1-10/+0
2014-01-23arch/sh/kernel/dwarf.c: use rbtree postorder iteration helper instead of solu...Cody P Schafer1-14/+4
2014-01-23fs-ext3-use-rbtree-postorder-iteration-helper-instead-of-opencoding-fixAndrew Morton1-4/+4
2014-01-23fs/ext3: use rbtree postorder iteration helper instead of opencodingCody P Schafer1-31/+5
2014-01-23fs/jffs2: use rbtree postorder iteration helper instead of opencodingCody P Schafer2-49/+5
2014-01-23fs/ext4: use rbtree postorder iteration helper instead of opencodingCody P Schafer2-59/+9
2014-01-23fs/ubifs: use rbtree postorder iteration helper instead of opencodingCody P Schafer6-114/+17
2014-01-23net/netfilter/ipset/ip_set_hash_netiface.c: use rbtree postorder iteration in...Cody P Schafer1-23/+4
2014-01-23rbtree/test: test rbtree_postorder_for_each_entry_safe()Cody P Schafer1-0/+11
2014-01-23rbtree/test: move rb_node to the middle of the test structCody P Schafer1-1/+1
2014-01-23rapidio: add modular rapidio core build into powerpc and mips branchesAlexandre Bounine2-3/+3
2014-01-23partitions/efi: complete documentation of gpt kernel param purposeDavidlohr Bueso1-1/+3