Commit e87cfde4 authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman

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: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2e20c4a7
...@@ -75,7 +75,7 @@ visor_signal_insert(CHANNEL_HEADER __iomem *pChannel, u32 Queue, void *pSignal) ...@@ -75,7 +75,7 @@ visor_signal_insert(CHANNEL_HEADER __iomem *pChannel, u32 Queue, void *pSignal)
(head * readl(&pqhdr->SignalSize)); (head * readl(&pqhdr->SignalSize));
memcpy_toio(psignal, pSignal, readl(&pqhdr->SignalSize)); memcpy_toio(psignal, pSignal, readl(&pqhdr->SignalSize));
VolatileBarrier(); mb(); /* channel synch */
writel(head, &pqhdr->Head); writel(head, &pqhdr->Head);
writeq(readq(&pqhdr->NumSignalsSent) + 1, &pqhdr->NumSignalsSent); writeq(readq(&pqhdr->NumSignalsSent) + 1, &pqhdr->NumSignalsSent);
...@@ -128,7 +128,7 @@ visor_signal_remove(CHANNEL_HEADER __iomem *pChannel, u32 Queue, void *pSignal) ...@@ -128,7 +128,7 @@ visor_signal_remove(CHANNEL_HEADER __iomem *pChannel, u32 Queue, void *pSignal)
(tail * readl(&pqhdr->SignalSize)); (tail * readl(&pqhdr->SignalSize));
memcpy_fromio(pSignal, psource, readl(&pqhdr->SignalSize)); memcpy_fromio(pSignal, psource, readl(&pqhdr->SignalSize));
VolatileBarrier(); mb(); /* channel synch */
writel(tail, &pqhdr->Tail); writel(tail, &pqhdr->Tail);
writeq(readq(&pqhdr->NumSignalsReceived) + 1, writeq(readq(&pqhdr->NumSignalsReceived) + 1,
...@@ -186,7 +186,7 @@ SignalRemoveAll(pCHANNEL_HEADER pChannel, u32 Queue, void *pSignal) ...@@ -186,7 +186,7 @@ SignalRemoveAll(pCHANNEL_HEADER pChannel, u32 Queue, void *pSignal)
memcpy((char *) pSignal + (pqhdr->SignalSize * signalCount), memcpy((char *) pSignal + (pqhdr->SignalSize * signalCount),
psource, pqhdr->SignalSize); psource, pqhdr->SignalSize);
VolatileBarrier(); mb(); /* channel synch */
pqhdr->Tail = tail; pqhdr->Tail = tail;
signalCount++; signalCount++;
......
...@@ -157,7 +157,7 @@ ULTRA_CHANNELCLI_STRING(u32 v) ...@@ -157,7 +157,7 @@ ULTRA_CHANNELCLI_STRING(u32 v)
PathName_Last_N_Nodes(__FILE__, 4), __LINE__); \ PathName_Last_N_Nodes(__FILE__, 4), __LINE__); \
writel(newstate, &((CHANNEL_HEADER __iomem *) \ writel(newstate, &((CHANNEL_HEADER __iomem *) \
(pChan))->CliStateOS); \ (pChan))->CliStateOS); \
MEMORYBARRIER; \ mb(); /* required for channel synch */ \
} while (0) } while (0)
#define ULTRA_CHANNEL_CLIENT_ACQUIRE_OS(pChan, chanId, logCtx) \ #define ULTRA_CHANNEL_CLIENT_ACQUIRE_OS(pChan, chanId, logCtx) \
...@@ -458,7 +458,7 @@ ULTRA_channel_client_acquire_os(void __iomem *pChannel, u8 *chanId, ...@@ -458,7 +458,7 @@ ULTRA_channel_client_acquire_os(void __iomem *pChannel, u8 *chanId,
CHANNELCLI_OWNED, CHANNELCLI_OWNED,
PathName_Last_N_Nodes((u8 *) file, 4), line); PathName_Last_N_Nodes((u8 *) file, 4), line);
writel(CHANNELCLI_OWNED, &pChan->CliStateOS); writel(CHANNELCLI_OWNED, &pChan->CliStateOS);
MEMORYBARRIER; mb(); /* required for channel synch */
} }
if (readl(&pChan->CliStateOS) == CHANNELCLI_OWNED) { if (readl(&pChan->CliStateOS) == CHANNELCLI_OWNED) {
if (readb(&pChan->CliErrorOS) != 0) { if (readb(&pChan->CliErrorOS) != 0) {
...@@ -502,7 +502,7 @@ ULTRA_channel_client_acquire_os(void __iomem *pChannel, u8 *chanId, ...@@ -502,7 +502,7 @@ ULTRA_channel_client_acquire_os(void __iomem *pChannel, u8 *chanId,
return 0; return 0;
} }
writel(CHANNELCLI_BUSY, &pChan->CliStateOS); writel(CHANNELCLI_BUSY, &pChan->CliStateOS);
MEMORYBARRIER; mb(); /* required for channel synch */
if (readl(&pChan->CliStateBoot) == CHANNELCLI_BUSY) { if (readl(&pChan->CliStateBoot) == CHANNELCLI_BUSY) {
if ((readb(&pChan->CliErrorOS) if ((readb(&pChan->CliErrorOS)
& ULTRA_CLIERROROS_THROTTLEMSG_BUSY) == 0) { & ULTRA_CLIERROROS_THROTTLEMSG_BUSY) == 0) {
...@@ -521,7 +521,7 @@ ULTRA_channel_client_acquire_os(void __iomem *pChannel, u8 *chanId, ...@@ -521,7 +521,7 @@ ULTRA_channel_client_acquire_os(void __iomem *pChannel, u8 *chanId,
} }
/* reset busy */ /* reset busy */
writel(CHANNELCLI_ATTACHED, &pChan->CliStateOS); writel(CHANNELCLI_ATTACHED, &pChan->CliStateOS);
MEMORYBARRIER; mb(); /* required for channel synch */
return 0; return 0;
} }
if (readb(&pChan->CliErrorOS) != 0) { if (readb(&pChan->CliErrorOS) != 0) {
......
...@@ -30,8 +30,6 @@ typedef u64 GUEST_PHYSICAL_ADDRESS; ...@@ -30,8 +30,6 @@ typedef u64 GUEST_PHYSICAL_ADDRESS;
#define INLINE inline #define INLINE inline
#define OFFSETOF offsetof #define OFFSETOF offsetof
#define MEMORYBARRIER mb()
#define CHANNEL_GUID_MISMATCH(chType, chName, field, expected, actual, fil, \ #define CHANNEL_GUID_MISMATCH(chType, chName, field, expected, actual, fil, \
lin, logCtx) \ lin, logCtx) \
do { \ do { \
...@@ -63,7 +61,5 @@ typedef u64 GUEST_PHYSICAL_ADDRESS; ...@@ -63,7 +61,5 @@ typedef u64 GUEST_PHYSICAL_ADDRESS;
LineNumber, Str, args...) \ LineNumber, Str, args...) \
pr_info(Str, ## args) pr_info(Str, ## args)
#define VolatileBarrier() MEMORYBARRIER
#endif #endif
...@@ -424,7 +424,7 @@ visorchannel_signalremove(VISORCHANNEL *channel, u32 queue, void *msg) ...@@ -424,7 +424,7 @@ visorchannel_signalremove(VISORCHANNEL *channel, u32 queue, void *msg)
/* For each data field in SIGNAL_QUEUE_HEADER that was modified, /* For each data field in SIGNAL_QUEUE_HEADER that was modified,
* update host memory. * update host memory.
*/ */
MEMORYBARRIER; mb(); /* required for channel synch */
if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, Tail)) { if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, Tail)) {
ERRDRV("visor_memregion_write of Tail failed: (status=%d)\n", ERRDRV("visor_memregion_write of Tail failed: (status=%d)\n",
rc); rc);
...@@ -477,7 +477,7 @@ visorchannel_signalinsert(VISORCHANNEL *channel, u32 queue, void *msg) ...@@ -477,7 +477,7 @@ visorchannel_signalinsert(VISORCHANNEL *channel, u32 queue, void *msg)
/* For each data field in SIGNAL_QUEUE_HEADER that was modified, /* For each data field in SIGNAL_QUEUE_HEADER that was modified,
* update host memory. * update host memory.
*/ */
MEMORYBARRIER; mb(); /* required for channel synch */
if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, Head)) { if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, Head)) {
ERRDRV("visor_memregion_write of Head failed: (status=%d)\n", ERRDRV("visor_memregion_write of Head failed: (status=%d)\n",
rc); rc);
......
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