[ofw] patch: Fix door bell records on 64 systems
Tzachi Dar
tzachid at mellanox.co.il
Thu Jul 17 06:04:14 PDT 2008
This checkin fixes a bug that caused 64 bits arming to be done like on
32 bits systems.
Thanks
Tzachi & UriH
Index: kernel/bus/ib/mlx4_ib.h
===================================================================
--- kernel/bus/ib/mlx4_ib.h (revision 1394)
+++ kernel/bus/ib/mlx4_ib.h (working copy)
@@ -171,13 +171,16 @@
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: kernel/bus/inc/doorbell.h
===================================================================
--- kernel/bus/inc/doorbell.h (revision 1394)
+++ kernel/bus/inc/doorbell.h (working copy)
@@ -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
@@ -46,17 +46,17 @@
*/
#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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080717/d587bdbe/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: doorbell.patch
Type: application/octet-stream
Size: 1665 bytes
Desc: doorbell.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080717/d587bdbe/attachment.obj>
More information about the ofw
mailing list