Commit 2e922f5a authored by Roland Dreier's avatar Roland Dreier Committed by Linus Torvalds

[PATCH] IB/mthca: mem-free doorbell record writing

Add a mthca_write_db_rec() to wrap writing doorbell records.  On
64-bit archs, this is just a 64-bit write, while on 32-bit archs it
splits the write into two 32-bit writes with a memory barrier to make
sure the two halves of the record are written in the correct order.
Signed-off-by: default avatarRoland Dreier <roland@topspin.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 83a2f648
......@@ -57,6 +57,11 @@ static inline void mthca_write64(u32 val[2], void __iomem *dest,
__raw_writeq(*(u64 *) val, dest);
}
static inline void mthca_write_db_rec(u32 val[2], u32 *db)
{
*(u64 *) db = *(u64 *) val;
}
#else
/*
......@@ -80,4 +85,11 @@ static inline void mthca_write64(u32 val[2], void __iomem *dest,
spin_unlock_irqrestore(doorbell_lock, flags);
}
static inline void mthca_write_db_rec(u32 val[2], u32 *db)
{
db[0] = val[0];
wmb();
db[1] = val[1];
}
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment