From: Santiago Leon 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 Signed-off-by: Andrew Morton --- 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->rx_no_buffer = *(u64*)(((char*)adapter->buffer_list_addr) + 4096 - 8); atomic_inc(&adapter->not_replenishing); - ibmveth_assert(atomic_read(&adapter->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->rx_invalid_buffer++; _