teknoraver / rpms / mstflint

Forked from rpms/mstflint 24 days ago
Clone
Blob Blame History Raw
From 963895584a99f3fc8a506a6ab65b9a0ffad6477c Mon Sep 17 00:00:00 2001
From: oburstein <oburstein@nvidia.com>
Date: Wed, 29 Jan 2025 16:33:52 +0200
Subject: [PATCH] [mtcr_ul] Remove flock() usage from READ4_PCI() WRITE4_PCI()
 macros no need for this semaphore as we rely on the VSC's semaphore.

---
 mtcr_ul/mtcr_ul_com.c | 28 ----------------------------
 1 file changed, 28 deletions(-)

diff --git a/mtcr_ul/mtcr_ul_com.c b/mtcr_ul/mtcr_ul_com.c
index d37b64f7..77d2f19a 100644
--- a/mtcr_ul/mtcr_ul_com.c
+++ b/mtcr_ul/mtcr_ul_com.c
@@ -712,21 +712,7 @@ enum {
     do                                                               \
     {                                                                \
         int       rc;                                                \
-        int       lock_rc;                                           \
-        ul_ctx_t* pci_ctx = mf->ul_ctx;                              \
-        lock_rc = _flock_int(pci_ctx->fdlock, LOCK_EX);              \
-        if (lock_rc)                                                 \
-        {                                                            \
-            perror(err_prefix);                                      \
-            action_on_fail;                                          \
-        }                                                            \
         rc = pread(mf->fd, val_ptr, 4, pci_offs);                    \
-        lock_rc = _flock_int(pci_ctx->fdlock, LOCK_UN);              \
-        if (lock_rc)                                                 \
-        {                                                            \
-            perror(err_prefix);                                      \
-            action_on_fail;                                          \
-        }                                                            \
         if (rc != 4)                                                 \
         {                                                            \
             if (rc < 0)                                              \
@@ -742,23 +728,9 @@ enum {
     do                                                            \
     {                                                             \
         int       rc;                                             \
-        int       lock_rc;                                        \
         u_int32_t val_le;                                         \
-        ul_ctx_t* pci_ctx = mf->ul_ctx;                           \
         val_le = __cpu_to_le32(val);                              \
-        lock_rc = _flock_int(pci_ctx->fdlock, LOCK_EX);           \
-        if (lock_rc)                                              \
-        {                                                         \
-            perror(err_prefix);                                   \
-            action_on_fail;                                       \
-        }                                                         \
         rc = pwrite(mf->fd, &val_le, 4, pci_offs);                \
-        lock_rc = _flock_int(pci_ctx->fdlock, LOCK_UN);           \
-        if (lock_rc)                                              \
-        {                                                         \
-            perror(err_prefix);                                   \
-            action_on_fail;                                       \
-        }                                                         \
         if (rc != 4)                                              \
         {                                                         \
             if (rc < 0)                                           \