]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: xillybus: Removed mmiowb() before mutex_unlock()
authorEli Billauer <eli.billauer@gmail.com>
Sat, 16 Aug 2014 15:57:57 +0000 (18:57 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Aug 2014 20:14:41 +0000 (13:14 -0700)
The relevant sequences consist of two I/O memory writes. The second write
depends on the first one. mmiowb() was inserted to make sure that no other
thread inserts a "first write" before the current one finished its second.

As a mutex protects this critical sequence, mmiowb() is unnecessary.

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/xillybus/xillybus_core.c

index 93a3c61b1cd5a1b8fd9594d8bd38612c05e71692..138c0695e290f199dde698ab43b945eafeb19f19 100644 (file)
@@ -908,8 +908,6 @@ static ssize_t xillybus_read(struct file *filp, char __user *userbuf,
                                           channel->endpoint->registers +
                                           fpga_buf_ctrl_reg);
 
-                               mmiowb(); /* Just to appear safe */
-
                                mutex_unlock(&channel->endpoint->
                                             register_mutex);
                        }
@@ -1118,7 +1116,6 @@ static int xillybus_myflush(struct xilly_channel *channel, long timeout)
                           (2 << 24) |  /* Opcode 2, submit buffer */
                           (bufidx << 12),
                           channel->endpoint->registers + fpga_buf_ctrl_reg);
-               mmiowb(); /* Just to appear safe */
 
                mutex_unlock(&channel->endpoint->register_mutex);
        } else if (bufidx == 0)
@@ -1369,7 +1366,6 @@ static ssize_t xillybus_write(struct file *filp, const char __user *userbuf,
                                           (bufidx << 12),
                                           channel->endpoint->registers +
                                           fpga_buf_ctrl_reg);
-                               mmiowb(); /* Just to appear safe */
 
                                mutex_unlock(&channel->endpoint->
                                             register_mutex);