summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Romer <benjamin.romer@unisys.com>2014-08-02 22:03:38 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-08-16 12:23:06 -0700
commite87cfde4a1e93aa0f0efc5ad7955500c2246f29b (patch)
tree838318f9744efe13e38d537054b622322b1c3647
parent2e20c4a7c8179d3216eaf03c3c8fa8badfb35290 (diff)
downloadlinux-e87cfde4a1e93aa0f0efc5ad7955500c2246f29b.tar.gz
linux-e87cfde4a1e93aa0f0efc5ad7955500c2246f29b.tar.bz2
linux-e87cfde4a1e93aa0f0efc5ad7955500c2246f29b.zip
staging: unisys: remove MEMORYBARRIER AND VolatileBarrier from commontypes
Remove the MEMORYBARRIER and VolatileBarrier() defines from commontypes.h and convert the spots that used this to mb(). Add comments to each use to indicate that the barrier is used to ensure channel synchronization between guests. Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/unisys/channels/channel.c6
-rw-r--r--drivers/staging/unisys/common-spar/include/channels/channel.h8
-rw-r--r--drivers/staging/unisys/include/commontypes.h4
-rw-r--r--drivers/staging/unisys/visorchannel/visorchannel_funcs.c4
4 files changed, 9 insertions, 13 deletions
diff --git a/drivers/staging/unisys/channels/channel.c b/drivers/staging/unisys/channels/channel.c
index ade2fe0da154..b4bdee4b575b 100644
--- a/drivers/staging/unisys/channels/channel.c
+++ b/drivers/staging/unisys/channels/channel.c
@@ -75,7 +75,7 @@ visor_signal_insert(CHANNEL_HEADER __iomem *pChannel, u32 Queue, void *pSignal)
(head * readl(&pqhdr->SignalSize));
memcpy_toio(psignal, pSignal, readl(&pqhdr->SignalSize));
- VolatileBarrier();
+ mb(); /* channel synch */
writel(head, &pqhdr->Head);
writeq(readq(&pqhdr->NumSignalsSent) + 1, &pqhdr->NumSignalsSent);
@@ -128,7 +128,7 @@ visor_signal_remove(CHANNEL_HEADER __iomem *pChannel, u32 Queue, void *pSignal)
(tail * readl(&pqhdr->SignalSize));
memcpy_fromio(pSignal, psource, readl(&pqhdr->SignalSize));
- VolatileBarrier();
+ mb(); /* channel synch */
writel(tail, &pqhdr->Tail);
writeq(readq(&pqhdr->NumSignalsReceived) + 1,
@@ -186,7 +186,7 @@ SignalRemoveAll(pCHANNEL_HEADER pChannel, u32 Queue, void *pSignal)
memcpy((char *) pSignal + (pqhdr->SignalSize * signalCount),
psource, pqhdr->SignalSize);
- VolatileBarrier();
+ mb(); /* channel synch */
pqhdr->Tail = tail;
signalCount++;
diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h b/drivers/staging/unisys/common-spar/include/channels/channel.h
index 15a8d6b35dac..bc923336fabd 100644
--- a/drivers/staging/unisys/common-spar/include/channels/channel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/channel.h
@@ -157,7 +157,7 @@ ULTRA_CHANNELCLI_STRING(u32 v)
PathName_Last_N_Nodes(__FILE__, 4), __LINE__); \
writel(newstate, &((CHANNEL_HEADER __iomem *) \
(pChan))->CliStateOS); \
- MEMORYBARRIER; \
+ mb(); /* required for channel synch */ \
} while (0)
#define ULTRA_CHANNEL_CLIENT_ACQUIRE_OS(pChan, chanId, logCtx) \
@@ -458,7 +458,7 @@ ULTRA_channel_client_acquire_os(void __iomem *pChannel, u8 *chanId,
CHANNELCLI_OWNED,
PathName_Last_N_Nodes((u8 *) file, 4), line);
writel(CHANNELCLI_OWNED, &pChan->CliStateOS);
- MEMORYBARRIER;
+ mb(); /* required for channel synch */
}
if (readl(&pChan->CliStateOS) == CHANNELCLI_OWNED) {
if (readb(&pChan->CliErrorOS) != 0) {
@@ -502,7 +502,7 @@ ULTRA_channel_client_acquire_os(void __iomem *pChannel, u8 *chanId,
return 0;
}
writel(CHANNELCLI_BUSY, &pChan->CliStateOS);
- MEMORYBARRIER;
+ mb(); /* required for channel synch */
if (readl(&pChan->CliStateBoot) == CHANNELCLI_BUSY) {
if ((readb(&pChan->CliErrorOS)
& ULTRA_CLIERROROS_THROTTLEMSG_BUSY) == 0) {
@@ -521,7 +521,7 @@ ULTRA_channel_client_acquire_os(void __iomem *pChannel, u8 *chanId,
}
/* reset busy */
writel(CHANNELCLI_ATTACHED, &pChan->CliStateOS);
- MEMORYBARRIER;
+ mb(); /* required for channel synch */
return 0;
}
if (readb(&pChan->CliErrorOS) != 0) {
diff --git a/drivers/staging/unisys/include/commontypes.h b/drivers/staging/unisys/include/commontypes.h
index 53ac77053340..34b31ad7b934 100644
--- a/drivers/staging/unisys/include/commontypes.h
+++ b/drivers/staging/unisys/include/commontypes.h
@@ -30,8 +30,6 @@ typedef u64 GUEST_PHYSICAL_ADDRESS;
#define INLINE inline
#define OFFSETOF offsetof
-#define MEMORYBARRIER mb()
-
#define CHANNEL_GUID_MISMATCH(chType, chName, field, expected, actual, fil, \
lin, logCtx) \
do { \
@@ -63,7 +61,5 @@ typedef u64 GUEST_PHYSICAL_ADDRESS;
LineNumber, Str, args...) \
pr_info(Str, ## args)
-#define VolatileBarrier() MEMORYBARRIER
-
#endif
diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
index 62ec9280cb3a..947b23c1e478 100644
--- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
+++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
@@ -424,7 +424,7 @@ visorchannel_signalremove(VISORCHANNEL *channel, u32 queue, void *msg)
/* For each data field in SIGNAL_QUEUE_HEADER that was modified,
* update host memory.
*/
- MEMORYBARRIER;
+ mb(); /* required for channel synch */
if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, Tail)) {
ERRDRV("visor_memregion_write of Tail failed: (status=%d)\n",
rc);
@@ -477,7 +477,7 @@ visorchannel_signalinsert(VISORCHANNEL *channel, u32 queue, void *msg)
/* For each data field in SIGNAL_QUEUE_HEADER that was modified,
* update host memory.
*/
- MEMORYBARRIER;
+ mb(); /* required for channel synch */
if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, Head)) {
ERRDRV("visor_memregion_write of Head failed: (status=%d)\n",
rc);