Comments (1)
Proposed patch:
From a432b7a86a14eefed708ca08669fdfcae9a76c66 Mon Sep 17 00:00:00 2001
From: Mark Harfouche <[email protected]>
Date: Mon, 20 May 2019 20:07:59 -0400
Subject: [PATCH] attemp to fixup early free of resources in xpdev_queue_delete
---
QDMA/linux-kernel/drv/qdma_mod.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/QDMA/linux-kernel/drv/qdma_mod.c b/QDMA/linux-kernel/drv/qdma_mod.c
index 1557dc3..6552899 100644
--- a/QDMA/linux-kernel/drv/qdma_mod.c
+++ b/QDMA/linux-kernel/drv/qdma_mod.c
@@ -1547,7 +1547,7 @@ int xpdev_queue_delete(struct xlnx_pci_dev *xpdev, unsigned int qidx, bool c2h,
{
struct xlnx_qdata *qdata = xpdev_queue_get(xpdev, qidx, c2h, 1, ebuf,
ebuflen);
- int rv = 0;
+ int rv = 1;
if (!qdata)
return -EINVAL;
@@ -1555,12 +1555,6 @@ int xpdev_queue_delete(struct xlnx_pci_dev *xpdev, unsigned int qidx, bool c2h,
if(!qdata->xcdev)
return -EINVAL;
- spin_lock(&xpdev->cdev_lock);
- qdata->xcdev->dir_init &= ~(1 << (c2h ? 1 : 0));
- if (qdata->xcdev && !qdata->xcdev->dir_init)
- qdma_cdev_destroy(qdata->xcdev);
- spin_unlock(&xpdev->cdev_lock);
-
if (qdata->qhndl != QDMA_QUEUE_IDX_INVALID)
rv = qdma_queue_remove(xpdev->dev_hndl, qdata->qhndl,
ebuf, ebuflen);
@@ -1570,6 +1564,13 @@ int xpdev_queue_delete(struct xlnx_pci_dev *xpdev, unsigned int qidx, bool c2h,
if (rv < 0)
goto exit;
+ // Optimistically remvoe the direction flag
+ spin_lock(&xpdev->cdev_lock);
+ qdata->xcdev->dir_init &= ~(1 << (c2h ? 1 : 0));
+ if (qdata->xcdev && !qdata->xcdev->dir_init)
+ qdma_cdev_destroy(qdata->xcdev);
+ spin_unlock(&xpdev->cdev_lock);
+
memset(qdata, 0, sizeof(*qdata));
exit:
return rv;
--
2.21.0
comments are appreciated. Maybe we need to optimistically hide resources from other threads attempt to delete the queue, then revert if we fail????
from dma_ip_drivers.
Related Issues (20)
- xdma driver install error HOT 1
- And here is complete guide for repaire the issue: HOT 2
- what is the unit of xdma BW in xdma run test
- assignment of read-only member ‘vm_flags’ HOT 4
- ‘struct genl_ops’ has no member named ‘policy’ HOT 1
- The xdma linux kernel driver does not build against Ubuntu kernel 6.5.x (Ubuntu 22.04.1_LTS). Any idea? HOT 3
- dma-perf can only get half of the bandwidth of a x8 PCIe Gen 5 card. Any suggestions?
- "DESC_COMPL" and "DESC_STOPPED" HOT 1
- Up to date drivers for Linux 6.8.9
- Is there a way for xdma driver to serve risc-v PC
- xdma: read write fpga user reg abnormal HOT 1
- Ubuntu 24.04 -Werror=incompatible-pointer-types HOT 1
- Warning when install xdma drivers:modules_install: missing 'System.map' file. Skipping depmod.
- kernel headers after linux 6.3
- can XDMA used with DPDK?
- XDMA driver for ubuntu24.04 HOT 2
- Building failed HOT 16
- 7022 (rev ff)
- XMDA: Low perfomance numbers on Gen3x16 HOT 8
- Driver assumes SBI is out of reset
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dma_ip_drivers.