diff options
Diffstat (limited to 'drivers/staging/unisys/visorchannel/visorchannel_funcs.c')
-rw-r--r-- | drivers/staging/unisys/visorchannel/visorchannel_funcs.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 62ec9280cb3a..01a44c553500 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -257,6 +257,7 @@ visorchannel_clear(VISORCHANNEL *channel, ulong offset, u8 ch, ulong nbytes) while (nbytes > 0) { ulong thisbytes = bufsize; int x = -1; + if (nbytes < thisbytes) thisbytes = nbytes; x = visor_memregion_write(channel->memregion, offset + written, @@ -424,7 +425,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 +478,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); @@ -520,6 +521,7 @@ int visorchannel_signalqueue_max_slots(VISORCHANNEL *channel, u32 queue) { SIGNAL_QUEUE_HEADER sig_hdr; + if (!sig_read_header(channel, queue, &sig_hdr)) return 0; return (int) sig_hdr.MaxSignals; @@ -612,6 +614,7 @@ visorchannel_debug(VISORCHANNEL *channel, int nQueues, else for (i = 0; i < nQueues; i++) { SIGNAL_QUEUE_HEADER q; + errcode = visorchannel_read(channel, off + phdr->oChannelSpace + (i * sizeof(q)), |