]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[mlx4] Fix bug in win64 doorbell. (mlnx: 2777, 2791)
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 21 Jul 2008 12:37:02 +0000 (12:37 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 21 Jul 2008 12:37:02 +0000 (12:37 +0000)
Due the bug always the code acquire the spin lock although we run on 64 bits machine

git-svn-id: svn://openib.tc.cornell.edu/gen1@1426 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

trunk/hw/mlx4/kernel/bus/ib/mlx4_ib.h
trunk/hw/mlx4/kernel/bus/inc/doorbell.h

index a61af779e39783a6cb843f4c6c683b1a7e5b4a9b..467ac916ecb4e5d5f34ae27754334182492607e5 100644 (file)
@@ -171,13 +171,16 @@ struct mlx4_ib_dev {
 
        struct mlx4_uar         priv_uar;
        u32                     priv_pdn;
-       MLX4_DECLARE_DOORBELL_LOCK(uar_lock);
 
        struct ib_mad_agent    *send_agent[MLX4_MAX_PORTS][2];
        struct ib_ah           *sm_ah[MLX4_MAX_PORTS];
        spinlock_t              sm_lock;
 
        struct mutex            cap_mask_mutex;
+
+#ifndef _WIN64 
+    spinlock_t uar_lock;
+#endif    
 };
 
 static inline struct mlx4_ib_dev *to_mdev(struct ib_device *ibdev)
index 2a00c154c37032322e57ad26cc96b3c4f32fd729..0d694cbe41abbed9eaf84495e4e185989c31c6fe 100644 (file)
@@ -38,7 +38,7 @@
 #define MLX4_SEND_DOORBELL    0x14
 #define MLX4_CQ_DOORBELL      0x20
 
-#if BITS_PER_LONG == 64
+#if _WIN64
 /*
  * Assume that we can just write a 64-bit doorbell atomically.  s390
  * actually doesn't have writeq() but S/390 systems don't even have
  */
 
 #define MLX4_DECLARE_DOORBELL_LOCK(name)
-#define MLX4_INIT_DOORBELL_LOCK(ptr)    do { } while (0)
+#define MLX4_INIT_DOORBELL_LOCK(ptr)    
 #define MLX4_GET_DOORBELL_LOCK(ptr)      (NULL)
 
 static inline void mlx4_write64(__be32 val[2], void __iomem *dest,
                                spinlock_t *doorbell_lock)
 {
-       __raw_writeq(*(u64 *) val, dest);
+    UNREFERENCED_PARAMETER(doorbell_lock);
+       *(volatile u64 *)dest = *(volatile u64 *)val;
 }
 
 #else
-
 /*
  * Just fall back to a spinlock to protect the doorbell if
  * BITS_PER_LONG is 32 -- there's no portable way to do atomic 64-bit