<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Santiago Leon &lt;santil@us.ibm.com&gt;

This patch adds a memory barrier to ensure synchronization with the
hypervisor (and avoid a panic when the hypervisor is halfway through
writing to the descriptor).  It also removes an unnecessary check that is
flawed anyway because the value can change between the atomic_inc() and the
assert.

Signed-off-by: Santiago Leon &lt;santil@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 25-akpm/drivers/net/ibmveth.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN drivers/net/ibmveth.c~ibmveth-hypervisor-memory-barrier drivers/net/ibmveth.c
--- 25/drivers/net/ibmveth.c~ibmveth-hypervisor-memory-barrier	2004-08-15 13:02:46.176836912 -0700
+++ 25-akpm/drivers/net/ibmveth.c	2004-08-15 13:02:46.180836304 -0700
@@ -271,7 +271,6 @@ static void ibmveth_replenish_task(struc
 	adapter-&gt;rx_no_buffer = *(u64*)(((char*)adapter-&gt;buffer_list_addr) + 4096 - 8);
 
 	atomic_inc(&amp;adapter-&gt;not_replenishing);
-	ibmveth_assert(atomic_read(&amp;adapter-&gt;not_replenishing) == 1);
 }
 
 /* kick the replenish tasklet if we need replenishing and it isn't already running */
@@ -734,6 +733,8 @@ static int ibmveth_poll(struct net_devic
 		if(ibmveth_rxq_pending_buffer(adapter)) {
 			struct sk_buff *skb;
 
+			rmb();
+
 			if(!ibmveth_rxq_buffer_valid(adapter)) {
 				wmb(); /* suggested by larson1 */
 				adapter-&gt;rx_invalid_buffer++;
_
</pre></body></html>